Something wrong with prison doors? - 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: Something wrong with prison doors? (/thread-13491.html) |
Something wrong with prison doors? - Ninami - 02-21-2012 Hey so I got a map where a door should open by itself. I followed "Your Computer" youtube video but didn't get the same result? I'm using prison_1 and my script is like this: void LieDown(string &in asParent, string &in asChild, int alState) { StartPlayerLookAt("prison_1", 4, 4, ""); MovePlayerHeadPos(0, -1.0f, 0, 1, 0.1f); FadePlayerRollTo(70, 1, 20); SetPlayerActive(true); SetSwingDoorDisableAutoClose("prison_1", true); SetSwingDoorLocked("prison_1", false, false); AddTimer("Close", 3, "Close1"); AddTimer("Close", 5, "Close2"); AddTimer("Close", 7, "Close3"); AddTimer("Close", 9, "Close4"); //SetEntityActive("Enemy", true); //SetEnemyDisableTriggers("Enemy", true); //AddEnemyPatrolNode("Enemy", "Node_1", 1, ""); //AddEnemyPatrolNode("Enemy", "Node_2", 5, ""); for (int i = 0; i < 10; i++) { AddTimer("prison_1", i * 0.01, "OpenDoor"); } } void OpenDoor(string &in asTimer) { AddPropForce("prison_1", 0, 0, 1000, "world"); } I've tried changing the amount of force to "-1000" but doesn't work. I've tried multiple possible solutions but can't seem to fix this problem. Can anyone spot a problem in the script? Thanks Ninami RE: Something wrong with prison doors? - Your Computer - 02-21-2012 You missed SetSwingDoorClosed. RE: Something wrong with prison doors? - Ninami - 02-21-2012 Oh ffs! Haha works perfectly now. Once again, Your Computer to the rescue Very silly of me to forget that... Thanks! (02-21-2012, 07:01 PM)Your Computer Wrote: You missed SetSwingDoorClosed.By the way. If I wanted to close the door again with Force, could I just change the force amount to "-1000" and it would close? Or is there something else? RE: Something wrong with prison doors? - Your Computer - 02-22-2012 (02-21-2012, 07:07 PM)Ninami Wrote: By the way. If I wanted to close the door again with Force, could I just change the force amount to "-1000" and it would close? Or is there something else? SetSwingDoorClosed("door_name", true, true) will close the door instantly. If you want it to happen slowly, then AddPropForce might do the job, but i've always relied on SetSwingDoorClosed for closing the door. |