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
Making a lever unlock a door?
Wyz Offline
Junior Member

Posts: 12
Threads: 3
Joined: Jul 2012
Reputation: 0
#4
RE: Making a lever unlock a door?

(07-13-2012, 08:18 PM)beecake Wrote: void OnStart()
{
SetEntityConnectionStateChangeCallback("LEVER", "LEVER_CALLBACK");
}

void LEVER_CALLBACK(string &in asEntity, int alState)

{
if(alState == 1)
{
SetGlobalVarInt("OPENDOORINT", 1);
}
}

In the other level:

void OnEnter()
{
if(GetGlobalVarInt("OPENDOORINT") == 1)
{
SetSwingDoorLocked("DOOR", false, true);
}
}
Thanks! For that if statement, is the alState on the lever all the way up or down? And the global variable gets declared in an HPS file in the maps folder called 'global'?
(This post was last modified: 07-13-2012, 08:43 PM by Wyz.)
07-13-2012, 08:40 PM
Find


Messages In This Thread
Making a lever unlock a door? - by Wyz - 07-13-2012, 05:14 PM
RE: Making a lever unlock a door? - by Wyz - 07-13-2012, 08:40 PM
RE: Making a lever unlock a door? - by Ongka - 07-13-2012, 08:42 PM
RE: Making a lever unlock a door? - by Ongka - 08-04-2012, 04:34 AM



Users browsing this thread: 4 Guest(s)