YesNoOk
avatar

Custom hitstun problem (Read 747 times)

Started by Ryanide, July 31, 2008, 03:52:14 am
Share this topic:
Custom hitstun problem
#1  July 31, 2008, 03:52:14 am
  • ***
  • It's not furry you goons, it's anthro! ANTHRO!
This is something that should be simple for me to fix, but I just can't seem to get it to work the way I want it to.

My character has a new move that hits 4 times and then puts the opponent into a custom "shake" animation on hit 4. They then change to a normal hit state and slide back a bit before resuming their neutral state.

The problem is, I can't seem to get it to ignore airborn opponents. If this move hits and opponent who's in the air, it will cause them to walk on the air until they jump or get knocked down.

[mcode];fourth hit
[State 223, 5]
type = HitDef
trigger1 = AnimElem = 8
attr = S, NA
damage = 8, 2
animtype = light
guardflag = MA
hitflag = MAF
priority = 3, Hit
pausetime = 7, 1
sparkno = 0
sparkxy = -10, -76
hitsound = s4, 8
guardsound = 6, 0
ground.type = High
ground.slidetime = 5
ground.hittime  = 1
ground.velocity = -5, 0
airguard.velocity = -1.9,-.8
air.type = High
air.hittime = 10
getpower = 20,10
p2statetype = 224

[State 223, statetypeset]
type = StateTypeSet
trigger1 = AnimElem = 9
movetype = I

[State 223, end]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;Player 2 hitshake

[Statedef 224]
type = A
movetype= H
physics = S
velset = 0,0
ctrl = 0
anim = 224

[State 224, 2]
type = ChangeAnim
trigger1 = Time = 15
value = 5010
ctrl = 0

[State 0, VelAdd]
type = VelAdd
trigger1 = Time = 15
x = -3
y = 0
ignorehitpause = 1
persistent = 1


[State 224, end]
type = Selfstate
trigger1 = Time = 25
value = 0
ctrl = 1[/mcode]

I've tried playing the anim within the state under a trigger, but if I do it that way, the character just pauses, they don't actually shake.

224 is the custom hit state. It's just a 2 frame loop of the character's mid hit shaking back and forth.

Mod edit: mcode tags, code seems to break for IE.
A magical force-field surrounding a brick in an iron vault...even if the security is breached, the thieves are bound to be disappointed.
Last Edit: July 31, 2008, 04:58:58 am by Cyanide
Re: Custom hitstun problem
#2  July 31, 2008, 04:53:14 am
  • ******
  • I hang out tough. I'm a real boss.
    • USA
    • litotichues.com/
if it's putting the opponent into a custom state make sure the custom state has statetype=A when the opponent i in the air

for example you could use stand when they enter the state, but the stateypeset sctrl would be triggered by say, when enemynear, pos <0
so when they are hit in the air it registers as an air hitstate.
Re: Custom hitstun problem
#3  July 31, 2008, 05:21:53 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
No custom state and pausetime = 1,25

won't work?

Otherwise in the changestate.

value = ifelse(pos Y!= 0, 50,0)


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: Custom hitstun problem
#4  July 31, 2008, 08:10:34 am
  • ***
  • It's not furry you goons, it's anthro! ANTHRO!
No custom state and pausetime = 1,25

won't work?

Otherwise in the changestate.

value = ifelse(pos Y!= 0, 50,0)

This works nicely, but it makes it look quite weird when it hits an airborn opponent. They take 4 hits from this move, do a "standing" stun animation in the air and then drop like a rock.

The reason I didn't want to use a 1, 24 stun time is because Mugen's default hitpause doesn't give the sort of effect I was looking for. The opponent doesn't "shake" back and forth.

What I really want is for this move to do the dramatic pause when it hits opponents who are grounded, but to just knock them away normally when they're in the air.

Is there any way for me to get the opponent into state 244 ONLY when they're on the ground?

Edit: actually, I would really like for this move to send an airborn opponent SPINNING. Like a wall bounce from Eternal Fighter Zero. What kind of velset do I need to use in order to make the opponent spin like a pinwheel?
A magical force-field surrounding a brick in an iron vault...even if the security is breached, the thieves are bound to be disappointed.
Re: Custom hitstun problem
#5  July 31, 2008, 08:18:36 am
  • ******
  • I hang out tough. I'm a real boss.
    • USA
    • litotichues.com/
