Frictional Games Forum (read-only)

Full Version: 8 levers in order to unlock door
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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...
Experiment with localvarint's
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.