Advice regarding 2 buttons toggling

Discussion in 'Mapping Questions & Discussion' started by BakaOsaka, Apr 22, 2012.

  1. BakaOsaka

    BakaOsaka L1: Registered

    Messages:
    3
    Positive Ratings:
    0
    Hi, I need some advice for my Team Fortress 2 map.

    I have 2 ondamage brush-based button entities on my map. Button1 plays sound1, and button2 plays sound2. Currently if you activate button2 whilst sound1 is playing, it stops sound1 and plays sound2.
    However, I have a problem. This means that if you shoot button1 and button2 in rapid succession, you can rapidly change the sounds. What I want to do is make it so that if you activate button1, sound1 will play but also add a delay so that button2 cannot be activated for a certain period of time, and vice versa. However, I am unable to work out how to do this. Can somebody offer me some advice?

    Any help would be appreciated.
     
  2. A Boojum Snark

    aa A Boojum Snark Toraipoddodezain Mazahabado

    Messages:
    4,767
    Positive Ratings:
    5,508
    Send the other button Lock and Unlock inputs with the desired delays.
     
    • Thanks Thanks x 1
  3. BakaOsaka

    BakaOsaka L1: Registered

    Messages:
    3
    Positive Ratings:
    0
    Hi,

    I have just tried doing that and sadly it doesn't work. Here is the outputs on my button (I haven't added an unlock yet as I wanted to confirm it'd work first)

    [​IMG]

    However, it seems to function exactly the same as if the lock function isn't there.

    Any other advice?
    Thanks.
     
  4. A Boojum Snark

    aa A Boojum Snark Toraipoddodezain Mazahabado

    Messages:
    4,767
    Positive Ratings:
    5,508
    Ah, I believe the OnDamaged output bypasses locking, because locking only stops the button from being pressed. You should be able to work around it by making the damage press the button, rather than do the action directly.

    for btn2:
    Column 1 Column 2 Column 3
    Output Target Input
    OnDamaged btn2 Press
    OnPressed sound2 PlaySound
    OnPressed btn1 Lock
     
    • Thanks Thanks x 1
  5. BakaOsaka

    BakaOsaka L1: Registered

    Messages:
    3
    Positive Ratings:
    0
    Thank you! That worked perfectly.