Hi guys, I'm having a pretty hard time here with a boomerang attack. I have two problems with it and both are related to triggers refusing to trigger despite that there's practically nothing overriding them.
Problem 1. The state where the boomerang returns
For this one there's two possible triggers for this to happen.
[State 1201, ChangeState]
type = ChangeState
trigger1 = movecontact || ParentDist x > (value)
value = 1202
The first one works but somehow the second one doesn't seem to return the value for whatever reason, no matter what value I punch in, never.
I have placed a FrontEdgeDist and it seems to work but it's not a definite solution as it can cause problems in stages with zoom.
[State 1201, ChangeState]
type = ChangeState
trigger1 = movecontact || FrontEdgeDist <= -90
value = 1202
Problem 2. An state where the boomerang accelerates back to thrower after stopping cold, after 8 ticks
[State 1203, VelAdd]
type = Velset
trigger1 = time = 8
x = -8
For some reason if the value is 5 or lower it does indeed return albeit, it won't stay stopped (the velset is in the statedef)
Here's the full code for reference.
[statedef 1200]
type = S
movetype= A
physics = S
poweradd = 2
ctrl = 0
velset = 0,0
anim = 1200
[state 1200, helper]
type = Helper
trigger1 = animelem = 5
name = "boomerang"
ID = 800
stateno = 1201
pos = 40,-40
postype = p1 ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0
[State 1200, ChangeState]
type = ChangeState
triggerall = time > 8
trigger1 = numhelper(800) = 0
value = 0
ctrl = 1
anim = 1202
;ignorehitpause =
;persistent =
[statedef 1201]
type = S
Movetype = A
Physics = N
anim = 1201
[State 1201, HitDef]
type = HitDef
trigger1 = animelem = 1
attr = S,NA
hitflag = MAF
guardflag = MA
animtype = medium
air.animtype = medium
damage = 15,2
pausetime = 0 ,8
sparkno = S3000
guard.sparkno = S3100
sparkxy = 0,0
hitsound = S1,0
guardsound = S2,0
ground.type = High ;Low,Trip,None
ground.slidetime = 3
ground.hittime = 3
air.hittime = 9
ground.velocity = -4,0
air.velocity = -5,0
p1stateno = 1202
[State 1201, PlaySnd]
type = PlaySnd
trigger1 = !time
value = S1200,0
channel = 4
;lowpriority = -1
freqmul = 0.5
volume = 50
[State 1201, VelAdd]
type = VelAdd
trigger1 = gametime%2 && vel x < 8
x = 0.5
[state 1201, rotation 1]
type = angleDraw
trigger1 = 1
[state 1201, rotation 2]
type = angleAdd
trigger1 = 1
value = -20
[State 1201, ChangeState]
type = ChangeState
trigger1 = movecontact || FrontEdgeDist <= -90
value = 1202
[statedef 1202]
type = S
Movetype = A
Physics = N
anim = 1201
velset = 0,0
[State 1202, HitDef]
type = HitDef
trigger1 = time % 2 && time > 3 && hitcount < 7
attr = S,NA
hitflag = MAF
guardflag = MA
animtype = medium
air.animtype = medium
damage = 15,2
pausetime = 0 ,8
sparkno = S3000
guard.sparkno = S3100
sparkxy = 0,0
hitsound = S1,0
guardsound = S2,0
ground.type = High ;Low,Trip,None
ground.slidetime = 3
ground.hittime = 6
air.hittime = 9
ground.velocity = -7,0
air.velocity = -5,0
p1stateno = 1202
[state 1202, rotation 1]
type = angleDraw
trigger1 = 1
[state 1202, rotation 2]
type = angleAdd
trigger1 = 1
value = -20
[State 1203, VelAdd]
type = Velset
trigger1 = time = 8
x = -8
[State 1203, DestroySelf]
type = DestroySelf
trigger1 = parentdist x >= -20