;Jump Strong Punch
; CNS difficulty: easy
[Statedef 610]
type = A
movetype= A
physics = A
juggle = 0
poweradd= 30
ctrl = 0
anim = 610
sprpriority = 2
[State 610, 2]
type = PlaySnd
trigger1 = Time = 2
value = 0, 1
[State 610, 3]
type = HitDef
trigger1 = Time = 0
attr = A, NA
getpower = 15
damage = 23
animtype = light
guardflag = HA
hitflag = MAFD
priority = 3
pausetime = 8,8
guard.pausetime = 17,20
hitsound = S8,2
guardsound = S9,1
ground.type = high
ground.slidetime = 0
guard.slidetime = 9
ground.hittime = 15
ground.velocity = -2,22
airguard.velocity = -1,-.8
air.type = high
air.velocity = -2, 22
air.hittime = 2
fall = 1
fall.yvelocity = -9
down.bounce = 9
p2facing =1
I've actually struggled with this while working on my very first character. I ultimately learned that down.bounce is the target are still in their liedown statedef (i.e.: their statetype is L). This means you can't hit them even while they down.bounce unless your hitflag has D in it. Meaning that at least the strong punch you posted above will connect, but anything else with no D in their hitflag will not. If you want to actually create a true groundbounce state, it has to put P2 in a custom state so that they'll be in statetype A instead of L.
TargetState.
[State 610, TargetState]
type = TargetState
triggerall = NumTarget
trigger1 = !Time
value = 611
Something like that. What it does is you can control how P2 reacts uppon being hit. But you have to create the whole state for it. Look for grabs/throws, they are good examples of custom states.
I had to read your post like 10 times to finally understand what you mean lol
But yeah, basically that.
In your attack state (it says jumping strong punch, so let's use this), you will add a targetstate, right after the hitdef. The value is the custom state, in my post I used 611. Then, you will create statedef 611, which will be used by P2. As soon as the hit connects, P2 will be sent to YOUR state 611 instead of a normal hit state.
You can take a look at one of KFM's custom state:Spoiler, click to toggle visibilty
Notice how it useses movetype = H, indicating the player is being hit, and type = A and not L. In the very end, it uses selfstate to send P2 to it's own gethit states.
Hope it gets a bit easier to understand.
You're not going to use SelfState right away. You can use whatever you want, maybe some VelSet, maybe some EnvShake, and only at the end you'll use SelfState.
The SelfState will send P2 back to his own GetHit states instead of yours. It's like a ChangeState when you end a move (where you go back to state 0 for example), but used in custom states.
[Statedef 50000, hit by slam]
type = A
movetype= H
physics = N
[State 50000, 4] ;Hit ground
type = SelfState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 5100 ;Hit ground
I like to use values around the states the special move is in, for the hit reaction. I think that's why 611 was suggested. BUT 611 may mess with some AI. It might think it's doing an air attack.
Also, your particular selfstate probably wont look the best if it goes back to statedef 0. You're going to want the laying down state. 5200?? I cant remember at this moment. Just use Debug, ctrl+d, and trip P2 or get it in the state you want it to switch to. Then use that value.
Okay, I have one last question which will probably lead me to figuring this out. First of all, I don't know if any of you have answered this and I forgot, but In my Statedef with the Self State, what State Controller would I use to have the opponents statetype change? StateTypeSet doesn't seem to work, and also, what Trigger would I use in that State Controller so that when my hitdef makes contact with the opponent, they change to StateType A and Not L. I have the SelfState down, I just need to know this because with that I can have my opponent change to statetype A and not L, which will hopefully result in me being able to continue a combo. Hopefully my writing isn't too confusing.
[StateDef 611] ; getting hit by JSP
type = A
physics = N
movetype = H
ctrl = 0
velSet = 3, 3
sprPriority = 2
anim = 611
[State 611, VelAdd] ; gravity
type = VelAdd
Trigger1 = 1
y = 0.5
[State 611, EnvShake]
type = EnvShake
trigger1 = vel y > 0 && pos y >= 0
time = 14
ampl = 4
freq = 120
[State 611, End]
type = ChangeState
trigger1 = vel y > 0 && pos y >= 0
value = 612 ; bouncing
;--------------------
[StateDef 612] ; bouncing
type = A
physics = N
movetype = H
ctrl = 0
velSet = 2, -7
sprPriority = 2
anim = 612
[State 612, VelAdd] ; gravity
type = VelAdd
Trigger1 = 1
y = 0.5
[State 612, End]
type = SelfState
trigger1 = vel y > 0 && pos y >= 0
value = 5100