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
Multiple problems
Acies Offline
Posting Freak

Posts: 1,643
Threads: 60
Joined: Feb 2011
Reputation: 73
#8
RE: Multiple problems

Spoiler below!

Entity tab on your lever --> ConnectionStateChangeCallback --> "PullLever1"

void PullLever1(string &in EntityName, int alState)
{
if(alState == -1) && GetLocalVarInt("LeverX")==0) // Correct pull
{
SetLeverStuckState("LeverName", -1, false);
AddLocalVarInt("LeverX", 1);
PlayGuiSound("CorrectSound", 0.8f);
return;
}
else if (alState == 1) && GetLocalVarInt("LeverX")==0) // Correct pull
{
SetLeverStuckState("LeverName", 1, false);
AddLocalVarInt("LeverX", 1);
PlayGuiSound("CorrectSound", 0.8f);
return;
}
else
SetLeverStuckState("LeverName", 0, false);
SetLeverStuckState("LeverName2", 0, false);
SetLeverStuckState("LeverName3", 0, false);
SetLeverStuckState("LeverName4", 0, false);
SetLocalVarInt("LeverX", 0);
PlayGuiSound("WrongSound", 0.8f);
//Reset levers to state 0?
}
}


This process has to be repeated for each lever. The difference will be the name as well as the variable "LeverX".
LeverX decides the order - 0 for the first, 1 for the second, 2 for the third, 3 for the fourth.
else if (alState == 1) && GetLocalVarInt("LeverX")==1) // Correct pull
else if (alState == 1) && GetLocalVarInt("LeverX")==2) // Correct pull'

Etc.
As you may notice, my scripting is kind of blunt.

[Image: mZiYnxe.png]


(This post was last modified: 05-18-2011, 06:22 PM by Acies.)
05-18-2011, 06:18 PM
Find


Messages In This Thread
Multiple problems - by X4anco - 05-18-2011, 04:42 PM
RE: Multiple problems - by Acies - 05-18-2011, 05:29 PM
RE: Multiple problems - by X4anco - 05-18-2011, 05:32 PM
RE: Multiple problems - by Acies - 05-18-2011, 05:57 PM
RE: Multiple problems - by X4anco - 05-18-2011, 06:03 PM
RE: Multiple problems - by Acies - 05-18-2011, 06:08 PM
RE: Multiple problems - by X4anco - 05-18-2011, 06:15 PM
RE: Multiple problems - by Acies - 05-18-2011, 06:18 PM
RE: Multiple problems - by X4anco - 05-18-2011, 06:28 PM
RE: Multiple problems - by Acies - 05-18-2011, 08:21 PM
RE: Multiple problems - by X4anco - 05-18-2011, 09:02 PM



Users browsing this thread: 1 Guest(s)