YesNoOk
avatar

How to insert and stop KO sound (Read 1588 times)

Started by miccek, October 05, 2013, 04:52:30 pm
Share this topic:
How to insert and stop KO sound
#1  October 05, 2013, 04:52:30 pm
  • avatar
  • *
    • Italy
    • miccek4life@gmail.com
Somebody help me.
I'm new in this sforum. And i'm also new in Mugen Development. Nevertheless, i'm making snd file for character Blue Mary, by Keyu. Cause in the character folder there's not anyone.
So... i've prepared all the wav files for the snd one, and i'm putting all in the constant files.
Since then i've inserted intro and win sound with no problems.
Now... i'm going to insert the KO sound, and my problem is how to stop it.
I tried all the solutions recommended at this topic:

http://mugenguild.com/forum/topics/stop-sounds-when-hit-solved-how-change-ko-sound-palette-solved-145961.0.html

...and I was abled to make it sound. But i'm not able to stop it. What i've inserted in cns file is:

[Statedef -2]
[State -2, KO snd]
type = varset
trigger1 = alive && var(8) > 0
trigger2 = !alive && var(8) < 2
var(8) = ifelse(alive, 0, var(8) + 1)
ignorehitpause = 1
[State -2, KO snd]
type = playsnd
trigger1 = !alive && var(8) = 1
trigger1 = var(8):= 2
value = 11, 1
ignorehitpause = 1
channel = 11

Note: I don't want insert an executive KO sound (11, 0), cause I will insert different KO sounds. That's why value is 11, 1.

I've also tried to insert a stopsnd command, but whit this the KO sound doesn't work anymore:

[State -2, KO end snd]
type = stopsnd
trigger1 = !alive
trigger1 = var(8)=2
channel = 11

So... what i have to do?
Last Edit: October 05, 2013, 05:03:33 pm by miccek
Re: How to insert and stop KO sound
#2  October 05, 2013, 10:41:47 pm
  • *****
  • Video Game Veteran
    • USA
    • gcnmario.free.fr
Sound 11, 0 does not have its own sound channel, if memory serves. I think it acts the same as if playing a regular sound without a channel being idetified.

The alternative is just not to play the sound file at all.
Code:
[State -2, AssertSpecial]
type = AssertSpecial
trigger1 = 1
ignorehitpause = 1
flag = NoKOSnd


But if necessary, when you use a variable to make the sound play, you could keep adding on to the variable to determine when to stop it. 
Code:
    ;--------------------
    ; KO Scream
    [State -2, VarSet]
    type = VarSet
    trigger1 = Alive
    trigger1 = Life > 0
    ignorehitpause = 1
    v = 55
    value = -1
     
    [State -2, VarAdd]
    type = VarAdd
    trigger1 = Alive <= 0
    trigger1 = Life <= 0
    trigger1 = Var(55) <= 10
    ignorehitpause = 1
    v = 55
    value = 1
     
    [State -2, PlaySnd]
    Type = PlaySnd
    triggerall = Alive <= 0
    triggerall = Life <= 0
    trigger1 = Var(55) = 0
    value = 11, 1
    channel = 11

    [State -2, StopSnd]
    Type = StopSnd
    triggerall = Alive <= 0
    triggerall = Life <= 0
    trigger1 = Var(55) = 10
    channel = 11
    ;--------------------

This should make it work like you want.

"You must defeat my flaming
dragon punch to stand a chance."
Re: How to insert and stop KO sound
#3  October 06, 2013, 07:54:11 pm
  • avatar
  • *
    • Italy
    • miccek4life@gmail.com
First of all... thank you for your interest.
With your alternative... i don't know why, but KO sound doesn't work anymore. Maybe i've inserted in the wrong place. Could you tell me where i have to act?

And... your command with the variable... sometimes acts (few times), sometimes not. Cause i think it's difficult var(55) is always = 10.
Do you know (or anybody knows) another method better than this?
Thanks.
Re: How to insert and stop KO sound
#4  October 06, 2013, 08:06:05 pm
  • *****
  • Video Game Veteran
    • USA
    • gcnmario.free.fr
Yea I know the alternative doesn't allow it to play anymore. That's the point.

For the variable version, you need to work with it. You could use another variable # if that one is already in use by the character. The code I provided is just the example of how I would set it up to make ti play, then stop in the middle.

Instead of code, you could always just crop the KO sound file of the character by exporting it, removing how much you need to via sound editing software, and reinsert the new sound change. Or just add the new cropped sound file after the original KO sound, and just play that sound instead.

"You must defeat my flaming
dragon punch to stand a chance."
Re: How to insert and stop KO sound
#5  October 07, 2013, 05:39:04 pm
  • avatar
  • *
    • Italy
    • miccek4life@gmail.com
Well... i don't know what i have to do to use another variable. I told you... i'm new in mugen development. And i don't know very well commands i have to insert in. So please, help me.  ::)

Anyway... I think your example for the variable version is perfect. I mean... KO sound acts, but only if P2 makes kung fu throw moves, cause var(55) = 0. If i change it, KO sound doesn't work. So... how can i avoid this pro?
Maybe... an ifelse command could solve all. What do you think?
Re: How to insert and stop KO sound
#6  October 07, 2013, 08:22:23 pm
  • *****
  • Video Game Veteran
    • USA
    • gcnmario.free.fr
If you put it in Statedef -3, this won't work if the player is put into a thrown/custom state (colored yellow in the debug display).

If you put the code in statedef -2, it should always work, even if player is being put in a thrown/custom state.


If that makes any difference to you.

"You must defeat my flaming
dragon punch to stand a chance."
Re: How to insert and stop KO sound
#7  October 08, 2013, 12:06:54 am
  • avatar
  • *
    • Italy
    • miccek4life@gmail.com
