News:

MFG's Character of the Month: October 2026 Nominations

Main Menu

Jumping after an attack

Started by Noctis, April 16, 2012, 04:45:14 AM

Previous topic - Next topic

Noctis

I'm just having an really off day.
How do I make it so I can jump after any attack, but not have an infinite jump?
Right now, my problem is this... I have a changestate to jump after my attack hits and a trigger1 = prevstateno != 50 (to prevent a triple jump). So it's jump, jump, attack OR jump attack jump attack.
But when I jump, attack, jump, attack attack, I can jump again because my prevstateno wasn't 50, it was something else. So, basically, what should I do?
I already tried vars, but for some reason, they completely failed.


Edit:
I'm trying vars again. Whenever I hit state 40 or 45 (jump and aerial jump) 15 gets +1 to it's var. So two jumps is var(15) = 2. Is there a way to prevent my character from going into state 40 and 45 as long as var(15) is = to 2? Because I surprisingly don't know of any...

Edit 2:
Okay, with the vars it seems like everything is working, but if I jump, attack, then jump, and attack again, I can jump again when that attack state ends.
It's like the jump changestate in my attack is ignoring whatever the system does to prevent the second aerial jump. Like it's a custom jump state (Selfstate change anything).

(Youtube) (WIP) (Mediafire) (New Anime Shop) My Manga Reviews! Personal favorite Patreon! Check her out!

"There is nothing either good or bad, but thinking makes it so."

Rajaa Retired

We have no idea of what you're talking about because we can't see the code.

I'd suggest that you make the variable reset only when you're not in the air, though.

Cyanide

You re-enter state 50 with control = second jump.

Turn off air jump, code it yourself. Ie airjumps = 0

type = changestate
trigger1 = ctrl && command = "up"
trigger1 = statetype = A
value = 45

Then you'll get airjump, but it's under your control rather than the hardcoded version.


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.

Noctis

I thought I actually explained it good enough this time....next time I'll be even more thorough!

Anyways, thanks Cyanide. I got it working. I had actually already tried that, but I was doing it wrong. I was making new states instead of just a command. ::)

(Youtube) (WIP) (Mediafire) (New Anime Shop) My Manga Reviews! Personal favorite Patreon! Check her out!

"There is nothing either good or bad, but thinking makes it so."