Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Something wrong with prison doors?
Ninami Offline
Member

Posts: 59
Threads: 6
Joined: Feb 2012
Reputation: 2
#1
Something wrong with prison doors?

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
(This post was last modified: 02-21-2012, 07:08 PM by Ninami.)
02-21-2012, 06:58 PM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#2
RE: Something wrong with prison doors?

You missed SetSwingDoorClosed.

Tutorials: From Noob to Pro
02-21-2012, 07:01 PM
Website Find
Ninami Offline
Member

Posts: 59
Threads: 6
Joined: Feb 2012
Reputation: 2
#3
RE: Something wrong with prison doors?

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?
(This post was last modified: 02-21-2012, 07:54 PM by Ninami.)
02-21-2012, 07:07 PM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#4
RE: Something wrong with prison doors?

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

Tutorials: From Noob to Pro
(This post was last modified: 02-22-2012, 10:08 PM by Your Computer.)
02-22-2012, 10:07 PM
Website Find




Users browsing this thread: 1 Guest(s)