YesNoOk
avatar

Throw Problem, p2 don't fall (Read 280 times)

Started by Herniebal, March 05, 2019, 11:42:17 pm
Share this topic:
Throw Problem, p2 don't fall
#1  March 05, 2019, 11:42:17 pm
  • avatar
    • Argentina
Hi

i'm trying to make a throw animation and i use the throw creator

when i grab the oponnet, the animation is fine, but when it ends, the p2 don't fall. the p2 is standing in the air :S




Code:
[Statedef 800]
type    = S
movetype= A
physics = S
juggle  = 0
velset = 0,0
ctrl = 0
anim = 800

; Notes: The '-' symbol in the hitflag field means that it only affects
;   players who are not in a hit state. This prevents the player from combo-ing
;   into the throw. The priority should be set to a low number, such as
;   1 or 2, so that the throw does not take precedence over normal attacks.
;   The type of priority must always be set to "Miss" or "Dodge" for throws,
;   otherwise strange behavior can result.
[State 800, 1]
type = HitDef
Trigger1 = Time = 0
attr = S, NT          ;Attributes: Standing, Normal Throw
hitflag = M-          ;Affect only ground people who are not being hit
priority = 1, Miss    ;Throw has low priority, must be miss or dodge type.
sparkno = -1          ;No spark
sprpriority = 1       ;Draw in front of p2
p1facing = ifelse (command = "holdfwd", -1, 1) ;Turn if holding forwards
p2facing = 1          ;Force p2 to face player
p1stateno = 810       ;On success, player changes to state 810
p2stateno = 820       ;If hit, p2 changes to state 820 in player's cns
fall = 1              ;Force p2 into falling down

[State 800, 2]
type = ChangeState
Trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Throwing the opponent
; Description: In this state, the player throws the opponent by binding him to
;     various offsets based on his current frame of animation. For
;     example, [State 810, Bind 1] binds the opponent to an offset of
;     28 pixels in front of the player. That puts him around where the hand
;     is at. Is is important to keep the opponent bound using a
;     TargetBind controller at all times, until you let him go. This
;     is especially important if your player has a Clsn2 box that
;     allows him to get hit while throwing someone. Each time a player
;     gets hit, all his bound targets will be set to a fall state. If
;     the opponent is not bound, then he might get stuck in his thrown
;     state when his attacker is knocked out of the throw halfway.
; Notes: There is a TargetLifeAdd controller to decrease the opponent's
;     life, and a TargetState controller to change his state to a
;     falling state when KFM lets go of him.
[Statedef 810]
type = S
movetype= A
physics = N
anim = 810
poweradd = 60

[State 810, Bind 1]
type = TargetBind
trigger1 = AnimElem = 1
pos = 37, -15.333333333333

[State 810, Bind 2]
type = TargetBind
trigger1 = AnimElem = 2
pos = 23, -54.666666666667

[State 810, Bind 3]
type = TargetBind
trigger1 = AnimElem = 3
pos = -29, -40.666666666667

[State 810, Bind 4]
type = TargetBind
trigger1 = AnimElem = 4
pos = -131.66666666667, -72

[State 810, Hurt]
type = TargetLifeAdd
trigger1 = AnimElem = 4
value = -78

[State 810, Throw]
type = TargetState
trigger1 = AnimElem = 4
value = 21

[State 810, State End]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1


;---------------------------------------------------------------------------
; Opponent Thrown
; (a custom gethit state)
; Description: This is the state that the opponent changes to after being
;     hit by the throw HitDef. The important thing here is to use a
;     ChangeAnim2 controller. The difference between ChangeAnim2 and
;     ChangeAnim is that ChangeAnim2 changes the player's animation to
;     an action in the AIR file of the attacker (in this case, kfm.air),
;     whereas ChangeAnim always changes the player to an action in his
;     own AIR file. Look at Action 820 in kfm.air for some extra
;     comments.
[Statedef 820]
type    = A
movetype= H
physics = N
velset = 0,0

[State 820, 1]
type = ChangeAnim2
Trigger1 = Time = 0
value = 820

;---------------------------------------------------------------------------
; Opponent thrown into the air
; (a custom gethit state)
; Description: This state has the opponent flying through the air and
;     falling down onto the ground. The SelfState controller sets the
;     opponent back using to his own state file when he his the ground.
;     Controllers 821,2 and 821,3 allow the opponent to recover by
;     hitting his recovery command when he is falling.

[Statedef 821]
type = A
movetype = H
physics = N
velset = 14,5
poweradd = 40

[State 821, 1] ;Gravity
type = VelAdd
trigger1 = 1
y = .4

[State 821, 2] ; Recover near ground (use ChangeState)
type = ChangeState
triggerall = Vel Y > 0
triggerall = Pos Y >= -20
triggerall = alive
triggerall = CanRecover
trigger1 = Command = "recovery"
value = 5200 ;HITFALL_RECOVER

[State 821, 3] ; Recover in mid air (use SelfState)
type = SelfState
triggerall = Vel Y > 0
triggerall = alive
triggerall = CanRecover
trigger1 = Command = "recovery"
value = 5210 ;HITFALL_AIRRECOVER

[State 821, 4] ;Hit ground
type = SelfState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 5100 ;Hit ground


I don't know where's is the problem :C

Help?
Re: Throw Problem, p2 don't fall
#2  March 06, 2019, 02:47:27 am
  • avatar
    • Argentina
i replace all the states, one by one with the kungfu man, and it seems that the problem is in state 810. but i don't know where

TiE

Re: Throw Problem, p2 don't fall
#3  March 06, 2019, 03:23:44 pm
  • **
  • used the search button
    • Germany
The only valid change I could see (noob here) right now is, what Dark Bowser said in another help thread.

[State 800, 1]
type = HitDef
trigger1 = Time = 0
attr = S, NT
hitflag = M
priority = 1, Miss
sparkno = -1
p1sprpriority = 1
p1facing = 1
p2facing = 1
p1stateno = 810
p2stateno = 820 <-- delete this line
fall = 1

And since your character is going to state 810 when the throw connect, go to state 810 and add this:

[State 810, Throw]
type = TargetState
trigger1 = !Time && NumTarget
value = 820

If you click on DeathScythe's name above this quote, you reach the other thread. Maybe there is some additional info helping you with this.
Especially the posts from Odb718, too.

Eventually this is just missing sprites for the SelfState trigger?
[BGdef]
 ;Filename of sprite data
spr = stages/ ***.sff
Re: Throw Problem, p2 don't fall
#4  March 06, 2019, 06:42:16 pm
  • avatar
  • **

  • Online
it's gotta be something with the animation/sprites man, maybe timing of the code is off with what you have.
Re: Throw Problem, p2 don't fall
#5  March 06, 2019, 09:43:00 pm
  • ******
  • B. is for Basara, of course
  • For 16 years, the one and only Basara-kun!!
    • Chile
    • network.mugenguild.com/basara/
Found the problem:
Code:
[State 810, Throw]
type = TargetState
trigger1 = AnimElem = 4
value = 21
I shouldn't be 821??