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 = Smovetype = Aphysics = Sanim = 297poweradd = -200ctrl = 0[State 1, Eaah!]type = PlaySndtrigger1 = AnimElem = 1value = S9,0[State 1050, CA at the end] ; Changeanim decided on how high or low p2 is on the screentype = Changeanimtriggerall = anim = 297 && animtime = 0trigger1 = 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 screentype = Changeanimtriggerall = anim = 297 && animtime = 0trigger1 = 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 screentype = Changeanimtriggerall = anim = 297 && animtime = 0trigger1 = p2bodydist y < -150value = 2973[State 1, Helper]type = Helpertrigger1 = anim = 2971 || anim = 2972 || anim = 2973helpertype = normal ;playername = "Fireball Helper"ID = 7021stateno = 7021pos = 65,-70postype = p1 ;p2,front,back,left,rightfacing = 1keyctrl = 0ownpal = 1supermovetime = 0pausemovetime = 0size.xscale = 1size.yscale = 1[State 1, end]type = ChangeStatetrigger1 = Time = 40 value = 0ctrl = 1;--------------------------------------------------------------------------- THIS IS WHERE THE HELPER CODING BEGINS[Statedef 7021, Fireball Helper]type = Smovetype = Aphysics = Nanim = 508poweradd = 0ctrl = 0sprpriority = 3[State 7021, BindToParent]type = BindToParenttrigger1 = Time = 0time = 50facing = 0pos = 65,-70[State 7021, 2]type = assertspecialtrigger1 = 1flag = noshadow[State 7021, TR]type = Transtrigger1 = 1trans = add[State 7021, AD]type = AngleDrawtrigger1 = 1[State 7021, AS]type = AngleSettriggerall = parent,anim = 2971 ;forwardtrigger1 = time = 0value = 0[State 7021, Bind 1]type = Bindtoparenttrigger1 = time = 0 && parent,anim = 2971pos = 65,-70[State 7021, VelSet]type = VelSettriggerall = parent,anim = 2971trigger1 = time = 0x = 10y = 0[State 7021, AS]type = AngleSettriggerall = parent,anim = 2972 ;slightly uptrigger1 = time = 0value = 30[State 7021, Bind 1]type = Bindtoparenttrigger1 = time = 0 && parent,anim = 2972pos = 75,-90[State 7021, VelSet]type = VelSettriggerall = parent,anim = 2972trigger1 = time = 0x = 10y = -5[State 7021, AS]type = AngleSettriggerall = parent,anim = 2973 ;uptrigger1 = time = 0value = 40[State 7021, Bind 1]type = Bindtoparenttrigger1 = time = 0 && parent,anim = 2973pos = 60,-105[State 7021, VelSet]type = VelSettriggerall = parent,anim = 2973trigger1 = time = 0x = 10y = -10[State 1, HitDef]type = HitDeftrigger1 = 1attr = S, SPhitflag = MAFDPguardflag = MAanimtype = Hardair.animtype = Hardpriority = 4,Hitpausetime = 0,9damage = 50,0getpower = 0,0hitsound = S10,14sparkno = S511sparkxy = 10,-8guard.sparkno = -1kill = 1guard.kill = 0fall = 0ground.type = Tripground.slidetime = 14ground.hittime = 16ground.velocity = -5,0air.animtype = Backair.velocity = -5,-3air.juggle = 3envshake.time = 10 ;Parameters for shaking the screen on hitenvshake.ampl = 5envshake.freq = 180palfx.time = 9palfx.add = 240,50,0 palfx.mul = 250,224,120 palfx.sinadd = 110,55,85,10Palfx.color = 0 palfx.invertall = 1[State 2, DestroySelf]type = DestroySelftrigger1 = movecontact = 1
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.
PotS said, May 31, 2025, 07:14:44 pmBecause 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