Page 1 of 1

Can I randomize the title music with SNDINFO?

PostPosted: Tue Apr 10, 2018 2:08 am
by SiFi270
I'm working on a mapinfo patch for the Serenity trilogy that can be loaded with all three wads and their music addons, but each one uses its own track for D_INTRO, D_INTER and D_VICTOR. After copying the relevant music files into the patch and replacing the D at the start of each with the first letter of the wad it's meant for, the intermission and victory music are easily handled with mapinfo, and for the title music I thought I'd use $musicalias and $random to play either Eternity's or Infinity's (since Serenity's is just the same as Doom's) but it doesn't seem to be that simple. Is there a workaround I can use to get the result I want?

Re: Can I randomize the title music with SNDINFO?

PostPosted: Thu Apr 12, 2018 4:23 am
by ZzZombo
I remember back then trying to do the same only to find out that music can't be randomized. Maybe things have changed, but unlikely.

Re: Can I randomize the title music with SNDINFO?

PostPosted: Thu Apr 12, 2018 9:21 am
by Apeirogon
I know how do so using acs

Code: Select allExpand view
#include "zcommon.acs"

str songs_name[amount of songs] = { "song name 1", "song name 2", "song name 3", .....};
int pick_what_song_play;
       
script jukebox open
{
pick_what_song_play= random(0, amount of songs - 1);
SetMusic(songs_name[pick_what_song_play]);
}

Re: Can I randomize the title music with SNDINFO?

PostPosted: Sat Aug 18, 2018 9:11 pm
by Gato303
Apeirogon wrote:I know how do so using acs

Code: Select allExpand view
#include "zcommon.acs"

str songs_name[amount of songs] = { "song name 1", "song name 2", "song name 3", .....};
int pick_what_song_play;
       
script jukebox open
{
pick_what_song_play= random(0, amount of songs - 1);
SetMusic(songs_name[pick_what_song_play]);
}


That's cool, thanks for the script help.
Tho... how do you set the script to be executed when the Title Screen shows up?

Re: Can I randomize the title music with SNDINFO?

PostPosted: Sun Aug 19, 2018 8:24 am
by Apeirogon

Re: Can I randomize the title music with SNDINFO?

PostPosted: Tue Jan 08, 2019 11:24 am
by Gato303
Apeirogon wrote:https://zdoom.org/wiki/TITLEMAP


Thanks! Had a bit of tough time creating a simple map on Slade3 cause of my inexperience and creating a WAD file containing the Titlemap inside the PK3. But finally I could figure it out and it's working, thanks :) :D