I have a few buttons in a "disco" room in my map. In theory it was easy, but I encountered a LOT of bugs I don't know how to fix.
the layout is that there are 5 buttons, each plays a different song upon being hit. to avoid 2 ambient_generics being played at the same time, causing mass lag and "ear rape" - I have made it so that once one button is pressed, the others also press in. all of them press out when the song finishes (if the song finishes after 3:12 minutes, I made the delay before reset to 192 and outputs on other buttons to press out after 192 as well)
here are the problems:
well, here is my VMF file:
the layout is that there are 5 buttons, each plays a different song upon being hit. to avoid 2 ambient_generics being played at the same time, causing mass lag and "ear rape" - I have made it so that once one button is pressed, the others also press in. all of them press out when the song finishes (if the song finishes after 3:12 minutes, I made the delay before reset to 192 and outputs on other buttons to press out after 192 as well)
here are the problems:
- the buttons will sometimes unpress at the wrong times i.e. one button will unpress 50 seconds before the song finishes and others might unpress 5 seconds after the song ends although all were given the same time
- if you use an explosive projectile, you can press 2 buttons at once, making 2 songs be played at the same time, which I want to avoid at all costs
- I attached a env_hudhint to all the buttons, so that the player who presses the buttons can see the song and artist. they don't show up.
well, here is my VMF file: