YesNoOk
avatar

How should I implement Super Jumps, hops, and hyper Hops? (Read 1938 times)

Started by Slivern, April 15, 2017, 04:30:15 am
Share this topic:
How should I implement Super Jumps, hops, and hyper Hops?
#1  April 15, 2017, 04:30:15 am
  • **
  • WE ARE NESTS: THE NEW WORLD ORDER
    • USA
I've been following KoopaKoot's Interactive KoF character tutorial, but I haven't been able to find anything covering KoF's subsystems in detail.

I wanted to focus on Kyo '95's movement first, and I want to learn how to implement Hops, Hyperhops, and Super Jumps. I tried to understand how the code worked as seen in Ikaruga's Kyo, but it was rather complicated, as his CNS files lacked any form of documentation.

One of the things I tried doing first was using Statedef -2. I thought that I could try and cancel out the normal Jump sound and have MUGEN use the super jump sound. Instead however, it replaced the normal jump sound entirely. I did something similar again but with the common1.cns file. The code (likely) executed, but I got no result when testing it in M.U.G.E.N.

I don't know if I was supposed to learn this in detail first, but I noticed that Ikaruga used variables for his Kyo. I read Palette Jesus's variables tutorial, but it left me confused. Although he explained what types of what variables are and what they do, I was not able to understand what they can be used for. The only real example I got from that tutorial was when he covered using variables to turn characters evil during a match, which doesn't help me unless I'm working on Leona.

I'd like to understand in depth more how variables are implemented beyond Palette Jesus's tutorial in the case of KoF characters. What else should I also learn first before implementing Super Jumps, Hops, Hyper Hops, and other subsystems featured in The King of Fighters '98?

EDIT: One last thing! I forgot to mention this, but my Kyo '95 MUGEN character's run sound does not end its loop whenever I jump backwards while running, then standing still unless I walk forward or backwards. How do I resolve this?
Last Edit: April 15, 2017, 04:39:15 am by Slivern
Re: How should I implement Super Jumps, hops, and hyper Hops?
#2  April 15, 2017, 05:48:55 am
  • ****
  • Shame on you!
    • USA
Basically all a variable can do is be a value. YOU have to decide How to set that value, What it represents, and When to use it.
There's a ton of info Mugen knows from state to state, (life, power, whatever) and then there's a lot that it instantly forgets. Like if you used a certain move, say hit the opponent for a 15hit combo, jumped 3 times in a row. These are all seemingly stupid things to remember but someone could have a move that needs to keep track of this stuff.

A variable is just a way to record info Mugen doesnt record, and pass that info from state to state. So the "certain move" could be used for my Noob Siabot's disabler move where P2 can't block. If I use the move, then attack P2, it wouldn't be fair for me to be able to use the disabler again. P2 would be defenseless. I'd set up a variable to record when the disabler hits, and reset it to 0 once P2 can block again.

Think of it as like a jar you put a written note, and when you need to read the note, you look in the jar/var.

----
For the sound, look through the snd file for the actual sound. Use the ctrl+F search option to look for that value, say S20,0. See what activates it and try to make it so it doesn't activate when you dont want it to.
Last Edit: April 15, 2017, 05:52:03 am by Odb718
Re: How should I implement Super Jumps, hops, and hyper Hops?
#3  April 15, 2017, 06:52:59 am
  • **
  • WE ARE NESTS: THE NEW WORLD ORDER
    • USA
It's just a number then. Sounds useless in my situation.

Quote
For the sound, look through the snd file for the actual sound. Use the ctrl+F search option to look for that value, say S20,0. See what activates it and try to make it so it doesn't activate when you dont want it to.

I should have been more specific.

I already implemented code in the Statedef -2 as well as another Statedef in the common1.cns that stops the loop when he jumps forward while running, when he stops running, and when he crouches during the run. Which is really odd because the code I implemented should have worked when jumping backwards, but it doesn't.

I'm likely missing something. I'd ask someone else, but I find that all the KoF mugen creators speak a different language.
Last Edit: April 15, 2017, 07:02:00 am by Slivern
Re: How should I implement Super Jumps, hops, and hyper Hops?
#4  April 16, 2017, 06:02:11 am
  • ****
  • Shame on you!
    • USA
EDIT: One last thing! I forgot to mention this, but my Kyo '95 MUGEN character's run sound does not end its loop whenever I jump backwards while running, then standing still unless I walk forward or backwards. How do I resolve this?
When I read this, it sounds like you're running forward, jump backwards and let go of the controller, and you land into state 0/stand, and the sound continues to play until you walk forward or backwards.
What ever you use to stop the sound, just add statedef 0 and what ever else states you want to have stop it.
Re: How should I implement Super Jumps, hops, and hyper Hops?
#5  April 16, 2017, 11:42:25 pm
  • **
  • WE ARE NESTS: THE NEW WORLD ORDER
    • USA
EDIT: One last thing! I forgot to mention this, but my Kyo '95 MUGEN character's run sound does not end its loop whenever I jump backwards while running, then standing still unless I walk forward or backwards. How do I resolve this?
When I read this, it sounds like you're running forward, jump backwards and let go of the controller, and you land into state 0/stand, and the sound continues to play until you walk forward or backwards.
What ever you use to stop the sound, just add statedef 0 and what ever else states you want to have stop it.

Nice, solved the problem using Statedef -2. This pretty much leaves variables, hops, and super jumps as the only problem now.

For those who want the solution:
Code:
[State -2, Stop Running Loop]
type = StopSnd
trigger1 = stateno != 100
trigger1 = command = "holdfwd"
channel = 1

[State -2, Stop Running Loop, Jump Back]
type = StopSnd
trigger1 = stateno != 100
trigger1 = command = "holdup"
channel = 1

Pay attention to the second State -2. All I did was add a Statedef similar to the first one except for a different command. It also triggers the Statedef I use when stopping the run sound loop.

By the way, if you're reading this and you're making a KoF character, here's the code I use in the common1.cns with the Statedef -2 controllers:

Code:
;---------------------------------------------------------------------------
; Run forward
[Statedef 100]
type    = S
physics = S
anim = 100
sprpriority = 1

[State 100, PlaySnd]
type = PlaySnd
trigger1 = Time = 4
loop = 1
channel = 1
value = S100,0

[State 100, 1]
type = VelSet
trigger1 = AnimElemtime(2) >= 0
x = const(velocity.run.fwd.x)

[State 100, 2] ;Prevent run from canceling into walk
type = AssertSpecial
trigger1 = 1
flag = NoWalk

[State 100, 3] ;Prevent from turning
type = AssertSpecial
trigger1 = 1
flag = NoAutoTurn

[State 100, 4]
type = ChangeState
trigger1 = command != "holdfwd"
value = 101

;---------------------------------------------------------------------------
; Run forward stop
[Statedef 101]
type     = S
physics  = S
ctrl     = 0
velset   = 0,0
anim     = 101
sprpriority = 1

[State 101, StopSnd]
type = StopSnd
trigger1 = Time = 0
channel = 1

[State 101, 1]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1
Last Edit: April 17, 2017, 12:29:03 am by Slivern
Re: How should I implement Super Jumps, hops, and hyper Hops?
#6  April 17, 2017, 05:29:01 am
  • ****
  • Shame on you!
    • USA
You can reduce your statedef -2 stuff

    [State -2, Stop Running Loop]
    type = StopSnd
    triggerall = stateno != 100
    trigger1 = (command = "holdfwd") ||  (command = "holdup")
    channel = 1

But this will stop ANY sound playing on channel 1. So you may just want to use

    [State -2, Stop Running Loop]
    type = StopSnd
    trigger1 = prevstateno = 100
    channel = 1
Re: How should I implement Super Jumps, hops, and hyper Hops?
#7  April 17, 2017, 09:06:29 am
  • **
  • WE ARE NESTS: THE NEW WORLD ORDER
    • USA
Would it be possible for me to use Statedef -2 for the Super Jump sound as well? What I mean is when Kyo runs, then jumps forward, it triggers his Super Jump like in KoF '98. I want to have the CNS trigger that sound instead of the normal Jump sound so I can then work on implementing the AfterImage effects and modify the velocity.
Re: How should I implement Super Jumps, hops, and hyper Hops?
#8  April 18, 2017, 06:07:26 am
  • ****
  • Shame on you!
    • USA
If you're making 2 "launch" states for your jumps you should be able to just apply the sounds in those states.
If you're using 1 state, what is it? State 40/41, you should be using a variable or some other system to know what type of jump it is.

I personally would use the 1 launch state, and use a
prevstateno = 100
or whatever your run stateno is. I'd use the Prevstateno one time to set something I could check through out the state(s) like a var or an explod.
I dont know if I'd rely on statedef -2 for much for my jumps, besides the landing sounds and possibly dust.
Re: How should I implement Super Jumps, hops, and hyper Hops?
#9  April 21, 2017, 01:13:23 am
  • **
  • WE ARE NESTS: THE NEW WORLD ORDER
    • USA
I'm never used prevstateno before. I saw in either KoopaKoot or Ikaruga's code that they used this for the jump sounds, but I'm having trouble following you. Should I be using a ChangeAnim or ChangeState controller?
Re: How should I implement Super Jumps, hops, and hyper Hops?
#10  April 21, 2017, 10:15:46 am
  • ****
  • Shame on you!
    • USA
Are you using multiple animations for the different jumps? I dont think you should make multiple states for the jumps. It may end up causing weird problems down the line with other enemies. I'd say set the variable, change the animation, and adjust the velocities and sounds depending on which way is activated.
You may want to plan everything out based around the variable's value. Like use a 1,2,3 or a 10,20,30, or what ever scale you want. Then you'd set up your playsnd to use that value to switch between the normal and special jump sounds. You'd use the same value to adjust the velocities and animation. I'd say figure out your velocities you want, then work backwards to make the variable's values.
Suppose your two velocities are 4.3 and 7.2. You variable value could be 29. You'd do var(718)/10.0 to get 2.9 to add to 4.3. Then your playsnd could be S187,Var(718) where the two sounds would be 187,0 and 187,29.
If that's too much for you, you'll just set the variable and only allow 1 playsnd to work when the value = 1 or whatever you decide. ^^^That's just a way to compact the code.
You'd basically make 2 different states, then set the first one to respond only to var = 1 and the second one respond to var = 2. Then you shove the 2 together to make it 1 state.
Sorry if I'm incoherent; It's 4am and I need sleep. I'll try to take a look at this thread again tomorrow and see if I can make things a little more clear.

To cancel the sound of the run, you might want to just add stopsnd with the prevstateno trigger into statedef 40.