DRL > Requests For Features

More music?

<< < (4/6) > >>

Game Hunter:
Well derp dee derp to me. In the rand_music function, song_count should be initialized at 1 instead of 0. With song_count starting at 0, the the first song to be indexed doesn't actually occur (since there is no zeroth element in lua). Change the 0 to a 1 and everything should work out okay.

The title_mus[1] thing is my fault, too: I should have remembered that arrays still have to be referenced accordingly even if there's only one element in them.

Brewtal Legend:
ok. Just tried it. I do get title music now but it is always the same one. the cdoom.mp3 listed second in the title_playlist. I restarted and exited the game 20 something times in a row and it has yet to change.

Also, haven't tried it yet but, the mortem screen music should be randomizable too right?

Game Hunter:

--- Quote from: Brewtal Legend on April 17, 2012, 20:36 ---I do get title music now but it is always the same one. the cdoom.mp3 listed second in the title_playlist. I restarted and exited the game 20 something times in a row and it has yet to change.

--- End quote ---
Unfortunately I don't know what the issue is, here. You may have stumbled upon the predictability of a random seed that has yet to be initialized elsewhere...considering that the playlists with more than one song seem to randomize just fine, you could try to increase the song_num variable for the title playlist and, if that doesn't work, accordingly increase the index called (like title_mus[3]).


--- Quote from: Brewtal Legend on April 17, 2012, 20:36 ---Also, haven't tried it yet but, the mortem screen music should be randomizable too right?

--- End quote ---
The music that plays when the mortem appears depends on when you see it. It's either going to be via "victory" (when you win) or "bunny" (when you don't). (In modules it could possibly be changed during the mortem itself, and is otherwise linked to the circumstances of the map, as the mortem appears regardless of victory or even quitting.)

shark20061:

--- Quote from: Game Hunter on April 18, 2012, 07:29 ---(In modules it could possibly be changed during the mortem itself, and is otherwise linked to the circumstances of the map, as the mortem appears regardless of victory or even quitting.)

--- End quote ---

Quitting doesn't show the mortem in modules, similar to quitting in the regular game.

Brewtal Legend:
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:


--- Code: ----- 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",
}



--- End code ---


Did I not copy something over from your example correctly or forgot to edit? Sorry, I really don't know anything about lua script.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version