Frictional Games Forum (read-only)
My Basement settings... - 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: My Basement settings... (/thread-26001.html)



My Basement settings... - Amnesiaplayer - 08-30-2014

i already asked this... and i'm working for it now.. but it doesn't work.. i don't know how...
i have 3 buttons , 1 lever.
1 button (in the middle) can't be pushed , if you do it tells that you need to push 2 buttons and 1 lever...
so i place 2 buttons on other rooms and 1 lever.. if you push the buttons (and the lever) the Middle button can be activated! so i can use it then... How can i do this ?! i have already scripts...

PHP Code:
void PressButton(string &in asEntity)
{
    if(
GetLocalVarInt("Button1") == && GetLocalVarInt("Button2") == 1) {
        
SetEntityActive("Area"false);
        return;
    }
    else 
SetLocalVarInt(asEntity1);

yes my first button name is button1 and the second one button2 and the Area's name is Area
i have only this... but i CAN push the third button.. can someone help me ? Sad


RE: My Basement settings... - Mudbill - 08-30-2014

Instead of having this block on the buttons:
PHP Code:
if(GetLocalVarInt("Button1") == && GetLocalVarInt("Button2") == 1) {
    
SetEntityActive("Area"false);
    return;


You can move it to your lever. That will make so the lever will activate the area IF both buttons on the side have already been pressed. For the button scripts, just leave the last line, but remove the "else" keyword.

To move it to the lever, you need to place it within a ConnectionStateChangeCallback. If you only want it to work if you pull the lever either up or down, add another if-statement checking the alState parameter for 1 or -1.

Also, make sure the names of your buttons match in the script. Captials matter! button1 is not the same as Button1.


RE: My Basement settings... - Amnesiaplayer - 08-30-2014

i've just use 3 buttons , shorter then 2 and 1 lever Big Grin
and it worked , setmessage worked to!! now i'm going to make the map and look if it will work..