Sorry, but i really don't understand.

If i put it in statedef -3 nothing works, that's right. But... i put all this mess in statedef -2. And it works only if player2 makes a thrown state.
I really don't know why... What command i need to solve this problem?
Re: How to insert and stop KO sound
#8  October 08, 2013, 12:34:38 am
  • *****
  • Video Game Veteran
    • USA
    • gcnmario.free.fr
Do you always want this to work when player is KO'ed? Or only when the player is being thrown to play it right?

"You must defeat my flaming
dragon punch to stand a chance."
Re: How to insert and stop KO sound
#9  October 08, 2013, 07:43:04 pm
  • avatar
  • *
    • Italy
    • miccek4life@gmail.com
mmm... i need it when player is KO'ed.....
But let me see if i'm able to solve the matter when it's being thrown. Maybe i do not, but i'm going to try.
Thank you very much, pal.
Re: How to insert and stop KO sound
#10  October 09, 2013, 07:00:17 am
  • *****
  • Video Game Veteran
    • USA
    • gcnmario.free.fr
What you can do is just for checking/testing purposes, if you change the playsnd's channel = 11 into channel = -1, that would stop all sounds from playing, including the KO sound of the character playing the death sound. Not that you would need it for anything, but just thought I'd share.

One of my recent mugen creations has the opponents play their KO sound, and then have it stop playing in the middle. Except they don't play it when they die. It's more like I put them into custom states to make it happen. But it's same concept, except its either animation or time based instead of self character variable based. ;)

"You must defeat my flaming
dragon punch to stand a chance."
Re: How to insert and stop KO sound
#11  October 09, 2013, 03:32:26 pm
  • avatar
  • *
    • Italy
    • miccek4life@gmail.com
Wow... good work! yes, that's the same.  :yes:
What I'd like to do is a character that plays a KO sound when it's KO'ed and another one when match is over.
Now... what i was not able to do in my old code (see the first post) is to stop the KO sound in wider terms.

You suggested to me another method, and i've erased my old one.
But the pro is still there: even if i change the playsnd's channel KO sound acts only in throw moves.
I know the reason, but i've no idea what i have to do.

     Posted: October 15, 2013, 12:33:51 pm
...So, are you (or is anybody) going to help me or not???
I don't think my problem is so "demanding".
As i said in last post... What I'd like to do is a character that plays a KO sound when it's KO'ed and another one when match is over.
Please, give me a possible solution.


     Posted: October 17, 2013, 12:21:44 am
Please, man. If you (or somebody) don't answer me... i have to sign in another forum, more "useful".
Come on, I'm still wet behind the ears.....
Re: How to insert and stop KO sound
#12  October 17, 2013, 02:15:44 am
  • *****
  • Video Game Veteran
    • USA
    • gcnmario.free.fr
What's the problem here? Not one of my suggestions are working fro you yet?

"You must defeat my flaming
dragon punch to stand a chance."
Re: How to insert and stop KO sound
#13  October 17, 2013, 09:30:59 am
  • avatar
  • *
    • Italy
    • miccek4life@gmail.com
Exactly... there's always the same problem... it works only when player is KO'ed through a thrown state. I know why, but i don't know how to solve this mess.
Re: How to insert and stop KO sound
#14  October 17, 2013, 06:34:40 pm
  • *****
  • Video Game Veteran
    • USA
    • gcnmario.free.fr
If its your own characters self states use the code.
Spoiler, click to toggle visibilty


If it's for any character being thrown, do this.
Spoiler, click to toggle visibilty

"You must defeat my flaming
dragon punch to stand a chance."
Re: How to insert and stop KO sound
#15  October 18, 2013, 07:03:02 pm
  • avatar
  • *
    • Italy
    • miccek4life@gmail.com
Re: How to insert and stop KO sound
#16  October 18, 2013, 07:22:20 pm
  • *****
  • Video Game Veteran
    • USA
    • gcnmario.free.fr
Well instead of stopping it via time, you could stop it via AnimElem number, or something other than time.  There's some other characters that play, and stop the enemy's KO sound if you need an example.

"You must defeat my flaming
dragon punch to stand a chance."
Re: How to insert and stop KO sound
#17  October 19, 2013, 01:27:12 pm
  • avatar
  • *
    • Italy
    • miccek4life@gmail.com
...what do you mean? i really don't understand.  :dizzy2:
...show me what i should do  :shocked2:
Re: How to insert and stop KO sound
#18  October 19, 2013, 06:42:47 pm
  • *****
  • Video Game Veteran
    • USA
    • gcnmario.free.fr
Code:
[state 1234, sound]
Type = stopsnd
Trigger1 = animtime = 0
Channel = 11

That way it will stop playing the sound when the character being thrown has reached the end of the animation.

There are loads of many ways to stop a sound. You just need to work with it. I just don't know whats so hard to understand about this.

"You must defeat my flaming
dragon punch to stand a chance."
Re: How to insert and stop KO sound
#19  October 20, 2013, 11:34:25 pm
  • avatar
  • *
    • Italy
    • miccek4life@gmail.com
.....I don't think you've understood my problem.
I know how could i stop the KO sound. But my problem is not "stop" KO sound. My problem is "play" KO sound (sometimes).
As you can see on my video when my char is KO'ed with a no-thrown state... the KO sound doesn't play.
And as i told you... i don't know why. I'm new in the mugen world. So please, help me to solve it.
Re: How to insert and stop KO sound
#20  October 21, 2013, 12:29:32 am
  • *****
  • Video Game Veteran
    • USA
    • gcnmario.free.fr
make the sound at group 11,0 then. It'll play automatically.

"You must defeat my flaming
dragon punch to stand a chance."