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 Lock opened with armor puzzle
Statyk Offline
Schrödinger's Mod

Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation: 241
#4
RE: Lock opened with armor puzzle

Something like this:

//____________________________


void OnStart()
{

SetLocalVarInt("armorbank", 0); //sets a "bank" for integers to be added and be called later

AddEntityCollideCallback("upstairs_doorhead_2", "upstairs_doorarea_2", "upstairsdoor2", true, 1);
AddEntityCollideCallback("upstairs_doorhead_1", "upstairs_doorarea_1", "upstairsdoor1", true, 1);
}

void upstairsdoor1(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("upstairs_doorhead_1", false);
SetEntityActive("upstairs_doorheadless_1", false);
SetEntityActive("upstairs_doorarmor_1", true);


AddLocalVarInt("armorbank", 1); //Adds ONE to the "armorbank"
CHECKHEADS(); //Calls the function below. Saves space
}

void upstairsdoor2(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("upstairs_doorhead_2", false);
SetEntityActive("upstairs_doorheadless_2", false);
SetEntityActive("upstairs_doorarmor_2", true);


AddLocalVarInt("armorbank", 1); //Adds ONE to the "armorbank"
CHECKHEADS(); //Calls the function below. Saves space
}


void CHECKHEADS()
{
if(GetLocalVarInt("armorbank") == 2) //checks the bank. If it has 2, it continues.
{
SetSwingDoorLocked("upstairs_door", false, true);
}
}
(This post was last modified: 02-16-2012, 09:22 PM by Statyk.)
02-16-2012, 09:21 PM
Find


Messages In This Thread
Lock opened with armor puzzle - by Ermu - 02-16-2012, 05:04 PM
RE: Lock opened with armor puzzle - by Ermu - 02-16-2012, 08:24 PM
RE: Lock opened with armor puzzle - by Statyk - 02-16-2012, 09:21 PM
RE: Lock opened with armor puzzle - by Ermu - 02-16-2012, 09:58 PM



Users browsing this thread: 1 Guest(s)