Frictional Games Forum (read-only)

Full Version: Something wrong with prison doors?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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
You missed SetSwingDoorClosed.
Oh ffs! Haha works perfectly now.

Once again, Your Computer to the rescue Big Grin

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