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 Candle scripting help
Obliviator27 Offline
Posting Freak

Posts: 792
Threads: 10
Joined: Jul 2011
Reputation: 66
#2
RE: Candle scripting help

Use SetLocalVarInt, and AddLocalVarInt. Like so.

void OnStart()
{
SetLocalVarInt("CandlesLit", 0); // Sets a variable "CandlesLit" to zero.
SetEntityCallbackFunc("candlename", "CandleLight");
// Replace candlename with the names of your candles, and call as many times as there are candles. Could be done under the interactcallback tab of the candle itself.
}
void CandleLight(string &in asEntity, string &in type)
{
if(asType == OnIgnite) // If it's ignited.
{
AddLocalVarInt("CandlesLit", 1);
if(GetLocalVarInt("CandlesLit") == 5) // If the variable is equal to five, execute following statement
{
//SetEntityActive script goes here, along with anything else.
}
}
}

Written off of the top of my head, so I'm not sure if it'll work 100%

05-23-2012, 08:40 PM
Find


Messages In This Thread
Candle scripting help - by Hatred - 05-23-2012, 08:17 PM
RE: Candle scripting help - by Obliviator27 - 05-23-2012, 08:40 PM
RE: Candle scripting help - by Hatred - 05-23-2012, 08:42 PM
RE: Candle scripting help - by Rapture - 05-23-2012, 08:54 PM
RE: Candle scripting help - by Hatred - 05-23-2012, 09:10 PM
RE: Candle scripting help - by FlawlessHappiness - 05-24-2012, 07:49 PM
RE: Candle scripting help - by FragdaddyXXL - 05-24-2012, 08:56 PM



Users browsing this thread: 1 Guest(s)