Music Randomizer (4.6.0; ZScript; S_ChangeMusic)
Posted: Thu Jun 10, 2021 3:54 am
Hello, dear community.
I want to ask a question about music and Zscript.
Somewhere in depths of ZDoom forum found "Music Changer" (from YouTube link), which has two music - one that replaces theme of level, another - if you attract the attention of monsters (battle music).
In parameters, you can set how many monsters (5-10, it doesn't matter) will change music.
I tried did it like in Doom 2016 - when music changes to combat, so that there are several tracks and each time one of available files ones is selected.
I couldn't do this with S_ChangeMusic function - the music is constantly being loop and game starts hard lag every second.
But I got point where level was assigned to its source track (S_ChangeMusic"*").
Can I ask knowledgeable persons to help me understand this question, how starting from the 44th line in the ZSCRIPT file to gramatically make a random selection of music without lags? To change - and nicely play. And at next battle - another one.
On the 7 line I declaring list of tracks.
File is located here.
Thanks for your attention.
I want to ask a question about music and Zscript.
Somewhere in depths of ZDoom forum found "Music Changer" (from YouTube link), which has two music - one that replaces theme of level, another - if you attract the attention of monsters (battle music).
In parameters, you can set how many monsters (5-10, it doesn't matter) will change music.
I tried did it like in Doom 2016 - when music changes to combat, so that there are several tracks and each time one of available files ones is selected.
I couldn't do this with S_ChangeMusic function - the music is constantly being loop and game starts hard lag every second.
But I got point where level was assigned to its source track (S_ChangeMusic"*").
Can I ask knowledgeable persons to help me understand this question, how starting from the 44th line in the ZSCRIPT file to gramatically make a random selection of music without lags? To change - and nicely play. And at next battle - another one.
On the 7 line I declaring list of tracks.
File is located here.
Thanks for your attention.