Frictional Games Forum (read-only)
Door slam and cache? - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: Door slam and cache? (/thread-10994.html)

Pages: 1 2


Door slam and cache? - Victor - 10-26-2011

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!


RE: Door slam and cache? - Tanshaydar - 10-26-2011

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.


RE: Door slam and cache? - Victor - 10-26-2011

(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".



RE: Door slam and cache? - MBchrono - 10-26-2011

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



RE: Door slam and cache? - Victor - 10-26-2011

Yes, I know that, it is correct.



RE: Door slam and cache? - Victor - 10-26-2011

(10-26-2011, 07:13 PM)Victor Wrote: Yes, I know that, it is correct.
Please, help?



RE: Door slam and cache? - Your Computer - 10-26-2011

Does at least the sound and sanity damage get set off?


RE: Door slam and cache? - Victor - 10-26-2011

Nope. Nothing.



RE: Door slam and cache? - Victor - 10-26-2011

(10-26-2011, 09:48 PM)Victor Wrote: Nope. Nothing.
Help?



RE: Door slam and cache? - Tanshaydar - 10-26-2011

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.