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
#4
RE: Multiple Levers

Previous post(i edited it)
And there is a seperate entity that is already open, cracked enough so the player can get through
fuck, hang on, that wont be all to the script...
There, This script should be right.

It should make it so that when the player pulls down on each lever, it will add 1 to the Variable. When the variable is fulfilled, it will process func5



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

void func1(string &in asEntity)//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)//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)//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)//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);
}
}


Im going to have to thank Statyk, flamez, your computer, Elven, russ money and Apjjm(and anyone else that doesn't come to mind) for helping me out with alot of this. They taught me most I know and I really appreciate it. Big Grin

[Image: speedart__2___yoshimitsu_by_kamofudge-d4yo6kk.png]
(This post was last modified: 01-22-2012, 12:36 PM by Tripication.)
01-22-2012, 12:21 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: 4 Guest(s)