Page 1 of 1

Music not exporting

PostPosted: Mon Aug 22, 2011 2:56 am
by ikarus
None of my music is present in the exported version of my game, in neither linux or windows. Oddly both works when playing the game from the editor??? Only when exported... I've tried oggs and wavs, but oddly my wav sound effects work fine :/

Any ideas? :/

Re: Music not exporting

PostPosted: Mon Aug 22, 2011 3:30 am
by ikarus
Wait figured a bit out! I have an array of the music filenames to play depending on which level it is cause I didn't want to have to play each file manually. Then I built the correct path using sprintf and play it with a variable as the path. I changed the PlaySound to a complete path to one of the music files and now it plays exported. I think because I'm not using full path names that it's just not including them in the exported data.
Anyone know a way around this!? I really don't want to have to manually put in the music for the like 50+ levels I plan on having...

Re: Music not exporting

PostPosted: Mon Aug 22, 2011 10:43 am
by skydereign
Nope, there are known problems with this, but that's just how it works. For gE to play your sound, you need to have a PlayMusic2 or PlaySound2 call with the name of the file. Otherwise gE won't keep the file. This has been a problem for me as like you I prefer to keep it in an array or similar, but what I usually end up doing is this. Have a function for playing music, and just put in a switch that has the many PlayMusic2 calls. This appeases gE's need to have the PlayMusic2 function calls, which is rather sad... What I do for sounds is just have a function that stores all the PlaySound2 calls, that way I can use more custom sound functions.

Re: Music not exporting

PostPosted: Mon Aug 22, 2011 12:16 pm
by ikarus
It's funny lol, that's exactly what I ended up doing haha. But I never gave up hope that I'd be able to make it easier^^