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 8 levers in order to unlock door
heyitsrobert97 Offline
Member

Posts: 68
Threads: 29
Joined: Jan 2012
Reputation: 0
#1
8 levers in order to unlock door

hi, seeing that i've been away from scripting for 4months i have sorta forgotten how to do some scripts :L and one i need to make is..
there is an animated gobo, showing sequences of images showing up,down images. the pattern is up,down,down,down,up,up,down,up and then it stops until you push the button again. thats working. but this i need help making the script. there are 8 levers in a row. i want it so all levers have to be in the right position but they can't lock. and if they aren't all in the right position nothing happens. and if they are all in the right position i want it to run a 1second timer. and then it will unlock the door. that end part i know how to do. all i need is the script to check if all the levers are at the right position.
Please Help...

This Darn House! , Four Doors, Youtube
10-15-2012, 09:55 AM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#2
RE: 8 levers in order to unlock door

Experiment with localvarint's

Trying is the first step to success.
10-15-2012, 10:53 AM
Find
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#3
RE: 8 levers in order to unlock door

SetEntityConnectionStateChangeCallback("lever_1", "Func_add");

SetEntityConnectionStateChangeCallback("lever_2", "Func_add");

SetEntityConnectionStateChangeCallback("lever_3", "Func_add");

SetEntityConnectionStateChangeCallback("lever_4", "Func_add");

SetEntityConnectionStateChangeCallback("lever_5", "Func_add");

SetEntityConnectionStateChangeCallback("lever_6", "Func_add");

SetEntityConnectionStateChangeCallback("lever_7", "Func_add");

SetEntityConnectionStateChangeCallback("lever_8", "Func_add");

void Func_add (string &in asEntity, int alState);
if (alState)=1
{
AddLocalVarInt("var_1", 1);
GET();
}

void GET (?)
if (GetLocalVarInt(("var_1")=8)
{
////Stuff you want to happen
}

It should be something like this.

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
10-15-2012, 11:22 AM
Find




Users browsing this thread: 1 Guest(s)