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
My Basement settings...
Amnesiaplayer Offline
Senior Member

Posts: 539
Threads: 105
Joined: Jun 2014
Reputation: 0
#1
My Basement settings...

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: (Select All)
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
08-30-2014, 11:42 AM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#2
RE: My Basement settings...

Instead of having this block on the buttons:
PHP Code: (Select All)
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.

(This post was last modified: 08-30-2014, 12:39 PM by Mudbill.)
08-30-2014, 12:37 PM
Find
Amnesiaplayer Offline
Senior Member

Posts: 539
Threads: 105
Joined: Jun 2014
Reputation: 0
#3
RE: My Basement settings...

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..
08-30-2014, 12:49 PM
Find




Users browsing this thread: 1 Guest(s)