YesNoOk
avatar

spark helper displayed too many times (Read 3505 times)

Started by Momotaro, May 22, 2021, 10:57:23 pm
Share this topic:
spark helper displayed too many times
#1  May 22, 2021, 10:57:23 pm
  • *****
  • A.K.A. NED
  • I like to draw fighting game characters...
Hi,

I'm coding some air projectile move (air kunai type) but the result is buggy.
BOTH hitspark and blood spark seems to appear multiple times (3 times)
(The moves hit only once)

Code:
[State 1130, Hit Spark]
type = Helper
trigger1 = movecontact = 1
trigger1 = p2movetype = H
helperType = Normal
stateNo = ifelse(moveguarded,8001,8016);1er = block spark; 2ème = hit spark
ID = 8000
name = "Spark"
posType = P1
pos = 8,0 ;;;;;;;;;;;;;;;;;;;;;ceil(42 * const(size.xScale)), ceil(-63 * const(size.yScale))
facing = 1
ontop = 1
ownPal = 1
pauseMoveTime = 65535
superMoveTime = 65535
ignoreHitPause = 1

[State 1130, Blood]
type = Helper
;trigger1 = HitPauseTime = ifElse(var(20), 3, 7)
trigger1 = MoveHit = 1 && NumTarget
helperType = Normal
stateNo = 8051;;;;;;;;;selon la version du coup-50-51-52
ID = 8050;;;;;;;;;;ne pas changer
name = "Blood"
posType = P1
pos = ifElse(P2Dist x < 0, 0, ifElse(P2Dist x < var(35), ceil(P2Dist x), var(35))), var(36)
facing = -1
ownPal = 1
pauseMoveTime = 65535
superMoveTime = 65535
ignoreHitPause = 1

Just in case, the code of the Kunai projectile itself.
Spoiler, click to toggle visibilty
Last Edit: May 23, 2021, 06:58:36 pm by Nedflandeurse
Re: spark helper displayed too many times
#2  May 23, 2021, 05:24:56 am
  • avatar
  • *
    • Canada
The issue is probably ‘trigger1 = movecontact = 1’, movecontact and similar triggers don’t increase while you have hitpausetime, so this trigger will be true for the duration of your hitpause (1 Helper on initial contact + 2 during your 2-tick hitpause = 3 helpers)

You probably want to add either ‘triggerall = !numhelper(8000)’ or maybe ‘triggerall = HitPauseTime = 2’ to make sure it only triggers once
Re: spark helper displayed too many times
New #3  May 23, 2021, 07:02:15 pm
  • *****
  • A.K.A. NED
  • I like to draw fighting game characters...
The issue is probably ‘trigger1 = movecontact = 1’, movecontact and similar triggers don’t increase while you have hitpausetime, so this trigger will be true for the duration of your hitpause (1 Helper on initial contact + 2 during your 2-tick hitpause = 3 helpers)

You probably want to add either ‘triggerall = !numhelper(8000)’ or maybe ‘triggerall = HitPauseTime = 2’ to make sure it only triggers once

Thanks a lot "triggerall = HitPauseTime = 2" method worked perfectly for both spark and blood.

But for some reason, when I tried "numhelper" method, it worked only for sparks. still had 3 blood explods.
Even if I used respectively

triggerall = !numhelper(8000)
for
ID = 8000

and

triggerall = !numhelper(8050)
for
ID = 8050

This is strange.
But now, my problem is solved since "HitPauseTime" method worked perfectly.
Last Edit: May 23, 2021, 07:07:38 pm by Nedflandeurse