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
Script Help How to make a door open ajar?
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#14
RE: How to make a door open ajar?

(02-14-2013, 01:01 AM)serbusfish Wrote: I tried this script but it wont work, what am I doing wrong?

You put the code i gave you in a collide function, but it's supposed to be a timer. That's why it doesn't work Smile

void OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_slam", "DoorSlam", true, 1);
}

void DoorSlam(string &in asParent, string &in asChild, int alState)
{
AddTimer("PushDoor", 0.2f, "DoorSlamTimer");
}

void DoorSlamTimer(string &in asTimer)
{
if(GetLocalVarInt("PushDoorVar") == 10)
{
return;
}

AddLocalVarInt("PushDoorVar", 1);
AddPropImpulse("castle_arched01_11", 1.0f, 0.0f, 0.0f, "World");
AddTimer("PushDoor", 0.2f, "DoorSlamTimer");
}

Since you want the door to slam, it should need this: SetSwingDoorClosed("castle_arched01_11", true, false);
because if it's going to slam it should already be open.

Trying is the first step to success.
02-14-2013, 06:54 AM
Find


Messages In This Thread
How to make a door open ajar? - by serbusfish - 02-13-2013, 03:42 AM
RE: How to make a door open ajar? - by MulleDK19 - 02-13-2013, 03:43 AM
RE: How to make a door open ajar? - by Adrianis - 02-13-2013, 11:19 AM
RE: How to make a door open ajar? - by Kreekakon - 02-13-2013, 11:56 AM
RE: How to make a door open ajar? - by Adrianis - 02-13-2013, 12:03 PM
RE: How to make a door open ajar? - by Kreekakon - 02-13-2013, 11:27 AM
RE: How to make a door open ajar? - by NaxEla - 02-13-2013, 05:02 PM
RE: How to make a door open ajar? - by serbusfish - 02-13-2013, 08:46 PM
RE: How to make a door open ajar? - by serbusfish - 02-14-2013, 01:01 AM
RE: How to make a door open ajar? - by NaxEla - 02-14-2013, 01:36 AM
RE: How to make a door open ajar? - by FlawlessHappiness - 02-14-2013, 06:54 AM



Users browsing this thread: 2 Guest(s)