To get the opponent spinning you would change the animtype in the hitdef to "diagup" also add a fall to the hitdef for it to look correctly.
Re: Custom hitstun problem
#6  July 31, 2008, 08:26:46 am
  • ***
  • It's not furry you goons, it's anthro! ANTHRO!
A magical force-field surrounding a brick in an iron vault...even if the security is breached, the thieves are bound to be disappointed.
Re: Custom hitstun problem
#7  July 31, 2008, 08:36:34 am
  • ******
  • I hang out tough. I'm a real boss.
    • USA
    • litotichues.com/
i that case... you'll definitely need a customstate

-you need an custom state animations to where the opponent is knocked into the wall

-you know how to add a custom state flag to the  hitdef.

-the custom state you activate should have a velset at an appropriate speed towards the wall

-you need a change state trigger saying when target,backedgbodydist<=0, to change to a state where they bounce of the wall

-in the new state you well set more velocity sctrls bringing the opponent up then using gravity  or veladd to bring the opponent to the ground

-also for this new state you want to make an animation, that shows the opponent spinning so you need to use the Horizontal and vertical rotations for the sprites in the animations portraying spinning.the required sprites i would use for this would be between 5030's/5060's

-then for them to hit the ground you use a self state, triggering with pos y>=0&&vel y>0

Also for a basic hitwall code you coul look at

Dshiznetz/alejandro's Lucario he has a pretty basic one, it's in the release thread somewhere.
Last Edit: July 31, 2008, 08:43:43 am by RajaaBoy
Re: Custom hitstun problem
#8  July 31, 2008, 08:50:13 am
  • ***
  • It's not furry you goons, it's anthro! ANTHRO!
Thanks. I only want the spin. It's not a wall bounce. When this attack hits an airborn opponent, I want them to go into a spin.

Is there also a way to set the opponent to default physics after they come out of custom state 224?
A magical force-field surrounding a brick in an iron vault...even if the security is breached, the thieves are bound to be disappointed.
Re: Custom hitstun problem
#9  July 31, 2008, 08:57:18 am
  • ******
  • I hang out tough. I'm a real boss.
    • USA
    • litotichues.com/
Thanks. I only want the spin. It's not a wall bounce. When this attack hits an airborn opponent, I want them to go into a spin.

Is there also a way to set the opponent to default physics after they come out of custom state 224?

just use the gravity sctrl

Cheers,Rajaboy :)
Re: Custom hitstun problem
#10  July 31, 2008, 09:27:24 am
  • ***
  • It's not furry you goons, it's anthro! ANTHRO!
I'm still having a hard time getting this attack to behave the way I want it.

And I still don't know how to make that "spin" lol. I think I'll just download a character who has this in their moveset and see how it's done.
A magical force-field surrounding a brick in an iron vault...even if the security is breached, the thieves are bound to be disappointed.
Re: Custom hitstun problem
#11  July 31, 2008, 09:38:14 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
Gonna go through each problem and define how to do it each time.

Getting p2 to not recieve the custom state if hit in the air
p2getp1stateno = ifelse(enemynear(0), statetype = A, 0,1)

I'd use target, but that would bug out if only the 4th hit made contact.

Making p2 spin but only if hit in midair (you wanna make things complex don't you)
remove previous line given and the p2stateno bit, lets do the easy method. ID that hitdef
ID = 223

Now, set this up
type = targetstate
trigger1 = numtarget(223) > 0
trigger1 = target(223), statetype = A
value = spinning state

type = targetstate
trigger1 = numtarget(223) > 0
trigger1 = target(223), statetype != A
value = normal shake

As for making p2 spin, well if they HAVE the diagup hitanims, check for those, that's a spin generally. in the customstate
type = changeanim
trigger1 = time = 0 && selfanimexist(5061)
value = 5061

Otherwise you'll have to... invent it using required sprites. Now depends on what sorta spin you want, if you want them spinning around themself, difficult. If you're after a more generic and slightly crappier spin use something like sprite 5031, 20 then use angledraw and angleadd in the custom state to make them spin around their axis.

When pos Y>= 0 you put them in selfstate 5100 so they bounce.

Default physics? Explain please.


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: Custom hitstun problem
#12  July 31, 2008, 10:22:19 am
  • ***
  • It's not furry you goons, it's anthro! ANTHRO!
Once again, thanks for your help cyanide, but I worked it out on my own.

The attack behaves fine now. I figured out how to create a spinning state using a combination of Angledraw and gravity.
A magical force-field surrounding a brick in an iron vault...even if the security is breached, the thieves are bound to be disappointed.