Page 1 of 1

[solved] Can I make just one "hotspot" to do it?

Posted: Mon Oct 08, 2018 5:51 pm
by Nanahs
If I have an image like this one on my game:

Image

I wanted the person to click on this image and the sound of an offline tv ("oflinnetv.mp3") to start playing.
And when the person clicked the tv again, the sound would stop.

But the problem is: there's already a song playing. And I didn't want it to be stopped.

So, is it possible to create a hotspot where I could play "oflinnetv.mp3" as a sound and when clicking there again, only the tv sound would stop playing? And not the background music.

I had added a "action PauseAudio" and everything stopped playing.The sound, but also the music.

Thanks :)

Re: Can I make just one "hotspot" to do it?

Posted: Mon Oct 08, 2018 10:36 pm
by parttimestorier
If you want to have the TV sound and background music playing at once, and to be able to stop one but not the other, you just need to make sure they're on different channels. The easiest way to do that would be to have the background music on the "music" channel and the TV sound on the "sound" channel, which are the channels that automatically exist already. So you would start them like this:

Code: Select all


play music "whatever_the_file_name_is.mp3"

play sound "oflinnetv.mp3" loop

You need to add "loop" to the "play sound" command if you want the TV sound to keep repeating until you tell it to stop, because by default the music channel loops and the sound channel doesn't. Then when you want the TV sound to stop, just say "stop sound". I'm pretty sure that would work! You could also check this section of the documentation for more information.

Re: Can I make just one "hotspot" to do it?

Posted: Mon Oct 08, 2018 10:48 pm
by Nanahs
parttimestorier wrote: Mon Oct 08, 2018 10:36 pm If you want to have the TV sound and background music playing at once, and to be able to stop one but not the other, you just need to make sure they're on different channels. The easiest way to do that would be to have the background music on the "music" channel and the TV sound on the "sound" channel, which are the channels that automatically exist already. So you would start them like this:

Code: Select all


play music "whatever_the_file_name_is.mp3"

play sound "oflinnetv.mp3" loop

You need to add "loop" to the "play sound" command if you want the TV sound to keep repeating until you tell it to stop, because by default the music channel loops and the sound channel doesn't. Then when you want the TV sound to stop, just say "stop sound". I'm pretty sure that would work! You could also check this section of the documentation for more information.
Thank you so much for your help! :)