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


Thread Rating:
  • 2 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Multiple Issues Help Creating A Lever Puzzle
teddan50 Offline
Junior Member

Posts: 15
Threads: 2
Joined: Dec 2011
Reputation: 0
#8
RE: Creating A Lever Puzzle

My script does for some reason don't work. I have setted all of the levers on stuck in max and InteractionDisablesStuck, so when I have pulled the right levers they are in the wanted positions, but still the "PerformLeverTaskCompleted" doesn't start...

void OnStart()
{
SetEntityConnectionStateChangeCallback("lever_1", "StoreCheckLeverState");
SetEntityConnectionStateChangeCallback("lever_2", "StoreCheckLeverState");
SetEntityConnectionStateChangeCallback("lever_3", "StoreCheckLeverState");
SetEntityConnectionStateChangeCallback("lever_4", "StoreCheckLeverState");
SetEntityConnectionStateChangeCallback("lever_5", "StoreCheckLeverState");
SetEntityConnectionStateChangeCallback("lever_6", "StoreCheckLeverState");
SetEntityConnectionStateChangeCallback("lever_7", "StoreCheckLeverState");
SetEntityConnectionStateChangeCallback("lever_8", "StoreCheckLeverState");
}

void CheckLeverStates()
{
if (GetLocalVarInt("lever_1") == 0
&& GetLocalVarInt("lever_2") == 1
&& GetLocalVarInt("lever_3") == 0
&& GetLocalVarInt("lever_4") == 1
&& GetLocalVarInt("lever_5") == 0
&& GetLocalVarInt("lever_6") == 1
&& GetLocalVarInt("lever_7") == 1
&& GetLocalVarInt("lever_8") == 0)
{
PerformLeverTaskCompleted();
}
}
void PerformLeverTaskCompleted()
{
SetSwingDoorLocked("door1", false, false);
SetSwingDoorClosed("door1", false, false);
PlaySoundAtEntity("", "unlock_door", "door1", 0, false);
PlaySoundAtEntity("", "quest_completed.snt", "Player", 0.5f, false);
StartEffectFlash(1, 0.4, 1);
}

void StoreCheckLeverState(string &in entity, int state)
{
SetLocalVarInt("lever_1", 0);
SetLocalVarInt("lever_2", 1);
SetLocalVarInt("lever_3", 0);
SetLocalVarInt("lever_4", 1);
SetLocalVarInt("lever_5", 0);
SetLocalVarInt("lever_6", 1);
SetLocalVarInt("lever_7", 1);
SetLocalVarInt("lever_8", 0);
CheckLeverStates();
}
12-12-2011, 08:58 PM
Find Reply


Messages In This Thread
Creating A Lever Puzzle - by JenniferOrange - 11-21-2011, 11:10 PM
RE: Creating A Lever Puzzle - by Your Computer - 11-22-2011, 12:02 AM
RE: Creating A Lever Puzzle - by BlueFury - 11-22-2011, 12:08 AM
RE: Creating A Lever Puzzle - by JenniferOrange - 11-22-2011, 01:12 AM
RE: Creating A Lever Puzzle - by Your Computer - 11-22-2011, 01:49 AM
RE: Creating A Lever Puzzle - by JenniferOrange - 11-22-2011, 02:04 AM
RE: Creating A Lever Puzzle - by Your Computer - 11-22-2011, 05:13 AM
RE: Creating A Lever Puzzle - by teddan50 - 12-12-2011, 08:58 PM
RE: Creating A Lever Puzzle - by nemesis567 - 12-12-2011, 09:12 PM
RE: Creating A Lever Puzzle - by teddan50 - 12-12-2011, 10:01 PM
RE: Creating A Lever Puzzle - by nemesis567 - 12-12-2011, 10:17 PM
RE: Creating A Lever Puzzle - by teddan50 - 12-13-2011, 09:14 AM
RE: Creating A Lever Puzzle - by nemesis567 - 12-13-2011, 04:17 PM
RE: Creating A Lever Puzzle - by teddan50 - 12-13-2011, 08:07 PM
RE: Creating A Lever Puzzle - by teddan50 - 12-13-2011, 09:03 PM
RE: Creating A Lever Puzzle - by nemesis567 - 12-13-2011, 08:09 PM
RE: Creating A Lever Puzzle - by nemesis567 - 12-13-2011, 09:12 PM
RE: Creating A Lever Puzzle - by teddan50 - 12-13-2011, 09:25 PM
RE: Creating A Lever Puzzle - by nemesis567 - 12-13-2011, 09:28 PM
RE: Creating A Lever Puzzle - by teddan50 - 12-13-2011, 10:31 PM
RE: Creating A Lever Puzzle - by nemesis567 - 12-13-2011, 10:45 PM
RE: Creating A Lever Puzzle - by teddan50 - 12-13-2011, 11:32 PM
RE: Creating A Lever Puzzle - by nemesis567 - 12-14-2011, 12:23 AM
RE: Creating A Lever Puzzle - by teddan50 - 12-14-2011, 12:48 AM
RE: Creating A Lever Puzzle - by nemesis567 - 12-14-2011, 01:02 AM
RE: Creating A Lever Puzzle - by JenniferOrange - 12-14-2011, 08:28 PM



Users browsing this thread: 1 Guest(s)