Just tried changing the song_num variable and I still only get the same song playing over and over. Although, that song that plays is different depending on what number I use for the song_num variable. I tried 1-4.
I tried increasing the index too and it made no difference.
When I mentioned the mortem screen, I was talking about the "bunny" one. Would I have to use a specific tag like with the other ones? Like boss_playlist/mus, spec_playlist/mus, etc.
***Edit***
I actually just played through till hell's arena about 10 times in a row and dying on purpose just to check. It doesn't seem any of the levels are playing music randomly. :( Not sure why I thought it did work now. Maybe because I am using ambient psx soundtrack so it's harder to tell. The songs that play are coming from the correct playlist arrays but are not randomizing.
Here's the config:
-- You can get much higher quality Doom MP3 tracks from
-- http://www.sirgalahad.org/paul/doom/
-- To use them, edit config.lua, and change music.lua to musicmp3.lua
-- MP3's need to be put in a directory named mp3.
local function rand_music(music_array,song_num)
local song_tot = table.maxn(music_array)
local song_count = 1
local music_list = {}
for i=1,math.ceil(song_num/song_tot) do
local loop_itr = math.min(song_tot,song_num)
song_num = song_num - song_tot
local song_list = music_array
for j=1,loop_itr do
idx = math.random(song_tot-j+1)
song = song_list[idx]
music_list[song_count] = song
table.remove(song_list,j)
song_count = song_count + 1
end
end
return(music_list)
end
local title_playlist = {
"mp3/PSX_Doom_Music/doom_titlescreen.mp3",
"mp3/cdoom.mp3",
"mp3/doom3.mp3",
"mp3/DSoP_00_WelcomeToHell(Intro).mp3",
}
local reg_playlist = {
"mp3/PSX_Doom_Music/doom_01hangar.mp3",
"mp3/PSX_Doom_Music/doom_02plant.mp3",
"mp3/PSX_Doom_Music/doom_03toxinrefinery.mp3",
"mp3/PSX_Doom_Music/doom_04commandcontrol.mp3",
"mp3/PSX_Doom_Music/doom_05phoboslab.mp3",
"mp3/PSX_Doom_Music/doom_06centralprocessing.mp3",
"mp3/PSX_Doom_Music/doom_07computerstation.mp3",
"mp3/PSX_Doom_Music/doom_08phobosanomaly.mp3",
"mp3/PSX_Doom_Music/doom_09deimosanomaly.mp3",
"mp3/PSX_Doom_Music/doom_10containmentarea.mp3",
"mp3/PSX_Doom_Music/doom_11refinery.mp3",
"mp3/PSX_Doom_Music/doom_12deimoslab.mp3",
"mp3/PSX_Doom_Music/doom_13commandcenter.mp3",
"mp3/PSX_Doom_Music/doom_16hellgate.mp3",
"mp3/PSX_Doom_Music/doom_17hellkeep.mp3",
"mp3/PSX_Doom_Music/doom_18pandemonium.mp3",
"mp3/PSX_Doom_Music/doom_22limbo.mp3",
"mp3/PSX_Doom_Music/doom_20unholycathedral.mp3",
"mp3/PSX_Doom_Music/doom_21mterebus.mp3",
"mp3/PSX_Doom_Music/doom_24hellbeneath.mp3",
"mp3/PSX_Doom_Music/fdoom_01attack.mp3",
"mp3/PSX_Doom_Music/fdoom_02virgil.mp3",
"mp3/PSX_Doom_Music/fdoom_03canyon.mp3",
"mp3/PSX_Doom_Music/fdoom_04combine.mp3",
"mp3/PSX_Doom_Music/fdoom_05catwalk.mp3",
"mp3/PSX_Doom_Music/fdoom_06fistula.mp3",
"mp3/PSX_Doom_Music/fdoom_07geryon.mp3",
"mp3/PSX_Doom_Music/fdoom_08minos.mp3",
"mp3/PSX_Doom_Music/fdoom_09nessus.mp3",
"mp3/PSX_Doom_Music/fdoom_10paradox.mp3",
}
local spec_playlist = {
"mp3/e1m1.mp3",
"mp3/e1m2.mp3",
"mp3/e1m3.mp3",
"mp3/e1m4.mp3",
"mp3/e1m5.mp3",
"mp3/e1m6.mp3",
"mp3/e1m7.mp3",
"mp3/e1m8.mp3",
"mp3/e1m9.mp3",
"mp3/Hangarmageddon.mp3",
"mp3/PA01Quake_Theme.mp3",
"mp3/Animal_Acoustic.mp3",
}
local boss_playlist = {
"mp3/PSX_Doom_Music/doom_credits.mp3",
"mp3/PSX_Doom_Music/final_doom_end.mp3",
"mp3/PSX_Doom_Music/psx_main_menu.mp3",
"mp3/PSX_Doom_Music/PSX_stats_screen.mp3",
}
local title_mus = rand_music(title_playlist,1)
local reg_mus = rand_music(reg_playlist,23)
local boss_mus = rand_music(boss_playlist,4)
local spec_mus = rand_music(spec_playlist,11)
Music = {
start = title_mus[1],
interlude = "mp3/PSX_Doom_Music/fdoom_04combine.mp3",
bunny = "mp3/d2end.mp3",
intro = "mp3/DSoP_00_WelcomeToHell(Intro).mp3",
hellgate = boss_mus[1],
level2 = reg_mus[1],
level3 = reg_mus[2],
level4 = reg_mus[3],
level5 = reg_mus[4],
level6 = reg_mus[5],
level7 = reg_mus[6],
level8 = reg_mus[7],
level9 = reg_mus[8],
level10 = reg_mus[9],
level11 = reg_mus[10],
level12 = reg_mus[11],
level13 = reg_mus[12],
level14 = reg_mus[13],
level15 = reg_mus[14],
level16 = reg_mus[15],
level17 = reg_mus[16],
level18 = reg_mus[17],
level19 = reg_mus[18],
level20 = reg_mus[19],
level21 = reg_mus[20],
level22 = reg_mus[21],
level23 = reg_mus[22],
level24 = reg_mus[23],
the_chained_court = spec_mus[1],
halls_of_carnage = spec_mus[2],
hells_armory = spec_mus[3],
hells_arena = spec_mus[4],
spiders_lair = spec_mus[5],
city_of_skulls = spec_mus[6],
the_wall = spec_mus[7],
unholy_cathedral = spec_mus[8],
the_mortuary = spec_mus[9],
the_vaults = spec_mus[10],
the_lava_pits = spec_mus[11],
tower_of_babel = boss_mus[2],
hell_fortress = boss_mus[3],
dis = boss_mus[4],
victory = "mp3/Motorhead - Hellraiser.mp3",
}
Did I not copy something over from your example correctly or forgot to edit? Sorry, I really don't know anything about lua script.