Results 1 to 10 of 10

Thread: Wav Soundtrack

  1. #1

    Wav Soundtrack

    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.


    Download link:
    http://www.mediafire.com/?uoadf5bt3t4xu5x

  2. #2

  3. #3
    Here's a slip from 00_soundtrack.

    timer:
    if(curMusic != endTrack && start == 0)
    curMusic=curMusic+1;
    else if(curMusic == endTrack && start == 0)
    curMusic=loopTo;

    start=0;
    i=curMusic-2;
    if(cd == 1) musicWav=cd1music02[i];
    if(cd == 2) musicWav=cd2music02[i];

    music=PlaySoundLocal(musicWav, 1, 0, 0x300);
    SetTimer(GetSoundLen(musicWav));
    return;

  4. #4
    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.
    MDatCoC SP Contest Winner
    MDatDY MLP5 Winner
    MDat? (Coming Soon!)

  5. #5
    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
    <landfish> FastGamerr > Satan
    FGR Projects and Lists Catalogue

  6. #6
    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
    again.
    So I created a item you use to start playing the music.
    Only solution I found.

  7. #7
    Can't you set it to do a 'check' every 10 seconds or so?
    MDatCoC SP Contest Winner
    MDatDY MLP5 Winner
    MDat? (Coming Soon!)

  8. #8
    I found no way to check if the music is still playing.

  9. #9
    Quote Originally Posted by 40Delta View Post
    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.

    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.
    MDatCoC SP Contest Winner
    MDatDY MLP5 Winner
    MDat? (Coming Soon!)

  10. #10
    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?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •