Frictional Games Forum (read-only)
[SCRIPT] 8 levers in order to unlock door - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: [SCRIPT] 8 levers in order to unlock door (/thread-18791.html)



8 levers in order to unlock door - heyitsrobert97 - 10-15-2012

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...


RE: 8 levers in order to unlock door - FlawlessHappiness - 10-15-2012

Experiment with localvarint's


RE: 8 levers in order to unlock door - The chaser - 10-15-2012

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.