Frictional Games Forum (read-only)

Full Version: Music not stoping when exiting level
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi there Smile could someone help me with a little issue I have on my full conversion? o: when I enter the game and there is music playing on my level if I decide to save and exit to the main menu the music won't stop o: It will keep playing even with the main menu song aswell... o:
That's strange. I'm sure there's a wrong setting somewhere because this doesn't happen in the main game. It sounds familiar though, maybe I encountered it once myself but I can't remember. Go through your configs and maybe try to find differences from the main game.
You might have the priority set too high, cause I had a song that would play for like 5 seconds over the menu whenever you quit the custom story, and I put the priority pretty high.
Do you have the fuction "StopMusic(float afFadeTime, int alPrio);" in your "void OnLeave()" function? That'll cause the music to stop whenever you leave the map, which should work just as well when you exit to main menu. It might fix it, but there's no telling since it's not included in the main game's script files (at least most of them, haven't gone through all).
Just putting "StopMusic(1, 100);" in void OnLeave() works.
(08-19-2014, 04:09 PM)The chaser Wrote: [ -> ]Just putting "StopMusic(1, 100);" in void OnLeave() works.

Didn't work for me... :/
Does OnLeave run when you "Save and exit"? I don't think it does.
(08-21-2014, 04:32 PM)Mudbill Wrote: [ -> ]Does OnLeave run when you "Save and exit"? I don't think it does.

Yeah I mean I really doubt it, I think its just used when switching maps and since the main menu isn't a map... :/
Well, it IS a map, but it isn't really the same category. I think OnLeave is only ran during the player's transition to another playable level.

As for the music, yeah perhaps the priority is too high. Perhaps the menu is configured incorrectly though, as I first said, and doesn't manage to stop it. Do you have a custom soundtrack in the menu?