![]() |
Help.. Again :) - 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: Help.. Again :) (/thread-18057.html) Pages:
1
2
|
RE: Help.. Again :) - Steve - 08-31-2012 le try this: void OnStart() { AddEntityCollideCallback("Player", "script_slam_1", "func_slam_shut", true, 1); AddEntityCollideCallback("Player", "door_smash_area_1", "func_slam", true, 1); AddEntityCollideCallback("Player", "door_smash_area_2", "func_slam", true, 1); AddEntityCollideCallback("Player", "door_smash_area_3", "func_slam", true, 1); } void func_slam_shut(string &in asParent, string &in asChild, int alState) { SetSwingDoorClosed("prison1", 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); } void func_slam(string &in asParent, string &in asChild, int alState) { SetPropHealth("door_smash_1", 0.0f); 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); SetPropHealth("door_smash_2", 0.0f); 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); SetPropHealth("door_smash_3", 0.0f); 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); } I'm not quite sure it's this you want but this is what I can make out of your explaination. also I higlighted some stuff which name I changed baceause you can't use spaces alos make area's with the name I put in the code. RE: Help.. Again :) - Fanstetic - 08-31-2012 (08-31-2012, 08:19 AM)Steve Wrote: le try this:Now nothing happens when i walk passed the doors... :/ RE: Help.. Again :) - FlawlessHappiness - 08-31-2012 Check names again. Also there is no reason in calling the function 3 times with 3 different scriptareas. Just make one: void OnStart() { AddEntityCollideCallback("Player", "door_smash_area", "func_slam", true, 1) } void func_slam(string &in asParent, string &in asChild, int alState) { 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); SetPropHealth("door_smash_1", 0.0f); SetPropHealth("door_smash_2", 0.0f); SetPropHealth("door_smash_3", 0.0f); GiveSanityDamage(5.0f, true); } |