helper throw

Started by sgn15, July 31, 2011, 03:11:20 PM

Previous topic - Next topic

sgn15

i have a helper that does a throw. my problem is the 2 changestates (for successful hit and if dodged/guarded). when it hits, the helper is stuck at 411 still (it should go to 412)

and i havent tested the situation if its guarded/dodged. so is the changestate trigger for this also correct?

both changestates are in bold

Spoiler (click to show)
;---------------------------------------------------------------------------
; "grabbing" helper
[Statedef 411]
type    = S
movetype= A
physics = N
juggle  = 5
poweradd= 0
ctrl = 0
anim = 411
sprpriority = 2

;[State 0, AssertSpecial]
;type = AssertSpecial
;trigger1 = 1
;flag = unguardable

[State 0, 1]
type = HitDef
Trigger1 = animelem = 4
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 = 423       ;If hit, p2 changes to state 820 in player's cns
fall = 1              ;Force p2 into falling down

; when successfully hit
[State 0, 5]
type = ChangeState
trigger1 = animtime = 0 && movehit = 1
value = 412
;ctrl = 1

;when guarded/not hit
[State 0, 5]
type = ChangeState
trigger1 = animtime = 0 && !movehit
value = 413
;ctrl = 1


;---------------------------------------------------------------------------
; helper successful hit
[Statedef 412]
type    = S
movetype= A
physics = N
anim = 412
poweradd = 0

[State 0, TargetLifeAdd]
type = TargetLifeAdd
trigger1 = animelem = 4
value = -10

[State 0, TargetLifeAdd]
type = TargetLifeAdd
trigger1 = animelem = 8
value = -10

[State 0, TargetLifeAdd]
type = TargetLifeAdd
trigger1 = animelem = 12
value = -10

[State 0, TargetLifeAdd]
type = TargetLifeAdd
trigger1 = animelem = 16
value = -10

[State 0, TargetLifeAdd]
type = TargetLifeAdd
trigger1 = animelem = 20
value = -10

[State 0, TargetLifeAdd]
type = TargetLifeAdd
trigger1 = animelem = 24
value = -10

[State 0, TargetLifeAdd]
type = TargetLifeAdd
trigger1 = animelem = 28
value = -10

[State 0, TargetLifeAdd]
type = TargetLifeAdd
trigger1 = animelem = 32
value = -10

[State 0, TargetLifeAdd]
type = TargetLifeAdd
trigger1 = animelem = 36
value = -10

[State 0, TargetLifeAdd]
type = TargetLifeAdd
trigger1 = animelem = 40
value = -10

[State 0, TargetLifeAdd]
type = TargetLifeAdd
trigger1 = animelem = 44
value = -10

[State 0, TargetLifeAdd]
type = TargetLifeAdd
trigger1 = animelem = 48
value = -10

[State 0, TargetLifeAdd]
type = TargetLifeAdd
trigger1 = animelem = 52
value = -10

[State 0, TargetLifeAdd]
type = TargetLifeAdd
trigger1 = animelem = 56
value = -10

[State 0, TargetLifeAdd]
type = TargetLifeAdd
trigger1 = animelem = 60
value = -10

[State 0, TargetLifeAdd]
type = TargetLifeAdd
trigger1 = animelem = 64
value = -10

[State 0, TargetLifeAdd]
type = TargetLifeAdd
trigger1 = animelem = 68
value = -10


[State 0, TargetState]
type = TargetState
trigger1 = animelem = 68
value = 425
;ID = -1
;ignorehitpause =
;persistent =

[State 0, 5]
type = ChangeState
trigger1 = animelem = 68
value = 413
;ctrl = 1

;---------------------------------------------------------------------------
; ending part of helper (no damage)
[Statedef 413]
type    = S
movetype= A
physics = N
juggle  = 5
poweradd= 15
ctrl = 0
anim = 413
sprpriority = 2

[State 0, DestroySelf]
type = DestroySelf
trigger1 = animtime = 0
;ignorehitpause =
;persistent =

;---------------------------------------------------------------------------
;custom hit state
[Statedef 423]
type    = A
movetype= H
physics = N
velset = 0,0

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1 ;time = 0
flag = invisible
persistent = 1

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


;---------------------------------------------------------------------------
[Statedef 424]
type    = A
movetype= H
physics = N
velset = 0,0
poweradd = 40

[State 0, 1] ;Gravity
type = VelAdd
Trigger1 = 1
y = .4

[State 0, 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 0, 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 0, 4] ;Hit ground
type = SelfState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 5100 ;Hit ground


EDIT:

i fixed it by changing

; when successfully hit
[State 0, 5]
type = ChangeState
trigger1 = animtime = 0 && movehit = 1
value = 412
;ctrl = 1

to

; when successfully hit
[State 0, 5]
type = ChangeState
trigger1 = animtime = 0 && movehit
value = 412
;ctrl = 1

but i have another problem. i want p2 to fall down when released by my helper no matter what the situation is.

right now, p2 is just standing when i release p2 from my helper's control.

Demented Fortune Cookie

Quote from: sgn15 on July 31, 2011, 03:11:20 PMi have another problem. i want p2 to fall down when released by my helper no matter what the situation is.

right now, p2 is just standing when i release p2 from my helper's control.

Probably comes from this (in Statedef 412)

[State 0, TargetState]
type = TargetState
trigger1 = animelem = 68
value = 425
;ID = -1
;ignorehitpause =
;persistent =


Since state 425 doesn't exist, p2 just switches to state 0 by default.