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
Multiple Issues Help Setting up the elevator machine
PutraenusAlivius Offline
Posting Freak

Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation: 119
#6
RE: Setting up the elevator machine

PHP Code: (Select All)
void OnStart()
{
SetLocalVarInt("Cogwheel"0);
SetLocalVarInt("Coal"0);
AddEntityCollideCallback("Coal1""ScriptAreaCoal""AddVar1"false1); //Change Coal1 to coal num 1
AddEntityCollideCallback("Coal2""ScriptAreaCoal""AddVar2"false1); //Change Coal2 to coal num 2
AddEntityCollideCallback("Coal3""ScriptAreaCoal""AddVar3"false1); //Change Coal3 to coal num 3
//You can add more but change the Parent and Function name.
}

void AddVar1(string &in asParentstring &in asChildint alState)
{
AddLocalVarInt("Coal"1);
CheckCoalCount();
}

void AddVar2(string &in asParentstring &in asChildint alState)
{
AddLocalVarInt("Coal"1);
CheckCoalCount();
}

void AddVar3(string &in asParentstring &in asChildint alState)
{
AddLocalVarInt("Coal"1);
CheckCoalCount();
}

void CheckCoalCount()
{
if(
GetLocalVarInt("Coal") == 3//Change 3 to how many coal you want
{
SetMessage("MsgCat""MsgEntry"0); //This is the message that will appear when enough coals are placed.
//Place any other commands here...
}

Coal count script.

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


Messages In This Thread
Setting up the elevator machine - by serbusfish - 05-07-2013, 01:30 AM
RE: Setting up the elevator machine - by Rapture - 05-07-2013, 03:09 AM
RE: Setting up the elevator machine - by PutraenusAlivius - 05-07-2013, 04:46 AM



Users browsing this thread: 7 Guest(s)