The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



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
[SOLVED] Still one problem to solve
Steve Offline
Member

Posts: 178
Threads: 17
Joined: Jun 2012
Reputation: 7
#1
[SOLVED] Still one problem to solve

Okay so I have been busy with this script for a time now and I still can't seem to solve it I have this script the thing it should do is that when object_1-4 touches stickyArea_1-4 the puzzle should be completed. But now it doesn't really do anything.
this is the script:
Spoiler below!
const string[] oven_sticky_areas = {"OvenArea_1", "OvenArea_2", "OvenArea_3", "OvenArea_4"};
const string oven_object_name = "object";
const string oven_door_name = "extaction_oven_6";
const string oven_lever_name = "Lever_1";
void OnStart()
{
SetEntityConnectionStateChangeCallback(oven_lever_name, "CheckIngredients");
}
////////////LEVER CHECK/////////////////
void CheckIngredients(string &in asEntity, int alState)
{
if(alState == 1)
{
if (GetLocalVarInt(oven_sticky_areas[0]) == 1
&& GetLocalVarInt(oven_sticky_areas[1]) == 1
&& GetLocalVarInt(oven_sticky_areas[2]) == 1
&& GetLocalVarInt(oven_sticky_areas[3]) == 1)
{
AddDebugMessage("OvenPuzzle: Correct!", false);
AddTimer("CompleteOvenPuzzle", 1, "CompleteOvenPuzzle");
}
else
{
AddDebugMessage("OvenPuzzle: Wrong!", false);
SetMessage("Messages", "IncorrectCombination", 0);
}
}
}
void AttachObjectOven(string &in asStickyArea, string &in asBodyName)
{
if (StringContains(asBodyName, oven_object_name))
SetAllowStickyAreaAttachment(true);
else
{
SetAllowStickyAreaAttachment(false);
return;
}
AddDebugMessage(asStickyArea + " " + asBodyName, true);
asBodyName = StringSub(asBodyName, 0, oven_object_name.length() + 2);
AddDebugMessage(asBodyName, false);
if (StringContains(asStickyArea, "1") && StringContains(asBodyName, "1"))
SetLocalVarInt(asStickyArea, 1);
else if (StringContains(asStickyArea, "2") && StringContains(asBodyName, "2"))
SetLocalVarInt(asStickyArea, 1);
else if (StringContains(asStickyArea, "3") && StringContains(asBodyName, "3"))
SetLocalVarInt(asStickyArea, 1);
else if (StringContains(asStickyArea, "4") && StringContains(asBodyName, "4"))
SetLocalVarInt(asStickyArea, 1);
}
void DetachObjectOven(string &in asStickyArea, string &in asBodyName)
{
SetLocalVarInt(asStickyArea, 0);
}
void CompleteOvenPuzzle(string &in asTimer)
{
SetSwingDoorLocked(oven_door_name, false, true);
SetMessage("Messages", "correctcombinationchemicals", 0);
}


CURRENTLY WORKING ON:
Final Light = 40%
Need of voice actors.
(This post was last modified: 10-25-2012, 12:34 PM by Steve.)
10-14-2012, 08:42 PM
Find


Messages In This Thread
[SOLVED] Still one problem to solve - by Steve - 10-14-2012, 08:42 PM
RE: Still one problem to solve - by Steve - 10-17-2012, 04:37 PM
RE: Still one problem to solve - by Akos115 - 10-17-2012, 10:01 PM
RE: Still one problem to solve - by The chaser - 10-18-2012, 06:41 AM
RE: Still one problem to solve - by Ongka - 10-18-2012, 09:08 AM
RE: Still one problem to solve - by Steve - 10-18-2012, 01:55 PM
RE: Still one problem to solve - by Ongka - 10-18-2012, 04:40 PM
RE: Still one problem to solve - by Akos115 - 10-18-2012, 04:48 PM
RE: Still one problem to solve - by Ongka - 10-18-2012, 04:53 PM
RE: Still one problem to solve - by Steve - 10-24-2012, 09:23 PM



Users browsing this thread: 1 Guest(s)