Help with scripting a "Scary Door" - 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 (https://www.frictionalgames.com/forum/forum-35.html) +--- Thread: Help with scripting a "Scary Door" (/thread-4742.html) |
Help with scripting a "Scary Door" - Equil - 09-25-2010 I'm very new to this whole scripting thing and only know a few very basic things, so any help is appreciated. I've been lurking for a while now looking on how to script a "Scary Door" properly. I saw some threads which did help, it's now functioning properly, slamming shut when the player enters the area I specified. However, the area still triggers the whole event of slamming and sanity damage when the player enters the area even if the door is closed. I want the event to not occur at all if the player enters the room, closes the door then enters the area. I know this can be remedied somehow with the "GetSwingDoorClosed" function in an if else ladder, I've experimented with those to no avail, only receiving errors or no results. I believe it's a simple fix but I'm just unsure of how to do this, so again, any help is appreciated. Here is the existing script: Code: //////////////////////////// I would appreciate it greatly if someone could point out where this code needs to be. Thanks in advance. RE: Help with scripting a "Scary Door" - Pandemoneus - 09-25-2010 Code: void DoorSlam(string &in asParent, string &in asChild, int alState) When the player enters the area AreaDoorSlam1, the function will still trigger but it won't do anything when the door is closed. RE: Help with scripting a "Scary Door" - Equil - 09-25-2010 Thanks for that, I knew it was something simple, it works fine now. I do apologize that I'm completely new at this, but I'm slowly learning and look forward to making great scripts. Thanks again. RE: Help with scripting a "Scary Door" - Pandemoneus - 09-25-2010 No problem, we all started at that point. |