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?
PutraenusAlivius Offline
Posting Freak

Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation: 119
#9
RE: If All Candles Inactive, Fade To Black Script?

(05-04-2013, 02:05 PM)martinnord Wrote:
(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..

Im curious, whats the difference between using 2 is equal to signs and using 3, to be more specific whats the difference between "==" and "==="

Me too. This isn't in the comparison operators.

"Veni, vidi, vici."
"I came, I saw, I conquered."
05-04-2013, 02:07 PM
Find


Messages In This Thread
RE: If All Candles Inactive, Fade To Black Script? - by PutraenusAlivius - 05-04-2013, 02:07 PM



Users browsing this thread: 1 Guest(s)