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
If All Candles Inactive, Fade To Black Script?
OriginalUsername Offline
Posting Freak

Posts: 896
Threads: 42
Joined: Feb 2013
Reputation: 34
#2
RE: If All Candles Inactive, Fade To Black Script?

Yes, here it is:

void OnStart()
{
AddEntityCollideCallback("script_area1", "Player", "Func1", true, 0);
AddEntityCollideCallback("script_area2", "Player", "Func2", true, 0);
AddEntityCollideCallback("script_area3", "Player", "Func3", true, 0);
SetLocalVarInt("lamplit", 0);
}

void Func1(string &in asParent, string &in asChild, int alState)
{
SetLampLit("candle1", false, true);
AddLocalVarInt("lamplit", 1);
check();
}

void Func2(string &in asParent, string &in asChild, int alState)
{
SetLampLit("candle2", false, true);
AddLocalVarInt("lamplit", 1);
check();
}

void Func3(string &in asParent, string &in asChild, int alState)
{
SetLampLit("candle3", false, true);
AddLocalVarInt("lamplit", 1);
check();
}

void check()
{
if(GetLocalVarInt("lamplit")===3)
{
FadeOut(2);
}
else
{

}
}
Everytime the players unlits a candle, the function 'check' goes active. The function 'check' checks if the variable 'lamplit' is 3. If it's not, it does nothing.Ugh, my english..
(This post was last modified: 05-04-2013, 12:57 PM by OriginalUsername.)
05-04-2013, 12:52 PM
Find


Messages In This Thread
RE: If All Candles Inactive, Fade To Black Script? - by OriginalUsername - 05-04-2013, 12:52 PM



Users browsing this thread: 1 Guest(s)