Frictional Games Forum (read-only)
Music doesn't resume after enemy despawns - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: Music doesn't resume after enemy despawns (/thread-15165.html)

Pages: 1 2


Music doesn't resume after enemy despawns - FragdaddyXXL - 04-29-2012

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



RE: Music doesn't resume after enemy despawns - jessehmusic - 04-29-2012

(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);


??


RE: Music doesn't resume after enemy despawns - SilentStriker - 04-29-2012

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 ^^


RE: Music doesn't resume after enemy despawns - jessehmusic - 04-29-2012

(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


RE: Music doesn't resume after enemy despawns - FragdaddyXXL - 04-29-2012

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.



RE: Music doesn't resume after enemy despawns - FragdaddyXXL - 04-30-2012

Am I missing the meaning of Resume in the parameters? The wiki page fails to describe it.



RE: Music doesn't resume after enemy despawns - Cranky Old Man - 04-30-2012

(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.




RE: Music doesn't resume after enemy despawns - FragdaddyXXL - 04-30-2012

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.



RE: Music doesn't resume after enemy despawns - Juby - 05-01-2012

(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?




RE: Music doesn't resume after enemy despawns - FragdaddyXXL - 05-01-2012

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.