YesNoOk
avatar

triggers getting ignored (Read 861 times)

Started by Trackiest head, December 01, 2019, 05:43:20 pm
Share this topic:
triggers getting ignored
#1  December 01, 2019, 05:43:20 pm
  • **
  • Get yer gear up!
    • Spain
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.

Code:
[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.

Code:
[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

Code:
[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.

Code:
[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
Re: triggers getting ignored
#2  December 02, 2019, 05:20:14 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
You have your greater than lesser thans messed up.

Parentdist x< -200 will mean 200 pixels or more away. Your helper is facing away from parent so they are behind it. Not in front.

1202 i see nothing wrong with. Sometimes velset = 0,0 doesn't behave and you need a real velset in there. But there is nothing wrong with the code in that state.


In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.
Re: triggers getting ignored
#3  December 08, 2019, 02:46:32 am
  • *****
  • Shame on you!
    • USA
You may need
ignorehitpause = 1
in your velset. When ever something uses time =, I always try to put the ignore in. Sometime that 1 tic goes bad and then it never =8 again. It's always better to have a range. Sometimes you just can't have that and it has to be 1 particular tic.

Have you tried
trigger1 = ParentDist x > 15 || movecontact
to see if movecontact works, and that it's not the distance causing problems?
vVv Ryuko718 Updated 10/31/22 vVv