Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
puzzle help needed
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#12
RE: puzzle help needed

Oh... Wait a couple of minutes more...

WAIT: found a bug, if 2 objects go into the same area
EDIT: Now it should work

Here is my guess:

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_2(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_2(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.
(This post was last modified: 09-08-2012, 07:08 PM by FlawlessHappiness.)
09-08-2012, 06:52 PM
Find


Messages In This Thread
puzzle help needed - by Steve - 09-08-2012, 12:19 PM
RE: puzzle help needed - by Theforgot3n1 - 09-08-2012, 01:45 PM
RE: puzzle help needed - by Steve - 09-08-2012, 05:00 PM
RE: puzzle help needed - by Dutton - 09-08-2012, 05:07 PM
RE: puzzle help needed - by Steve - 09-08-2012, 05:28 PM
RE: puzzle help needed - by FlawlessHappiness - 09-08-2012, 05:34 PM
RE: puzzle help needed - by Steve - 09-08-2012, 06:37 PM
RE: puzzle help needed - by FlawlessHappiness - 09-08-2012, 06:39 PM
RE: puzzle help needed - by Steve - 09-08-2012, 06:41 PM
RE: puzzle help needed - by FlawlessHappiness - 09-08-2012, 06:47 PM
RE: puzzle help needed - by Steve - 09-08-2012, 06:50 PM
RE: puzzle help needed - by FlawlessHappiness - 09-08-2012, 06:52 PM
RE: puzzle help needed - by Steve - 09-08-2012, 06:56 PM
RE: puzzle help needed - by Steve - 09-09-2012, 11:34 AM
RE: puzzle help needed - by FlawlessHappiness - 09-09-2012, 11:39 AM
RE: puzzle help needed - by Steve - 09-09-2012, 01:32 PM
RE: puzzle help needed - by FlawlessHappiness - 09-09-2012, 03:33 PM
RE: puzzle help needed - by Steve - 09-09-2012, 05:27 PM
RE: puzzle help needed - by FlawlessHappiness - 09-09-2012, 06:33 PM
RE: puzzle help needed - by Steve - 09-09-2012, 08:20 PM
RE: puzzle help needed - by FlawlessHappiness - 09-10-2012, 06:59 AM



Users browsing this thread: 3 Guest(s)