User

Spectacularly Lethal Soldier
Contributor
So I’m making a deathrun map right now and I’m wondering how you can make the map play different music every time you start the match. For example, technoir and neonoir always play different music every round and I’m wondering how I can do that as well.
 

g .

Notably Dangerous Demo-Knight
Mapper
While I don't know personally how it's done, you could look up videos along the lines of "Random Logic in Hammer Editor" to find an answer. You could also do as I like to do when faced with a question, decompile the map you're curious about and dissect the inner-workings for yourself.
 
  • Like
Reactions: KinCryos

Jermaphobe

Moderator
Contributor
Legendary Mapper
You'll need a logic_case and a math_counter entity, I'd rather not struggle how to explain it in paragraph, which is why I prepared this sample VMF. I've prepared this sample to randomly choose one of two amb generics and play the sound related to them.

Download
 

KinCryos

TF2 Admin
Contributor
Mapper
the math_counter entity is only required if you want the music tracks to play in a specific order for each round. if you don't care what plays each round, you can just use the logic_case's PickRandom input (or PickRandomShuffle if you don't a track to play a second time until all others do so)
 

User

Spectacularly Lethal Soldier
Contributor
the math_counter entity is only required if you want the music tracks to play in a specific order for each round. if you don't care what plays each round, you can just use the logic_case's PickRandom input (or PickRandomShuffle if you don't a track to play a second time until all others do so)
Yeah I just want my map to play from a selection of at least 5 songs, anyways thanks guys