Frictional Games Forum (read-only)

Full Version: Music doesn't resume after enemy despawns
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I have it so that when I use the PlayMusic function, the bool Resume value is true. Why does my music not resume after the monster spawns, runs at you, and then despawns?

Code:
void PlayMusic(string& asMusicFile, bool abLoop, float afVolume, float afFadeTime, int alPrio, bool abResume);

That's the syntax for quick reference
(04-29-2012, 10:05 AM)FragdaddyXXL Wrote: [ -> ]I have it so that when I use the PlayMusic function, the bool Resume value is true. Why does my music not resume after the monster spawns, runs at you, and then despawns?

Code:
void PlayMusic(string& asMusicFile, bool abLoop, float afVolume, float afFadeTime, int alPrio, bool abResume);

That's the syntax for quick reference
PlayMusic("i'm a ogg file", true, 1, 1, 1, true);


??
I have my PlayMusic on enter so it always starts when I enter the map, same goes with monsters etc Smile

this was also my 600th post ^^
(04-29-2012, 02:19 PM)SilentStriker Wrote: [ -> ]I have my PlayMusic on enter so it always starts when I enter the map, same goes with monsters etc Smile

this was also my 600th post ^^
haha Gratz Smile Post Freak Big Grin Tongue , btw have you made the logo ? etc etc
PlayMusic("Threnody for the victims of Hiroshima", false, 0.8f, 0.1f, 0, true);

My music begins after interaction with a script box. Now, when the monster is active, naturally the enemy music begins to play. When he despawns, the enemy music stops, but my music does not resume. It's kinda lame because this is a ~8min piece.
Am I missing the meaning of Resume in the parameters? The wiki page fails to describe it.
(04-30-2012, 01:40 PM)FragdaddyXXL Wrote: [ -> ]Am I missing the meaning of Resume in the parameters? The wiki page fails to describe it.
Never used this function, but my guess is that WHEN you start to play the music again, HPL2 has saved the position of where the song was cut off the last time it played, instead of it starting over from the beginning. You need to manually play the song again.

What I have figured out is that I can have the song begin automatically after the enemy despawns, but at a cost: the song starts from the beginning. This happens when the resume value is true and the loop value is true. If the loop value is false, nothing happens after the enemy despawns. I'll look into manually triggering the song.
(04-30-2012, 07:25 PM)FragdaddyXXL Wrote: [ -> ]What I have figured out is that I can have the song begin automatically after the enemy despawns, but at a cost: the song starts from the beginning. This happens when the resume value is true and the loop value is true. If the loop value is false, nothing happens after the enemy despawns. I'll look into manually triggering the song.
That is...... strange.
What happens if you change the priority to 1?

Right now, I have the priority now set to 7, just to see if that was affecting it. That didn't work :[
EDIT:
Triggering the music after the monster despawns also has it start from the beginning. I guess it's not possible to start where you were. If I was really desperate, I could just create a bunch of music files, all starting at different points in the song and use timers to figure out which version of the song to play. Too much work.
Pages: 1 2