Music Buttons Gone Haywire

Discussion in 'Mapping Questions & Discussion' started by FlashDash, May 13, 2019.

  1. FlashDash

    FlashDash L1: Registered

    Messages:
    13
    Positive Ratings:
    0
    Ok, so in my map i have a wall of func_buttons, each set to a different ambient_generic. My I/Os look like this:
    OnDamaged s1 PlaySound 0
    OnDamaged button Lock 0
    OnDamaged button Unlock 300
    OnDamaged s2 [to s9] StopSound 0

    I have all the buttons named the same thing, "button". Whenever i test them in game, it's fine going on, but damaging another button lags the game HARD. Sounds are very delayed, fps is severly cut, and it is just annoying. Can anyone tell me what I'm doing wrong?
     
  2. Narpas

    aa Narpas I don't know what the heck

    Messages:
    370
    Positive Ratings:
    356
    I don't know if this would fix your problem, but I would name your buttons something like "button_1" through "button_9", and instead of calling just "button", call "button_*". The "*" is a wildcard, meaning that it can take the place of any string coming after it. You can read more about that here
     
  3. FlashDash

    FlashDash L1: Registered

    Messages:
    13
    Positive Ratings:
    0
    Nope. Same stuff. Thanks for the info on wildcards though.
     
  4. FlashDash

    FlashDash L1: Registered

    Messages:
    13
    Positive Ratings:
    0
    Anybody?
     
  5. AgentApple50

    AgentApple50 L1: Registered

    Messages:
    13
    Positive Ratings:
    0
    I remember seeing this happen with a deathrun map. Here is my suggestion:

    OnDamaged s1 PlaySound 3 <==== Adding a delay before it plays. Since you have it set to play a sound and stop a sound at the same time, adding a delay would prevent it from playing two sounds at the same time (even if it is a single frame).

    After re-reading your post. If you hit a button before the 5 minutes are up, does the problem occur, or is it after the 5 minutes? Either way, I would make it so that when you hit a button, all the buttons disappear (disable) for 300 seconds instead of locking them.
     
    Last edited: May 14, 2019
  6. Yakibomb

    Yakibomb L3: Member

    Messages:
    133
    Positive Ratings:
    57
    Did you try "ent_messages_draw 1" and "developer 2" to see what's going on? Both show what's being triggered in the map, visually and through console. (I use both regularly, but I can't remember what each does specifically!)