Frictional Games Forum (read-only)

Full Version: Door Opening Scripting Question
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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.

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