Music (WIP,works, but need some help)

Music (WIP,works, but need some help)

Discuss Lua based Spring scripts (LuaUI widgets, mission scripts, gaia scripts, mod-rules scripts, scripted keybindings, etc...)

Moderator: Moderators

Post Reply
User avatar
Hoi
Posts: 2917
Joined: 13 May 2008, 16:51

Music (WIP,works, but need some help)

Post by Hoi »

okay this is what I have

Code: Select all

function widget:Initialize()
wavFiles = VFS.DirList('music/', '*.wav')
for k,v in pairs(wavFiles) do Spring.PlaySoundFile (v,1) end
end
it plays all wav's in spring/music, later it will also play ogg's and will play in a random order if you want too

problems/questions:
-currently it plays all files at the same time, how to fix that?
-if i reload it i see that i get the error, could not play "2" no such file, i had a file named 2 in the music folder, so the widget does not refresh the list, help?
-when you disable it it doesnt disables, i think i know how to fix that, I'll do that later
Post Reply

Return to “Lua Scripts”