YesNoOk
avatar

"Getting Hit" Sounds, and Picking a Sound at Random... (Read 3238 times)

Started by Agoeb, November 16, 2020, 10:27:30 pm
Share this topic:
"Getting Hit" Sounds, and Picking a Sound at Random...
#1  November 16, 2020, 10:27:30 pm
  • Hey it's me, Alex G!
    • Canada
Hey all!

Creating a first time character through a MUGEN as a quarantine passtime and today's project is sounds. I've recorded a couple grunts and groans for "getting hit" and imported them into the character as 4,0  4,1 and 4,2 since it seems the "4" slot is usually for these types of effects. However, I'm working through the CNS... and I can't seem to find where the "PlaySnd" for getting hit is. I opened up a few characters to see how they did it - they typically all have "4,0" and "4,1" but I can't find what's in the code to trigger it. Am I looking in the wrong place?

Also... second question!
Is there a way to get the game to choose a sound randomly? Say I have an intro, and the intro dialogue is keyed to sound 5,0. Can I create alternate dialogue at 5,1 or 5,2 and have the game pick randomly between those three sounds each time it plays the intro?'

Thanks for all your help!
Re: "Getting Hit" Sounds, and Picking a Sound at Random...
#2  November 17, 2020, 03:19:48 am
  • avatar
  • ***
  • Original characters are my forte.
    • http://network.mugenguild.com/bane84/
Hey all!

Creating a first time character through a MUGEN as a quarantine passtime and today's project is sounds. I've recorded a couple grunts and groans for "getting hit" and imported them into the character as 4,0  4,1 and 4,2 since it seems the "4" slot is usually for these types of effects. However, I'm working through the CNS... and I can't seem to find where the "PlaySnd" for getting hit is. I opened up a few characters to see how they did it - they typically all have "4,0" and "4,1" but I can't find what's in the code to trigger it. Am I looking in the wrong place?

Also... second question!
Is there a way to get the game to choose a sound randomly? Say I have an intro, and the intro dialogue is keyed to sound 5,0. Can I create alternate dialogue at 5,1 or 5,2 and have the game pick randomly between those three sounds each time it plays the intro?'

Thanks for all your help!
In the .CNS file there are two StateDefs.  One is -2, which is always running, and one is -3, which only runs when you're in your own states.  I did something like this for my character get hit sounds:
Code:
; Play a random get hit vocal.
[State -3, GetHitVocal]
type = PlaySnd
triggerall = Time = 1
triggerall = Random <= 500
triggerall = Alive
trigger1 = StateNo = 5000 ;Stand get hit.
trigger2 = StateNo = 5010 ;Crouch get hit.
trigger3 = StateNo = 5020 ;Air get hit.
trigger4 = StateNo = 5070 ;Tripped.
trigger5 = StateNo = 5080 ;Downed get hit.
value = 5000, Random%5
This will randomly trigger whenever my character enters one of the GetHit states.  I use group 5000 because it's where the start of the get hit state numbers begins (personal preference).

My code also answers your second question.  My character has 5 different get hit sounds in group 5000 (indexed 0-4) and one is chosen at random by using Random%5.  This is the modulus operator.  You might want to look into how it operates.
Re: "Getting Hit" Sounds, and Picking a Sound at Random...
#3  November 17, 2020, 08:59:57 pm
  • Hey it's me, Alex G!
    • Canada
Hey!
Thank you! I didn't know about the "Random" trigger, I'm definitely going to be modifying it for use in the intros. You've been a great help!

Also, it's Bane84! I got your PM, but unfortunately, I guess I'm not "famous" enough to be able to reply, haha. I've tried using the email button to reply to you earlier, not sure if it went through. Thank you for tracking me down! It definitely seems like we do similar type characters so far, so you've been a great resource.  ;D
Re: "Getting Hit" Sounds, and Picking a Sound at Random...
#4  November 17, 2020, 09:09:57 pm
  • avatar
  • ***
  • Original characters are my forte.
    • http://network.mugenguild.com/bane84/
Hello!  I sent a reply to your live.com e-mail address so take a look there. :)