FlawlessHappiness
Posting Freak
Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation:
171
|
RE: puzzle help needed
Yep found it.
And yes you are correct. object_1, object_2, object_3, object_4
Im sorry:
Spoiler below!
void OnStart()
{
SetLocalVarInt("oven_1_correct", 0);
SetLocalVarInt("oven_2_correct", 0);
SetLocalVarInt("oven_3_correct", 0);
SetLocalVarInt("oven_4_correct", 0);
SetLocalVarInt("All_4_Correct", 0);
for(int p=1;p<5;p++)AddEntityCollideCallback("object_"+p, "AreaOven_1", "PutObjectOven_1", false, 0);
for(int p=1;p<5;p++)AddEntityCollideCallback("object_"+p, "AreaOven_2", "PutObjectOven_2", false, 0);
for(int p=1;p<5;p++)AddEntityCollideCallback("object_"+p, "AreaOven_3", "PutObjectOven_3", false, 0);
for(int p=1;p<5;p++)AddEntityCollideCallback("object_"+p, "AreaOven_4", "PutObjectOven_4", false, 0);
SetEntityConnectionStateChangeCallback("Lever_1", "CheckIngredients");
}
////////////LEVER CHECK/////////////////
void CheckIngredients(string &in asEntity, int alState)
{
if(alState == 1)
{
//OVEN 1//
if(GetLocalVarInt("oven_1_correct") == 1)
{
AddLocalVarInt("All_4_Correct", 1);
}
if(GetLocalVarInt("oven_1_correct") == 0)
{
SetMessage("Messages", "IncorrectCombination", 0);
return;
}
}
//OVEN 2//
if(GetLocalVarInt("oven_2_correct") == 1)
{
AddLocalVarInt("All_4_Correct", 1);
}
if(GetLocalVarInt("oven_2_correct") == 0)
{
SetMessage("Messages", "IncorrectCombination", 0);
return;
}
//OVEN 3//
if(GetLocalVarInt("oven_3_correct") == 1)
{
AddLocalVarInt("All_4_Correct", 1);
}
if(GetLocalVarInt("oven_3_correct") == 0)
{
SetMessage("Messages", "IncorrectCombination", 0);
return;
}
//OVEN 4//
if(GetLocalVarInt("oven_4_correct") == 1)
{
AddLocalVarInt("All_4_Correct", 1);
}
if(GetLocalVarInt("oven_4_correct") == 0)
{
SetMessage("Messages", "IncorrectCombination", 0);
return;
}
if(GetLocalVarInt("All_4_Correct") > 4) //NOT COMPLETELY SURE ABOUT THAT SYMBOL: >
{
SetMessage("Messages", "IncorrectCombination", 0);
}
if(GetLocalVarInt("All_4_Correct" == 4)
{
AddTimer("INSERT_FUNCTION_HERE", 1, "INSERT_FUNCTION_HERE");
}
}
////////////OVEN 1//////////////////////
void PutObjectOven_1(string &in asParent, string &in asChild, int alState)
{
if(alState == 1)
{
if(asChild == "object_1")
{
AddLocalVarInt("oven_1_correct", 1);
AddLocalVarInt("4_Items", 1);
}
if(asChild == "object_2")
{
AddLocalVarInt("oven_1_correct", 0);
AddLocalVarInt("4_Items", 1);
}
if(asChild == "object_3")
{
AddLocalVarInt("oven_1_correct", 0);
AddLocalVarInt("4_Items", 1);
}
if(asChild == object_4)
{
AddLocalVarInt("oven_1_correct", 0);
AddLocalVarInt("4_Items", 1);
}
}
if(alState == -1)
{
if(asChild == "object_1")
{
AddLocalVarInt("oven_1_correct", 0);
AddLocalVarInt("4_Items", -1);
}
if(asChild == "object_2")
{
AddLocalVarInt("oven_1_correct", 0);
AddLocalVarInt("4_Items", -1);
}
if(asChild == "object_3")
{
AddLocalVarInt("oven_1_correct", 0);
AddLocalVarInt("4_Items", -1);
}
if(asChild == object_4)
{
AddLocalVarInt("oven_1_correct", 0);
AddLocalVarInt("4_Items", -1);
}
}
}
//////////OVEN 2////////////////////
void PutObjectOven_2(string &in asParent, string &in asChild, int alState)
{
if(alState == 1)
{
if(asChild == "object_1")
{
AddLocalVarInt("oven_2_correct", 0);
AddLocalVarInt("4_Items", 1);
}
if(asChild == "object_2")
{
AddLocalVarInt("oven_2_correct", 1);
AddLocalVarInt("4_Items", 1);
}
if(asChild == "object_3")
{
AddLocalVarInt("oven_2_correct", 0);
AddLocalVarInt("4_Items", 1);
}
if(asChild == object_4)
{
AddLocalVarInt("oven_2_correct", 0);
AddLocalVarInt("4_Items", 1);
}
}
if(alState == -1)
{
if(asChild == "object_1")
{
AddLocalVarInt("oven_2_correct", 0);
AddLocalVarInt("4_Items", -1);
}
if(asChild == "object_2")
{
AddLocalVarInt("oven_2_correct", 0);
AddLocalVarInt("4_Items", -1);
}
if(asChild == "object_3")
{
AddLocalVarInt("oven_2_correct", 0);
AddLocalVarInt("4_Items", -1);
}
if(asChild == object_4)
{
AddLocalVarInt("oven_2_correct", 0);
AddLocalVarInt("4_Items", -1);
}
}
}
///////////OVEN 3///////////////////
void PutObjectOven_3(string &in asParent, string &in asChild, int alState)
{
if(alState == 1)
{
if(asChild == "object_1")
{
AddLocalVarInt("oven_3_correct", 0);
AddLocalVarInt("4_Items", 1);
}
if(asChild == "object_2")
{
AddLocalVarInt("oven_3_correct", 0);
AddLocalVarInt("4_Items", 1);
}
if(asChild == "object_3")
{
AddLocalVarInt("oven_3_correct", 1);
AddLocalVarInt("4_Items", 1);
}
if(asChild == object_4)
{
AddLocalVarInt("oven_3_correct", 0);
AddLocalVarInt("4_Items", 1);
}
}
if(alState == -1)
{
if(asChild == "object_1")
{
AddLocalVarInt("oven_3_correct", 0);
AddLocalVarInt("4_Items", -1);
}
if(asChild == "object_2")
{
AddLocalVarInt("oven_3_correct", 0);
AddLocalVarInt("4_Items", -1);
}
if(asChild == "object_3")
{
AddLocalVarInt("oven_3_correct", 0);
AddLocalVarInt("4_Items", -1);
}
if(asChild == object_4)
{
AddLocalVarInt("oven_3_correct", 0);
AddLocalVarInt("4_Items", -1);
}
}
}
///////////////OVEN 4////////////////////
void PutObjectOven_4(string &in asParent, string &in asChild, int alState)
{
if(alState == 1)
{
if(asChild == "object_1")
{
AddLocalVarInt("oven_4_correct", 0);
AddLocalVarInt("4_Items", 1);
}
if(asChild == "object_2")
{
AddLocalVarInt("oven_4_correct", 0);
AddLocalVarInt("4_Items", 1);
}
if(asChild == "object_3")
{
AddLocalVarInt("oven_4_correct", 0);
AddLocalVarInt("4_Items", 1);
}
if(asChild == object_4)
{
AddLocalVarInt("oven_4_correct", 1);
AddLocalVarInt("4_Items", 1);
}
}
if(alState == -1)
{
if(asChild == "object_1")
{
AddLocalVarInt("oven_4_correct", 0);
AddLocalVarInt("4_Items", -1);
}
if(asChild == "object_2")
{
AddLocalVarInt("oven_44_correct", 0);
AddLocalVarInt("4_Items", -1);
}
if(asChild == "object_3")
{
AddLocalVarInt("oven_4_correct", 0);
AddLocalVarInt("4_Items", -1);
}
if(asChild == object_4)
{
AddLocalVarInt("oven_4_correct", 0);
AddLocalVarInt("4_Items", -1);
}
}
}
Trying is the first step to success.
|
|