Frictional Games Forum (read-only)

Full Version: Door slam and cache?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I've been trying to make a door slam following THIS tutorial here, from frictional games wiki, but it doesn't work! I could'nt find any mistake... I think this is being caused by the map.cache, that you guys say that causes several issues, so I deleted it, but every time I go test the level, another file is created!

Here's the map.cache:

void OnStart()
{
AddEntityCollideCallback("Player", "script_bam", "func_bam", true, 1);
}

void func_bam(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("door1", true, true);
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
PlaySoundAtEntity("", "react_scare", "Player", 0, false);
PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);
GiveSanityDamage(5.0f, true);
}

Please help me!
This is not the map_cache, this is a script, from your script file. If you are worried about map_cache files, setup a developer environment (how to is in wiki), and your game will ignore them.

Check entity names in your level editor to see if their names match. Probably that's the cause.
(10-26-2011, 06:39 PM)Tanshaydar Wrote: [ -> ]This is not the map_cache, this is a script, from your script file. If you are worried about map_cache files, setup a developer environment (how to is in wiki), and your game will ignore them.

Check entity names in your level editor to see if their names match. Probably that's the cause.
The door is called "door1" (without the thingies) and the area is called "script_bam".
Your code looks fine. Are you sure the script itself is running? It must be named the same as your map.

Example:
Castle.map
Castle.hps
Yes, I know that, it is correct.
(10-26-2011, 07:13 PM)Victor Wrote: [ -> ]Yes, I know that, it is correct.
Please, help?
Does at least the sound and sanity damage get set off?
Nope. Nothing.
(10-26-2011, 09:48 PM)Victor Wrote: [ -> ]Nope. Nothing.
Help?
Use debug messages to see if Player actually collides with that area. I wager you already set up a developer environment and thus can see debug messages through F1 menu.
Pages: 1 2