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 Multiple Levers
Tripication Offline
Member

Posts: 172
Threads: 19
Joined: Dec 2011
Reputation: 6
#8
RE: Multiple Levers

Oh sorry again, wrong syntax this time

ill fix here


void OnStart()
{
SetLocalVarInt("Var1", 0);//CREATES VARIABLE
SetEntityConnectionStateChangeCallback("LEVER1", "func1");//CREATES FUNC1
SetEntityConnectionStateChangeCallback("LEVER2", "func2");//CREATES FUNC2
SetEntityConnectionStateChangeCallback("LEVER3", "func3");//CREATES FUNC3
SetEntityConnectionStateChangeCallback("LEVER4", "func4");//CREATES FUNC4
}

void func1(string &in asEntity, int alState)//STARTS FUNC1
{
if (alState == 1)//IF THE LEVER IS PULLED DOWN, IT WILL EXECUTE THE FOLLOWING
{
AddLocalVarInt("Var1", 1);
func5();//SENDS THE SCRIPT TO FUNC5 TO CHECK IF COMPLETE
}
}

void func2(string &in asEntity, int alState)//IF THE LEVER IS PULLED DOWN, IT WILL EXECUTE THE FOLLOWING
{
if (alState == 1)
{
AddLocalVarInt("Var1", 1);
func5();//SENDS THE SCRIPT TO FUNC5 TO CHECK IF COMPLETE
}
}

void func3(string &in asEntity, int alState)//IF THE LEVER IS PULLED DOWN, IT WILL EXECUTE THE FOLLOWING
{
if (alState == 1)
{
AddLocalVarInt("Var1", 1);
func5();//SENDS THE SCRIPT TO FUNC5 TO CHECK IF COMPLETE
}
}

void func4(string &in asEntity, int alState)//IF THE LEVER IS PULLED DOWN, IT WILL EXECUTE THE FOLLOWING
{
if (alState == 1)
{
AddLocalVarInt("Var1", 1);
func5();//SENDS THE SCRIPT TO FUNC5 TO CHECK IF COMPLETE
}
}

void func5()//STARTS FUNC5
{
if(GetLocalVarInt("Var1") == 4)//IF VARIABLE IS FULFILLED, IT WILL EXECUTE THE FOLLOWING
{
SetEntityActive("castle_gate_arched01_1", false);
SetEntityActive("castle_gate_arched01_2", true);
}
}



[Image: speedart__2___yoshimitsu_by_kamofudge-d4yo6kk.png]
(This post was last modified: 01-22-2012, 12:48 PM by Tripication.)
01-22-2012, 12:44 PM
Find


Messages In This Thread
Multiple Levers - by i3670 - 01-22-2012, 12:08 PM
RE: Multiple Levers - by Tripication - 01-22-2012, 12:09 PM
RE: Multiple Levers - by i3670 - 01-22-2012, 12:20 PM
RE: Multiple Levers - by Tripication - 01-22-2012, 12:21 PM
RE: Multiple Levers - by i3670 - 01-22-2012, 12:37 PM
RE: Multiple Levers - by Tripication - 01-22-2012, 12:40 PM
RE: Multiple Levers - by i3670 - 01-22-2012, 12:41 PM
RE: Multiple Levers - by Tripication - 01-22-2012, 12:44 PM
RE: Multiple Levers - by i3670 - 01-22-2012, 12:52 PM
RE: Multiple Levers - by Tripication - 01-22-2012, 12:53 PM
RE: Multiple Levers - by i3670 - 01-22-2012, 01:04 PM
RE: Multiple Levers - by Tripication - 01-22-2012, 01:05 PM
RE: Multiple Levers - by i3670 - 01-22-2012, 01:12 PM
RE: Multiple Levers - by Tripication - 01-22-2012, 01:42 PM



Users browsing this thread: 9 Guest(s)