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 Script help needed
Steve Offline
Member

Posts: 178
Threads: 17
Joined: Jun 2012
Reputation: 7
#8
RE: Script help needed

okay now I tried it with the stickyarea's like YC suggested but now it doesnt'work when it should be solved.
this is my script
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);
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);
}

//OVEN 2//

if(GetLocalVarInt("oven_2_correct") == 1)
{
AddLocalVarInt("All_4_Correct", 1);
}

if(GetLocalVarInt("oven_2_correct") == 0)
{
SetMessage("Messages", "IncorrectCombination", 0);
}

//OVEN 3//

if(GetLocalVarInt("oven_3_correct") == 1)
{
AddLocalVarInt("All_4_Correct", 1);
}

if(GetLocalVarInt("oven_3_correct") == 0)
{
SetMessage("Messages", "IncorrectCombination", 0);
}

//OVEN 4//

if(GetLocalVarInt("oven_4_correct") == 1)
{
AddLocalVarInt("All_4_Correct", 1);
}

if(GetLocalVarInt("oven_4_correct") == 0)
{
SetMessage("Messages", "IncorrectCombination", 0);
}


if(GetLocalVarInt("All_4_Correct") == 4)
{
AddTimer("completedpuzzle", 1, "completedpuzzle");
}
}
}

////////////OVEN 1//////////////////////

void PutObjectOven_1(string &in asStickyArea, string &in asBodyName)
{
if(asBodyName == "object_1")
{
SetLocalVarInt("oven_1_correct", 1);
}
if(asBodyName == "object_2")
{
SetLocalVarInt("oven_1_correct", 0);
}
if(asBodyName == "object_3")
{
SetLocalVarInt("oven_1_correct", 0);
}

if(asBodyName == "object_4")
{
SetLocalVarInt("oven_1_correct", 0);
}
}
void DetachObjectOven_1(string &in asStickyArea, string &in asBodyName)
{
if(asStickyArea == "AreaOven_1")
{
SetLocalVarInt("oven_1_correct", 0);
}
}

//////////OVEN 2////////////////////

void PutObjectOven_2(string &in asStickyArea, string &in asBodyName)
{
if(asBodyName == "object_1")
{
SetLocalVarInt("oven_2_correct", 0);
}
if(asBodyName == "object_2")
{
SetLocalVarInt("oven_2_correct", 1);
}
if(asBodyName == "object_3")
{
SetLocalVarInt("oven_2_correct", 0);
}

if(asBodyName == "object_4")
{
SetLocalVarInt("oven_2_correct", 0);
}
}
void DetachObjectOven_2(string &in asStickyArea, string &in asBodyName)
{
if(asStickyArea == "AreaOven_2")
{
SetLocalVarInt("oven_2_correct", 0);
}
}

///////////OVEN 3///////////////////

void PutObjectOven_3(string &in asStickyArea, string &in asBodyName)
{
if(asBodyName == "object_1")
{
SetLocalVarInt("oven_3_correct", 0);
}
if(asBodyName == "object_2")
{
SetLocalVarInt("oven_3_correct", 0);
}
if(asBodyName == "object_3")
{
SetLocalVarInt("oven_3_correct", 1);
}

if(asBodyName == "object_4")
{
SetLocalVarInt("oven_3_correct", 0);
}
}
void DetachObjectOven_3(string &in asStickyArea, string &in asBodyName)
{
if(asStickyArea == "AreaOven_3")
{
SetLocalVarInt("oven_3_correct", 0);
}
}

///////////////OVEN 4////////////////////

void PutObjectOven_4(string &in asStickyArea, string &in asBodyName)
{
if(asBodyName == "object_1")
{
SetLocalVarInt("oven_4_correct", 0);
}
if(asBodyName == "object_2")
{
SetLocalVarInt("oven_4_correct", 0);
}
if(asBodyName == "object_3")
{
SetLocalVarInt("oven_4_correct", 0);
}

if(asBodyName == "object_4")
{
SetLocalVarInt("oven_4_correct", 1);
}
}

void DetachObjectOven_4(string &in asStickyArea, string &in asBodyName)
{
if(asStickyArea == "AreaOven_4")
{
SetLocalVarInt("oven_4_correct", 0);
}
}

void completedpuzzle(string &in asTimer)
{
SetSwingDoorLocked("extaction_oven_6", false, true);
SetMessage("Messages", "correctcombinationchemicals", 0);
}

CURRENTLY WORKING ON:
Final Light = 40%
Need of voice actors.
09-16-2012, 09:18 PM
Find


Messages In This Thread
Script help needed - by Steve - 09-11-2012, 03:35 PM
RE: Script help needed - by Tomato Cat - 09-11-2012, 06:02 PM
RE: Script help needed - by Steve - 09-11-2012, 06:46 PM
RE: Script help needed - by Tomato Cat - 09-11-2012, 10:24 PM
RE: Script help needed - by Steve - 09-12-2012, 07:35 AM
RE: Script help needed - by Your Computer - 09-12-2012, 02:11 PM
RE: Script help needed - by FlawlessHappiness - 09-12-2012, 02:21 PM
RE: Script help needed - by Steve - 09-16-2012, 09:18 PM
RE: Script help needed - by FlawlessHappiness - 09-16-2012, 09:29 PM
RE: Script help needed - by Steve - 09-19-2012, 05:32 PM
RE: Script help needed - by Your Computer - 09-19-2012, 06:30 PM
RE: Script help needed - by Steve - 09-19-2012, 08:29 PM
RE: Script help needed - by FlawlessHappiness - 09-19-2012, 06:38 PM
RE: Script help needed - by Your Computer - 09-19-2012, 08:38 PM
RE: Script help needed - by Steve - 09-19-2012, 08:51 PM
RE: Script help needed - by Steve - 10-04-2012, 03:46 PM
RE: Script help needed - by Steve - 10-05-2012, 04:55 PM
RE: Script help needed - by Robby - 10-05-2012, 05:48 PM
RE: Script help needed - by The chaser - 10-05-2012, 08:33 PM
RE: Script help needed - by Steve - 10-06-2012, 08:02 PM
RE: Script help needed - by The chaser - 10-06-2012, 08:32 PM
RE: Script help needed - by Steve - 10-06-2012, 09:37 PM
RE: Script help needed - by Robby - 10-06-2012, 08:02 PM
RE: Script help needed - by Your Computer - 10-06-2012, 08:37 PM
RE: Script help needed - by Robby - 10-06-2012, 08:45 PM
RE: Script help needed - by Steve - 10-08-2012, 03:23 PM



Users browsing this thread: 3 Guest(s)