YesNoOk
avatar

P1 not disappearing upon Helper hitting (Read 184 times)

Started by hi-yo, July 06, 2018, 02:39:22 am
Share this topic:
P1 not disappearing upon Helper hitting
#1  July 06, 2018, 02:39:22 am
  • avatar
    • USA
I want P1 to disappear upon a Helper making contact with the opponent; however, it just doesn't want to work for me. Ctrl+D reveals that Player 1 is still in the same state they were previously in before the move connected. Here's the code.

Code:
[Statedef 2184]
type    = S
movetype= A
physics = N
poweradd= -1000
ctrl = 0
velset = 0,0
anim = 14

[State 2184, PlaySnd]
type = PlaySnd
trigger1 = Time = 0
value = 2184, 0
channel = -1

[State 2184, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 4
value = 14, 0
channel = 0

[State 0, PalFXWiz]
type = PalFX
trigger1 = time = 0
time = 18
add = 80,-20,-200
mul = 256,256,256
sinadd = 40,30,0,10
invertall = 0
color = 0

[State 0, Helper]
type = Helper
trigger1 = Time = 0
helpertype = normal ;player
name = "Helper"
ID = 2185
stateno = 2185
pos = 0,-20
postype = p1
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 0
pausemovetime = 0

[State 1666, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Helper
[Statedef 2185]
type    = S
movetype= A
physics = N
poweradd = 0
ctrl = 0
velset = 0,0
anim = 2184

[State 2185, 1]
type = HitDef
trigger1 = AnimElem = 2
attr = S, HP
damage = 20
priority = 9, Hit
animtype = light
hitflag = MA
hitsound = S401, 0
guardflag = MA
pausetime = 0,114
sparkno = -1
guardsound = 6,0
ground.type = High
ground.slidetime = 12
ground.hittime = 64
ground.velocity = -5.5
air.velocity = -2.5,-4
kill = 0
p1stateno = 2188
p2stateno = 2186

[State 2185, 2]
type = DestroySelf
trigger1 = AnimTime = 0
trigger1 = movecontact || moveguarded || movereversed

;---------------------------------------------------------------------------
; P2
[Statedef 2186]
type = S
movetype = H
physics = N
velset = 0,0
ctrl = 0
sprpriority = 2
anim = 5002

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = noBG
flag = noFG
flag = noshadow
flag = nomusic
flag2 = nobardisplay

[State 0, SuperPause]
type = SuperPause
trigger1 = Time = 0
time = 60
anim = 100
sound = F20,0
pos = Const(size.head.pos.x), Const(size.head.pos.y)
movetime = 0
darken = 1
p2defmul = 1
poweradd = 0
unhittable = 1

[State 1666, 1]
type = Explod
trigger1 = Time = 0
anim = 3232
shadow = -1
scale = .5, .5
ownpal = 1
postype = p2
pos = 0, 0
bindtime = 80
removeongethit = 1
sprpriority = 0
pausemovetime = 99999999999999
supermovetime = 99999999999999

[State 1666, 1]
type = Explod
trigger1 = Time = 0
anim = 3233
shadow = -1
scale = .5, .5
ownpal = 1
ontop = 1
postype = p2
pos = 0, -80
bindtime = 80
removeongethit = 1
sprpriority = 0
pausemovetime = 99999999999999
supermovetime = 99999999999999

[State 2186, 1]
type = PosAdd
trigger1 = Pos Y < 0
y = 6

;---------------------------------------------------------------------------
; P1 Disappears
[Statedef 2188]
type    = S
movetype= I
physics = N
ctrl = 0
anim = 9500
sprpriority = -9

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

[State 0, ScreenBound]
type = ScreenBound
trigger1 = 1
value = 0
movecamera = 0, 0

[State 0, Helper]
type = Helper
trigger1 = time = 0
helpertype = normal ;player
name = "Helper 2"
ID = 2197
stateno = 2197
pos = -45, -45
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1

[State 1666, 4]
type = Explod
trigger1 = Time = 0
anim = 1668
scale = 1, 1
pos = (GameWidth/2), (GameHeight/2)
ownpal = 1
id = 1214
postype = back
bindtime = 80
removetime = 94
removeongethit = 0

;---------------------------------------------------------------------------
; Helper 2
[Statedef 2197]
type    = S
movetype= A
physics = N
poweradd = 0
ctrl = 0
velset = 0,0
anim = 1666
sprpriority = 9

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = S2500,0
volumescale = 40
channel = -1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = S2500,1
volumescale = 40
channel = -1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = Time = 32
value = S2502,0
channel = -1

[State 1666, 2]
type = Hitdef
trigger1 = Time = 0
attr = S, HA
damage = 217
priority = 9
animtype = DiagUp
hitflag = MAF
hitsound = S2501, 0+RANDOM%3
pausetime = 1,1
sparkno = S689
sparkxy = 50, 30
guardsound = 6,0
ground.type = Low
ground.slidetime = 5
ground.hittime  = 153
ground.velocity = -6, -7
air.type = Low
air.velocity = -6, -7
air.hittime = 12
air.fall = 1
fall = 1
fall.recover = 0

[State 2185, 2]
type = DestroySelf
trigger1 = AnimTime = 0

Anim 9500 is a blank animation, by the way.
Re: P1 not disappearing upon Helper hitting
#2  July 06, 2018, 03:03:32 am
  • ******
  • Loyal to the Game
  • I'M SHADYYYYYYYYYY
    • USA
    • http://jesuszilla.trinitymugen.net/

  • Online
This, in the DestroySelf:

Code:
trigger1 = movecontact || moveguarded || movereversed

... may be why.

You're probably destroying the helper too early before anything can be detected. What you should do is destroyself only when AnimTime = 0, or when P1 has entered the proper state number. You can change the helper to another state on MoveContact (the other triggers are redundant, btw) to assist in this detection, and then destroy the helper when P1 has entered the "disappeared" state.

ink

Re: P1 not disappearing upon Helper hitting
#3  July 06, 2018, 03:22:01 am
  • ****
  • inktrebuchet
    • USA
    • s236.photobucket.com/albums/ff271/inktrebuchet/?

  • Online
Wouldn’t p1stateno refer to the helper in this case. I think that’s the problem here.

Something like this added to p1’s state or -2 should work, if I’m correct.

Code:
[state n] ;disappear 
Type = changestate
Trigger1 = numhelper(2185) = 1
Trigger1 = helper(2185), movecontact
Value = 2188
Re: P1 not disappearing upon Helper hitting
#4  July 06, 2018, 03:23:23 am
  • ******
  • Loyal to the Game
  • I'M SHADYYYYYYYYYY
    • USA
    • http://jesuszilla.trinitymugen.net/

  • Online
That too, though I do think the helper is being destroyed too soon as well.
Re: P1 not disappearing upon Helper hitting
#5  July 06, 2018, 07:55:15 am
  • avatar
    • USA
Just tried both of your suggestions. P1 is now disappearing as intended. Thanks!