YesNoOk
avatar

stoping sounds (Read 3145 times)

Started by ClamSlam, August 25, 2015, 09:06:03 pm
Share this topic:
stoping sounds
New #1  August 25, 2015, 09:06:03 pm
  • ***
  • Drew my Icon. I know, i'm a Amateur.
  • just trying to survive in the land of MFG
    • American Samoa
    • ClamSlam@mugenguild.com
say when my character taunted, it played a sound that last, let's say 3 seconds. If you punch him and he's out of his taunt state, the sound is still playing. How does one interrupt sounds in mugen?
"If you can't slam with the best then go jam with the rest."
Last Edit: October 05, 2015, 01:46:24 am by Noctis
Re: stoping sounds
#2  August 25, 2015, 09:09:10 pm
  • ***
  • Non est hoc propter hoc sed propter est hoc
    • USA
    • doubletrend-zeta.neocities.org/
Code:
[State 195]
type = stopsnd
trigger1 = stateno != 195
channel = [whatever channel your sound was on]
Re: stoping sounds
#3  August 25, 2015, 09:31:23 pm
  • ***
  • Drew my Icon. I know, i'm a Amateur.
  • just trying to survive in the land of MFG
    • American Samoa
    • ClamSlam@mugenguild.com
"If you can't slam with the best then go jam with the rest."
Re: stoping sounds
#4  August 25, 2015, 09:40:12 pm
  • ***
  • Non est hoc propter hoc sed propter est hoc
    • USA
    • doubletrend-zeta.neocities.org/
correction, put it in your -2 or -3
if you use what I wrote you wouldn't be in state 195 so it won't trigger.
Re: stoping sounds
#5  August 27, 2015, 02:31:31 am
  • ***
  • Drew my Icon. I know, i'm a Amateur.
  • just trying to survive in the land of MFG
    • American Samoa
    • ClamSlam@mugenguild.com
"If you can't slam with the best then go jam with the rest."
Re: stoping sounds
#6  August 27, 2015, 07:47:35 am
  • ******
  • Hedgehog Whisperer
  • Red Bull addict
    • Spain
    • xgargoyle.mgbr.net
If you set the sound to be played on Channel=0, it will automatically stop when the player is hit
XGargoyle: Battle posing since 1979
http://xgargoyle.mgbr.net
http://www.pandorabots.com/pandora/talk?botid=e71c0d43fe35093a  <-- Please click that link
http://paypal.me/XGargoyle  <-- Donations welcome!
Re: stoping sounds
#7  August 27, 2015, 09:54:00 am
  • ***
  • Non est hoc propter hoc sed propter est hoc
    • USA
    • doubletrend-zeta.neocities.org/
Yeah, basically what I messed up when I first wrote it is that I had the state as 195, so you would have to be in state 195 for the sound to stop. If you're hit out of or exit the taunt state (195), MUGEN won't recognize it because you're not in the state, so the sound would still be playing.

If it's in -2 it is not part of that state (195) and will be checked every tick of gametime separately, so if you're in state 195 and exit it early the sound will stop.

so here
Code:
[State -2 stop taunt sound]
type = stopsnd
trigger1 = stateno != 195
channel = [whatever channel your sound was on]

I actually think it's a little annoying because you if have any other sounds on that channel they won't play at all because of the code. If only we could have MUGEN cache sound IDs so you could stop individual sounds. Just make sure it doesn't share a channel with other sounds.
Last Edit: August 27, 2015, 09:58:48 am by Bannana
Re: stopping sounds
New #8  August 27, 2015, 10:11:36 am
  • ******
The only thing is to use another channel, it's like an ID for the sounds.
How many channels are you allowed to have in a character? You have -1, 0, then up to 31. Is this correct?
So the channels are
-1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
and if you put 32 there's debug flood saying "ILLEGAL PLAYSND CHANNEL".
Last Edit: August 27, 2015, 10:27:24 am by Alex Sinigaglia
Re: stoping sounds
#9  August 27, 2015, 10:15:56 am
  • ***
  • Non est hoc propter hoc sed propter est hoc
    • USA
    • doubletrend-zeta.neocities.org/
I can't find a specified number in the state control docs so I'm unsure.

edit: Ah alright, I was about to test it myself
Re: stopping sounds
New #10  August 27, 2015, 10:16:37 am
  • ******
I checked the docs too, but there's nothing, so I tested it with a character and that seems the limit.
Last Edit: August 27, 2015, 10:27:17 am by Alex Sinigaglia