Music Buttons Gone Haywire

FlashDash

L1: Registered
Oct 31, 2018
13
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?
 

nᵗʰSonata

Takes way to long to make and update maps
aa
Jun 11, 2015
433
436
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
 

AgentApple50

L1: Registered
May 11, 2019
13
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: