YesNoOk
avatar

Turn KFM's back hop into a dash (Read 876 times)

Started by -AngelZX, August 13, 2020, 07:41:03 am
Share this topic:
Turn KFM's back hop into a dash
#1  August 13, 2020, 07:41:03 am
  • **
  • I try to do palettes.
    • Venezuela
So, uh, this is dumb, but as the title says, I basically want to change KFM's back hop into a normal dash that stays on the ground.

I've been able to figure out most of the coding problems I've had, but I really don't know what to do here.
Re: Turn KFM's back hop into a dash
#2  August 13, 2020, 07:51:59 am
  • ****
  • Self-Sufficient Subhuman
  • "I hope you're ready for a beating!"
    • USA
So, uh, this is dumb, but as the title says, I basically want to change KFM's back hop into a normal dash that stays on the ground.

I've been able to figure out most of the coding problems I've had, but I really don't know what to do here.

Forgive me if my advice here is pretty bad -- I'm more of a visual guy than a "lemme explain it" kinda guy.

First, I'd assume you'd either want to copy the running animations but reverse them, or have a line of code to flip the sprites of the regular animation. Then, simply copy the forward run code, but replace any of the "run.fwd" data with the "run.back" data. For the best effect, make sure both velocity values are the same.

This is probably a pretty crud explanation but I'd probably be able to just do it for you ahah. I work way better hands on or visually. But I hope this kind of helps!

GT

Re: Turn KFM's back hop into a dash
#3  August 13, 2020, 08:06:57 am
  • *****
    • USA
    • Skype - gt_ruby
This is the backdash state from the common1.cns (Used by characters such as KFM that do not have their own common1, but instead refer to the common1 in the data folder). You can create your own state 105 within KFM's .cns file.

Code:
; Hop backwards
[Statedef 105]
type    = A
physics = A
ctrl = 0
anim = 105
sprpriority = 1

[State 105, 1]
type = VelSet
trigger1 = Time = 0
x = const(velocity.run.back.x)
y = const(velocity.run.back.y)

[State 105, 2]
type = CtrlSet
trigger1 = Time = 2
value = 1

[State 105, 3]
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 106



The type and physics will need to be changed to S or C (Standing or crouching since we are no longer going to be entering the air).
 
Code:
; Hop backwards
[Statedef 105]
type    = S
physics = S
ctrl = 0
anim = 105
sprpriority = 1


Code:
[State 105, 1]
type = VelSet
trigger1 = Time = 0
x = const(velocity.run.back.x)
y = const(velocity.run.back.y)

In order to remove the hopping behavior, you'll need to remove the y value here completely or set it to 0 to prevent KFM from going into the air.


Code:
[State 105, 1]
type = VelSet
trigger1 = Time = 0
x = const(velocity.run.back.x)
y = 0

Since we've removed the jumping behavior, you'll also need to adjust the triggers for the changestate to activate when the backdash is over (It would be best to change the animation for KFM's backdash as well (animation 105 in the air file) since it will no longer function as a hop and to match its new function (appearance-wise)).

Code:
[State 105, 3]
type = ChangeState
trigger1 = !Animtime
value = 0


We've adjusted the trigger here. When the animation has completed, the changestate will send us back to our standing state (0). You can adjust the x velocity of the backdash in the velocity section at the top of the .cns file by locating the velocity.run.back.x value.
Yeah Titiln, in fact, You Made Him
Re: Turn KFM's back hop into a dash
#4  August 13, 2020, 08:49:24 am
  • **
  • I try to do palettes.
    • Venezuela
This is perfect, thank you so much. But now, the backdash state is cancelled whenever I press any button. For example, if I hold back, I start walking after just a single frame of the backdash animation.
Re: Turn KFM's back hop into a dash
#5  August 13, 2020, 10:51:24 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
Have a look in state 100. There is an assertspecial there for nowalk. Add this to your run back state. Change the trigger to holdback if needed.


In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.
Re: Turn KFM's back hop into a dash
#6  August 13, 2020, 07:27:24 pm
  • **
  • I try to do palettes.
    • Venezuela
Thanks everyone! Everything's working fine now.