YesNoOk
avatar

How Do You Make Sure Projectiles Do Not Disappear Offscreen? (Read 74206 times)

Started by Ki$@1st456v, March 26, 2023, 08:44:59 pm
Share this topic:
How Do You Make Sure Projectiles Do Not Disappear Offscreen?
#1  March 26, 2023, 08:44:59 pm
  • avatar
  • **
    • USA
Hi, everyone! I was wondering, with a projectile, it can keep going (depending on the coding) until it disappears offscreen. But what do you have to put in the code for a stationary projectile (like a trap) to not disappear offscreen?

I have the code here:

; ”g“®Œ Žã
[Statedef 10007]
type = S
movetype= A
physics = S
ctrl = 0
anim = 1083
sprpriority = 2
velset = 0,0
poweradd = 50

[State 1000, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = 10,3
channel = 0

[State 1000, PlaySnd]
type = PlaySnd
trigger1 = animelem = 4
value = 20,0

[State 1000, Explod]
type = Explod
trigger1 = time = 0
anim = 8300
id = 8300
supermove = 1
sprpriority = 4
ownpal = 1

[State 1000, Projectile]
type = Projectile
trigger1 = animelem = 4
attr = A, SP
damage = 70,5
projhits = 7
animtype = Hard
guardflag = MA
hitflag = MAF
getpower = 30,0
givepower = 20,0
pausetime = 0,6
sparkno = S8002
guard.sparkno = S8050
sparkxy = 0, 0
hitsound = S5,3
guardsound = S6,0
ground.type = High
ground.slidetime = 18
ground.hittime = 20
air.hitt = 10001
projcancelanim = 10001
fall.envshake.time = 10
velocity = 0,0
offset = 25*const(size.xscale),0*const(size.yscale)
projscale = const(size.xscale),const(size.yscale)
id = 4+64

[State 1100, Destroyself]
type = destroyself
trigger1 = pos x != [-280/camerazoom,280/camerazoom]

[State 1100, ChangeState]
type = ChangeState
trigger1 = animtime = 0
trigger2 = FrontEdgeDist < -40
trigger3 = MoveGuarded
value = 1261
ctrl = 1

I appreciate any help anyone has to offer. You all take care and have a great day! 
Re: How Do You Make Sure Projectiles Do Not Disappear Offscreen?
#2  March 26, 2023, 09:57:43 pm
  • ****
    • crepa.neocities.org
Just remove the 'destroyself' part of the code.
Re: How Do You Make Sure Projectiles Do Not Disappear Offscreen?
#3  March 27, 2023, 07:20:38 am
  • avatar
  • **
    • USA
Hi, thank you for your response. I removed the 'destroyself' part of the code but the projectile still disappears offscreen. I am not sure what else to do.
Re: How Do You Make Sure Projectiles Do Not Disappear Offscreen?
#4  March 27, 2023, 03:45:19 pm
  • ******
  • Hedgehog Whisperer
  • Red Bull addict
    • Spain
    • xgargoyle.mgbr.net
[State 1100, ChangeState]
type = ChangeState
trigger1 = animtime = 0
trigger2 = FrontEdgeDist < -40
trigger3 = MoveGuarded
value = 1261
ctrl = 1

This is what makes the projectile to go into the disappearing state when reaching offscreen. Remove it or change the values to something you are comfortable with.
Be advised that preventing the correct removal of a projectile could result in bugs or glitches on certain characters.
XGargoyle: Battle posing since 1979
http://xgargoyle.mgbr.net
http://www.pandorabots.com/pandora/talk?botid=e71c0d43fe35093a  <-- Please click that link
http://paypal.me/XGargoyle  <-- Donations welcome!
Re: How Do You Make Sure Projectiles Do Not Disappear Offscreen?
#5  March 28, 2023, 10:27:24 am
  • ******
    • Portugal
    • network.mugenguild.com/pots/
Yeah. It's also a really bad idea to create helpers without a destroyself somewhere.
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: How Do You Make Sure Projectiles Do Not Disappear Offscreen?
#6  April 05, 2023, 07:10:26 am
  • ******
  • Take better care of the plants around u or become
  • the fertilizer that feeds them.The choice is yours
    • Chile
    • network.mugenguild.com/basara/
Why do you have a projectile state into a helper?? Is it a projectile or a helper?? If it's a helper that works as a projectile, then use HitDef instead of Projectile since all projectiles dissapear when go offscreen, the only way to avoid that is to make the projectile as a helper

Rest in peace, Toriyama-san...
Normal WIPS - ClayFighter - Ideas - Anti-Gouki Project - Lifebars - Facebook - X
Re: How Do You Make Sure Projectiles Do Not Disappear Offscreen?
#7  April 08, 2023, 10:25:33 am
  • **
Why do you have a projectile state into a helper?? Is it a projectile or a helper?? If it's a helper that works as a projectile, then use HitDef instead of Projectile since all projectiles dissapear when go offscreen, the only way to avoid that is to make the projectile as a helper

You'd want to have the helper have the projectile sctrl if you don't want it to get messed up by ReversalDef.