Stoping sound efects

Started by viktor, Tue 11/05/2004 20:37:28

Previous topic - Next topic

viktor

Hy
A few day back I asked a question about hotspots and sounds.
I set my musik as a sound efect (that is the only way I know how) and I want it to stop when the character leaves the room. How do I do that?

Have a nice day  ;)
signature" border="0
<a target='_blank' href='https://imgbb.com/'>resurrection pictures for facebook</a>

Ishmael

Room Interactions -> Player Leaves Screen -> Run Script

and use either StopMusic, or StopChannel(?).. See manul for PlayMusic and PlaySound, their "See also" should have links to the stopping commands.
I used to make games but then I took an IRC in the knee.

<Calin> Ishmael looks awesome all the time
\( Ö)/ ¬(Ö ) | Ja minähän en keskellä kirkasta päivää lähden minnekään juoksentelemaan ilman housuja.

Phemar


You don't need to set your music as a sound effect?

Play it with the Play music on room load: []

And check it and type in what music you want to play. AGS will carry on playing the music when you step into another room, unless there is a different file set to play in that room.

viktor

#3
NO NO...
I have a hotspot. When a character interacts with it it plays musik ( as a sound efekt couse I don't know how to set it otherwise).
And I want THAT SOUND effectto stop playing when I leave the room or interact with another hotspot.
signature" border="0
<a target='_blank' href='https://imgbb.com/'>resurrection pictures for facebook</a>

..

QuoteYou don't need to set your music as a sound effect?

Play it with the Play music on room load: []
Yeh he had a stereo which plays music on interaction.

I'm not that good at scripting but I had a go...

Try

StopChannel (3);

with Run Script on the hotspots that you want it to stop on and when player
leaves room

Or if that don't work try

StopChannel (4);

or

StopChannel (5);

I'm not that well informed on channels so correct me if this is wrong.

Scorpiorus

The problem with stopping a specific channel is that you can't say for sure what channel the sound is playing on. It can even be changed on the next game start, because the PlaySound() function is given a channel which is currently free.

To stop the sound pass -1 to PlaySound()

On Player leaves screen interaction:

PlaySound(-1);

SMF spam blocked by CleanTalk