The Mugen Fighters Guild

Help => M.U.G.E.N Development Help => Topic started by: Drewism19 on February 14, 2021, 10:43:12 PM

Title: How would I go about assigning sounds to walking and running anims for running?
Post by: Drewism19 on February 14, 2021, 10:43:12 PM
So I've been trying to assign some footstep sounds to my character in FF3 and I just can't figure it out! I've even looked at other character files that include footsteps and they don't have a statedef for the walking animation, so how would you assign sounds to your running and walking? I've tried making a statedef for it but then I just can't walk when assigning the sound.
Title: Re: How would I go about assigning sounds to walking and running anims for running?
Post by: Drewism19 on February 14, 2021, 10:50:04 PM
Okay, so far I've figured out the forward walk, but now when I move backwards, I move forwards instead! I tried coding the backwards walk with a negative VelSet but it's still not seeming to work, is there something that is needed in the Commands? If so where would I find the fix?
Title: Re: How would I go about assigning sounds to walking and running anims for running?
Post by: Bannana on February 14, 2021, 11:11:48 PM
When you're working with the basic states like standing, walking, running, jumping, you're either using the core common1.cns found in the data folder of your mugen, or you're overriding it in your character's cns (what you've done by adding in your own state 20).

here's what's in the common for state 20
Code:
; Walk
[Statedef 20]
type    = S
physics = S
sprpriority = 0

[State 20, 1]
type = VelSet
trigger1 = command = "holdfwd"
x = const(velocity.walk.fwd.x)

[State 20, 2]
type = VelSet
trigger1 = command = "holdback"
x = const(velocity.walk.back.x)

[State 20, 3]
type = ChangeAnim
triggerall = vel x > 0
trigger1 = Anim != 20 && Anim != 5
trigger2 = Anim = 5 && AnimTime = 0
value = 20

[State 20, 4]
type = ChangeAnim
triggerall = vel x < 0
trigger1 = Anim != 21 && Anim != 5
trigger2 = Anim = 5 && AnimTime = 0
value = 21

The common will generally use those constants that you've defined in the character's main cns, so in this case, "walk.fwd" and "walk.back".

When you have some time, open up the common and check out what they do for all the states, it's helpful to see how they code everything so you know how to interact with it, or see if you need to override it for something specific.  At some point what some creators end up doing is copying that common and placing it into the character folder so they can edit it to have a common that's custom for that character.
Title: Re: How would I go about assigning sounds to walking and running anims for running?
Post by: Drewism19 on February 15, 2021, 12:14:59 AM
When you're working with the basic states like standing, walking, running, jumping, you're either using the core common1.cns found in the data folder of your mugen, or you're overriding it in your character's cns (what you've done by adding in your own state 20).

here's what's in the common for state 20
Code:
; Walk
[Statedef 20]
type    = S
physics = S
sprpriority = 0

[State 20, 1]
type = VelSet
trigger1 = command = "holdfwd"
x = const(velocity.walk.fwd.x)

[State 20, 2]
type = VelSet
trigger1 = command = "holdback"
x = const(velocity.walk.back.x)

[State 20, 3]
type = ChangeAnim
triggerall = vel x > 0
trigger1 = Anim != 20 && Anim != 5
trigger2 = Anim = 5 && AnimTime = 0
value = 20

[State 20, 4]
type = ChangeAnim
triggerall = vel x < 0
trigger1 = Anim != 21 && Anim != 5
trigger2 = Anim = 5 && AnimTime = 0
value = 21

The common will generally use those constants that you've defined in the character's main cns, so in this case, "walk.fwd" and "walk.back".

When you have some time, open up the common and check out what they do for all the states, it's helpful to see how they code everything so you know how to interact with it, or see if you need to override it for something specific.  At some point what some creators end up doing is copying that common and placing it into the character folder so they can edit it to have a common that's custom for that character.

Thanks a lot, that really helps