"And" conditional statement in Hammer?

Discussion in 'Mapping Questions & Discussion' started by Radaka, Jun 1, 2009.

  1. Radaka

    Radaka L7: Fancy Member

    Messages:
    495
    Positive Ratings:
    242
    I'm having a problem currently with spawn room doors, using the startTouchAll and endTouchAll triggers on a trigger_multiple. The map is set to unlock the doors at the start of each round, and the doors work fine, unless you are already touching them right as the round starts. In that case, you have to back up and retry to get the door to open.

    Onto the meat though :)

    I need to preform a check such as:

    If player is touching door and setup time is finished -> Open door

    how would I do this :confused:

    thank you!
     
  2. zornor

    zornor L4: Comfortable Member

    Messages:
    195
    Positive Ratings:
    23
    Have a trigger_multiple, set it up like a normal door trigger, outputs and everything. BUT, set it to start as disabled.

    On the round timer, send an output to this trigger_multiple. OnSetupFinished -> Enable.

    Now it should only open when setup ends. Make sure you also uncheck the "Touch Opens" flag on the door ;D
     
    • Thanks Thanks x 1
  3. III_Demon

    III_Demon L2: Junior Member

    Messages:
    57
    Positive Ratings:
    29
    have you tried enabling the trigger on round start, instead of unlocking the door?

    someone more experienced than me can probably answer the AND condition question...

    [edit]lookit that. beat by 3 minutes, and better. =] what he said!
     
    • Thanks Thanks x 1
  4. Radaka

    Radaka L7: Fancy Member

    Messages:
    495
    Positive Ratings:
    242
    Alright, well that fixed my problem :)

    Thanks guys!
     
  5. Acegikmo

    aa Acegikmo

    Messages:
    555
    Positive Ratings:
    490
    For a more complete "and" operator in hammer, I recommend you use a math_counter.
    Set the max value to 2. Each time one condition is met, it adds one. If the other one is also met, the counter adds up to 2. If your max is 2, then the math_counter will send an output.
     
    • Thanks Thanks x 2