Hey, I guess this might be a stupid question, but it's really bugging me - Everytime I save my game and then load it, the music continues from where it was the moment I saved the game. Is this a bug or some strange feature? Is there a way to make the music track start from the beginning when a player loads a game?
Thanks in advance!
That is exactly as intended. A game is saved "as it is at the moment of saving", so the music position is kept, too.
You can write your own function to restart the music though; one way would be to use a global audiochannel for the music and then manually reset it AFTER calling the restore command.
There's a way to respond to "game restored" event in game.
In GlobalScript.asc add "on_event" function:
function on_event(EventType event, int data)
{
if (event == eEventRestoreGame)
{
// reset your music here
}
}
E: I must correct myself:
You don't have to put "on_event" function only in GlobalScript, you may as well put it in every room you have and do a specific action for each of them (if you need to).
Thanks a lot! Seemed weird to me that this is a feature - It's really weird to hear the middle of a track when you restore a game.
But at least there's an easy fix, so thanks :)