How to check if background music is already playing?

Started by birenbergg, Mon 28/08/2017 15:37:12

Previous topic - Next topic

birenbergg

Is there a way to check if the background music is playing, so it won't restart when the player enters the initial room?

Let's say I have an area with 5 rooms and the background music is shared between them. The player starts in room 1. When he changes to any other room, the music continues playing, but if he returns to room 1, the music restarts. That's not the effect I want.

I could use the event when the player enters the room for the first time, but what if the player quits then entire area and then would want to come back?

Mandle

Yes, there is a command to check if an audio track is playing:

http://www.adventuregamestudio.co.uk/manual/ags47.htm

Scroll down to IsPlaying property.

(I found this by googling "AGS is audio playing"... Putting "AGS" in front of what you want to know and then a few words after is a quick shortcut I have found to find anything in the manual while avoiding its search option which is a bit hit-and-miss)

Khris


birenbergg

Thank you so much, guys!

P. S. Wish it was something that is handled natively.

SMF spam blocked by CleanTalk