The result of free time and curiosity.
I've changed the soundtrack cogs so now it plays using wav files, the Power Within episode works perfectly.
Unfortunately the music stops playing after loading a savegame, and I could not find a fix to this. If anyone has any solutions to this problem, please share.
Here's a slip from 00_soundtrack.
if(curMusic != endTrack && start == 0)
else if(curMusic == endTrack && start == 0)
if(cd == 1) musicWav=cd1music02[i];
if(cd == 2) musicWav=cd2music02[i];
music=PlaySoundLocal(musicWav, 1, 0, 0x300);
It stops loading after a savegame? So if the player died in the level, and loaded the last quicksave, would it still work? I don't know whether you mean after a quicksave or loading a saved game from the menu.
From what I remember, some things that are defined in startup: (like WAV soundtracks) won't be loaded again with the savegame. It might be the same with newplayer: because the game just keeps on loading the previous savegame instead of actually creating a new player, but I'm not entirely sure about that
If the player dies and load any savegame the music stops playing.
However, the timer is still active, so after a while the music starts
So I created a item you use to start playing the music.
Only solution I found.
Can't you set it to do a 'check' every 10 seconds or so?
I found no way to check if the music is still playing.
There's a COG code 'getsoundlength();' or something, I used it frequently for cutscenes so I wouldn't have to work out how long each .wav file is so mouths would stop moving on time. Perhaps if you 'getsoundlength();' (again, probably not that exactly) the in-question music file every 3 seconds, then if the player had died then it will show up as 0 seconds. In which case have it restart.
Originally Posted by 40Delta
That sounded awful. Basically, if you could do a code in which you checked to see if the sound length was less than a second, then to restart it. I hope that makes sense. It just may work.
The GetSoundLen verb returns the length of the wav file, so it will always be the same value until the music changes.
Is there a way to check if the game has been loaded?