YesNoOk
avatar

Helper mass spawning problem (Read 1272 times)

Started by DonMino95, May 31, 2025, 06:49:09 pm
Share this topic:
Helper mass spawning problem
#1  May 31, 2025, 06:49:09 pm
  • **
    • Italy
    • www.youtube.com/user/DonMino95
Hello there, I'm trying to code a projectile that moves upward depending on the p2 position in the air and I managed to get the p1 to aim at the proper direction. Be it forward, slightly up or very up high. The problem I'm now facing is with the projectile Helper. Instead of being a single shot, it keeps on spawning for the entire duration of the animation, a single copy of the projectile stays still in front of my p1 and at the 4th time that you press the button it doesn't shoot anything at all. There's so many errors that I don't even know where to look at.
Here's the code I made:

;--------------------------------------------------------------------------- THIS IS THE CODE TO DETERMINE WHERE TO SHOOT THE FIREBALL
[Statedef 702, Fireball]
type = S
movetype = A
physics = S
anim = 297
poweradd = -200
ctrl = 0

[State 1, Eaah!]
type = PlaySnd
trigger1 = AnimElem = 1
value = S9,0

[State 1050, CA at the end] ; Changeanim decided on how high or low p2 is on the screen
type = Changeanim
triggerall = anim = 297 && animtime = 0
trigger1 = p2bodydist y = [-15,15]
value = 2971

;Character is slightly high
[State 1050, CA at the end] ; Changeanim decided on how high or low p2 is on the screen
type = Changeanim
triggerall = anim = 297 && animtime = 0
trigger1 = p2bodydist y = [-150,-16]
value = 2972

;Character is very high
[State 1050, CA at the end] ; Changeanim decided on how high or low p2 is on the screen
type = Changeanim
triggerall = anim = 297 && animtime = 0
trigger1 = p2bodydist y < -150
value = 2973

[State 1, Helper]
type = Helper
trigger1 = anim = 2971 || anim = 2972 || anim = 2973
helpertype = normal ;player
name = "Fireball Helper"
ID = 7021
stateno = 7021
pos = 65,-70
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 0
pausemovetime = 0
size.xscale = 1
size.yscale = 1

[State 1, end]
type = ChangeState
trigger1 = Time = 40
value = 0
ctrl = 1

;--------------------------------------------------------------------------- THIS IS WHERE THE HELPER CODING BEGINS
[Statedef 7021, Fireball Helper]
type = S
movetype = A
physics = N
anim = 508
poweradd = 0
ctrl = 0
sprpriority = 3

[State 7021, BindToParent]
type = BindToParent
trigger1 = Time = 0
time = 50
facing = 0
pos = 65,-70

[State 7021, 2]
type = assertspecial
trigger1 = 1
flag = noshadow

[State 7021, TR]
type = Trans
trigger1 = 1
trans = add

[State 7021, AD]
type = AngleDraw
trigger1 = 1

[State 7021, AS]
type = AngleSet
triggerall = parent,anim = 2971 ;forward
trigger1 = time = 0
value = 0

[State 7021, Bind 1]
type = Bindtoparent
trigger1 = time = 0 && parent,anim = 2971
pos = 65,-70

[State 7021, VelSet]
type = VelSet
triggerall = parent,anim = 2971
trigger1 = time = 0
x = 10
y = 0

[State 7021, AS]
type = AngleSet
triggerall = parent,anim = 2972 ;slightly up
trigger1 = time = 0
value = 30

[State 7021, Bind 1]
type = Bindtoparent
trigger1 = time = 0 && parent,anim = 2972
pos = 75,-90

[State 7021, VelSet]
type = VelSet
triggerall = parent,anim = 2972
trigger1 = time = 0
x = 10
y = -5

[State 7021, AS]
type = AngleSet
triggerall = parent,anim = 2973 ;up
trigger1 = time = 0
value = 40

[State 7021, Bind 1]
type = Bindtoparent
trigger1 = time = 0 && parent,anim = 2973
pos = 60,-105

[State 7021, VelSet]
type = VelSet
triggerall = parent,anim = 2973
trigger1 = time = 0
x = 10
y = -10

[State 1, HitDef]
type = HitDef
trigger1 = 1
attr = S, SP
hitflag = MAFDP
guardflag = MA
animtype = Hard
air.animtype = Hard
priority = 4,Hit
pausetime = 0,9
damage = 50,0
getpower = 0,0
hitsound = S10,14
sparkno = S511
sparkxy = 10,-8
guard.sparkno = -1
kill = 1
guard.kill = 0
fall = 0
ground.type = Trip
ground.slidetime = 14
ground.hittime = 16
ground.velocity = -5,0
air.animtype = Back
air.velocity = -5,-3
air.juggle = 3
envshake.time = 10           ;Parameters for shaking the screen on hit
envshake.ampl = 5
envshake.freq = 180
palfx.time = 9
palfx.add = 240,50,0
palfx.mul = 250,224,120
palfx.sinadd = 110,55,85,10
Palfx.color = 0
palfx.invertall = 1

[State 2, DestroySelf]
type = DestroySelf
trigger1 = movecontact = 1
Download Gogeta V3 HERE

Last Edit: June 01, 2025, 01:39:23 am by DonMino95
Re: Helper mass spawning problem
#2  May 31, 2025, 07:14:44 pm
  • ******
    • Portugal
    • network.mugenguild.com/pots/
Because that's exactly what you're telling it to do. You need to add "persistent = 0" to the Helper sctrl or limit the triggers further so they're only true for 1 frame.
You can help with Ikemen GO's development by trying out the latest development build and reporting any bugs on GitHub.
My Mugen and Ikemen content can also be found here.
Re: Helper mass spawning problem
#3  June 01, 2025, 01:37:45 am
  • **
    • Italy
    • www.youtube.com/user/DonMino95
Because that's exactly what you're telling it to do. You need to add "persistent = 0" to the Helper sctrl or limit the triggers further so they're only true for 1 frame.

Yeah in the end I managed to fix it. I had literally forgot to add that one command. I spent a full hour looking for the mistake. Thanks for replying tho
Download Gogeta V3 HERE