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
|
Help.. Again :) - Fanstetic - 08-31-2012 Hello, I'm working on an amnesia custom story and I want to know how to make all 3 of these doors explode at once, theres no errors or anything but when i walk by they don't explode the names of the doors are: Door smash 1, door smash 2, door smash 3. The area is called door_smash1 This is the scripting, the door slam DOES work, there is no problems there. void OnStart() { AddEntityCollideCallback("Player", "script_slam 1", "func_slam", true, 1); SetEntityPlayerInteractCallback("door smash 1, door smash 2, door smash 3", "func_slam", true); } void func_slam(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); SetPropHealth("door smash 1, door smash 2, 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); } Please reply soon!!!! Thanks RE: Help.. Again :) - Kazakarumariou - 08-31-2012 Right off the bat SetEntityPlayerInteractCallback("door smash 1, door smash 2, door smash 3", "func_slam", true); Don't use various ones at once Do this \/ SetEntityPlayerInteractCallback("door smash 1", "func_slam1", true); SetEntityPlayerInteractCallback("door smash 2", "func_slam2", true); SetEntityPlayerInteractCallback("door smash 3", "func_slam3", true); RE: Help.. Again :) - Fanstetic - 08-31-2012 (08-31-2012, 12:25 AM)Harthex Wrote: Right off the batSo like this.. (Still doesn't work, but it's a start) void OnStart() { AddEntityCollideCallback("Player", "script_slam 1", "func_slam", true, 1); SetEntityPlayerInteractCallback("door smash 1", "func_slam", true); SetEntityPlayerInteractCallback("door smash 2", "func_slam", true); SetEntityPlayerInteractCallback("door smash 3", "func_slam", true); } void func_slam(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); 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 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); } RE: Help.. Again :) - Kazakarumariou - 08-31-2012 That'll break all the doors if you touch only one. or reach the script area. RE: Help.. Again :) - Fanstetic - 08-31-2012 (08-31-2012, 12:32 AM)Harthex Wrote: That'll break all the doors if you touch only one. or reach the script area.No, none of them break, not when i touch them or walk into the script area :/ (08-31-2012, 12:32 AM)Harthex Wrote: That'll break all the doors if you touch only one. or reach the script area.Oh i know the problem... but I don't know how to fix it, ok I want one script area to break the 3 doors, and the other script area to slam the door, so how do I have 2 different script areas? RE: Help.. Again :) - Kazakarumariou - 08-31-2012 Oh hey, what's the name of the doors? Also you need a different thingy for the different callbacks. I'd script up an example, but i got to go to work. RE: Help.. Again :) - Fanstetic - 08-31-2012 (08-31-2012, 01:43 AM)Harthex Wrote: Oh hey, what's the name of the doors? Also you need a different thingy for the different callbacks.Door smash 1, door smash 2, door smash 3, and work? dude its 10:30 here haha, night shift? RE: Help.. Again :) - Streetboat - 08-31-2012 (08-31-2012, 12:25 AM)Harthex Wrote: Right off the batThis is true. Also, if you're looking to save space, you can do it like this: for(int i=1;i<=3;i++)SetEntityPlayerInteractCallback("door smash "+i, "func_slam"+i, true); And it will achieve the same effect. This is very useful for scripts that call the same function on multiple entities at once, such as turning off all the lights in a room or so on. You can call it all on one line, instead of multiple lines. RE: Help.. Again :) - FlawlessHappiness - 08-31-2012 Do not use spaces in something that is not displayed on the screen. All names and stuff should be with this little thing _ instead. RE: Help.. Again :) - Fanstetic - 08-31-2012 Ok, I'm going to re-word my question, i have 4 doors, one i want to slam which is in a different place then the other 3 doors, the door that slams has its own script area and everything, i just want to know how to make the other script area blow up the three doors, so theres one script area infront of the slamming door, (which works) and theres an area infront of the other 3 doors. I want to make it so the 3 doors explode by running through one script area, then walk through the door, walk through another script area and make that door slam shut. the script is.. void OnStart() { AddEntityCollideCallback("Player", "script_slam 1", "func_slam", true, 1); SetEntityPlayerInteractCallback("door smash 1", "func_slam", true); SetEntityPlayerInteractCallback("door smash 2", "func_slam", true); SetEntityPlayerInteractCallback("door smash 3", "func_slam", true); } void func_slam(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); 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); } |