Frictional Games Forum (read-only)
Door Opening Scripting Question - 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 Opening Scripting Question (/thread-11575.html)



Door Opening Scripting Question - NuggetBlubber - 11-29-2011

Im working on a custom story in amnesia and im scripting my first big monster scare. Whats supposed to happen is that you walk up to this door and the door flys open and a monster comes running out of it. I already have the monster scripted to what I want it to do. What I need help with is how to get the door to swing open. I looked up tutorials, but couldnt find any on this. Heres the code I was trying to use.

SetMoveObjectState(string& asName, float afState);

I dont know what I was supposed to put on the string& asName part. So if you know how to do this could you please give me the scripting details on it cause I am very new to all of this thanks.




RE: Door Opening Scripting Question - Your Computer - 11-29-2011

You put the name of the entity there, but SetMoveObjectState isn't used for doors. You first need to disable auto close with the SetSwingDoorDisableAutoClose function, then use the AddPropForce function to open the door. If the door is locked, then you'll need to unlock it before calling those functions, with the SetSwingDoorLocked function.


RE: Door Opening Scripting Question - NuggetBlubber - 11-29-2011

(11-29-2011, 06:31 PM)Your Computer Wrote: You put the name of the entity there, but SetMoveObjectState isn't used for doors. You first need to disable auto close with the SetSwingDoorDisableAutoClose function, then use the AddPropForce function to open the door. If the door is locked, then you'll need to unlock it before calling those functions, with the SetSwingDoorLocked function.

ok thanks ill give it a try