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?
FurtherGames Offline
Member

Posts: 72
Threads: 23
Joined: Apr 2013
Reputation: 1
#3
RE: If All Candles Inactive, Fade To Black Script?

(05-04-2013, 12:52 PM)Smoke Wrote: 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..


Okay, I understand most of that, but why would "lamplit" equal to three when you set the varients to zero? Does that mean if the three "lamplit" items all equal the same fade out?
05-04-2013, 12:58 PM
Find


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



Users browsing this thread: 1 Guest(s)