void OnStart()
{
SetLocalVarInt("Cogwheel", 0);
SetLocalVarInt("Coal", 0);
AddEntityCollideCallback("Coal1", "ScriptAreaCoal", "AddVar1", false, 1); //Change Coal1 to coal num 1
AddEntityCollideCallback("Coal2", "ScriptAreaCoal", "AddVar2", false, 1); //Change Coal2 to coal num 2
AddEntityCollideCallback("Coal3", "ScriptAreaCoal", "AddVar3", false, 1); //Change Coal3 to coal num 3
//You can add more but change the Parent and Function name.
}
void AddVar1(string &in asParent, string &in asChild, int alState)
{
AddLocalVarInt("Coal", 1);
CheckCoalCount();
}
void AddVar2(string &in asParent, string &in asChild, int alState)
{
AddLocalVarInt("Coal", 1);
CheckCoalCount();
}
void AddVar3(string &in asParent, string &in asChild, int 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...
}
}