> It's been quite a while since I posted last. I'm working on a new character, and I'm almost done with it, but I'm having trouble with one of the super attacks. A projectile drops from the sky and is supposed to land on the ground, then disappear after a second. However, the projectile instead disappears just before hitting the ground. Here's the code for the Projectile state controller...[State 3100, Projectile]type = Projectiletrigger1 = AnimElem = 8 ;kicks in when animation reaches its eighth frameattr = S, HP ;Attributes (Standing, Super Projectile)damage = 180, 18 ;Damage points to dealgetpower = 0, 0givepower = 180, 18guardflag = MA ;Can be blocked by standing or aerial opponentground.type = High ;opponent goes into hit high animationanimtype = Hard ;opponent goes into hit hard animationground.hittime = 10 ;opponent recovery timeground.velocity = 0 ;how fast grounded opponent slides background.slidetime = 1 ;how long opponent slides backair.velocity = 0, 5 ;how fast aerial opponent slides backfall = 1 ;knocks down opponentsparkno = -1 ;displays no sparkpalfx.add = 250, 0, 0 ;opponent turns redpalfx.sinadd = 120, 60, 60, 10 ;opponent's flashing effectpalfx.time = 30 ;opponent's color change effect lasts for 30 tickshitsound = S0, 7 ;plays Slam - Normal (sound effect)guardsound = S0, 10 ;plays Hard hit - Blocked (sound effect)ProjID = 3161 ;ID number of projectileprojanim = 3161 ;projectile animation (sprites);projhitanim = 3271 ;projectile spark (sprites)projremove = 0 ;does not self destruct after hitprojremovetime = 60 ;projectile self destructs automatically after 60 ticksvelocity = 0, 5 ;how fast projectile moves;remvelocity = 0, 0 ;how fast spark moves while it self destructsaccel = 0, 1 ;changes velocity of projectileprojhits = -1 ;number of times projectile hits before it self destructspostype = p2offset = 0, -500 ;adjusts the projectile's origin 500 pixels directly above opponentafterimage.length = 10 ;after image lags 50 ticks above anvilafterimage.time = 20 ;after image lasts for 20 ticks> Any suggestions?
> Thanks for the advice, Phantom. I replaced "projremovetime = 60" with "projheightbound = -100, 100", and now the projectile simply passes through the ground instead of just disappearing in mid-air. Now, I just have to figure out how to get it to stop when it hits the ground, then disappear after a second. Is this something that can be done with a projectile, or do I need to use a helper for that?
I think your settings of -100, 100 will make it disappear 100 pixels below the ground, which is why you wouldn't see it. But yeah if you want a very specific behavior for it you may need a helper.
> OK, I fixed the problem. All I had to do was switch from using a projectile to using a helper instead. I replaced the projectile code with this...[State 3100, Helper]type = Helper ;type of state: Helpertrigger1 = AnimElem = 8 ;kicks in when animation reaches its eighth framePosType = p2Pos = 0, -500 ;adjusts the projectile's origin 500 pixels directly above opponentStateNo = 3161 ;projectile's custom state> And then used the following code for the helper...; Anvil Gag - Projectile[Statedef 3161]physics = N ;switches to neutral physicsmovetype = A ;activates red hitboxesjuggle = 4 ;attack costs 4 juggle pointsanim = 3161 ;helper appears as Anvil Gag - Projectile (sprites)velset = 0, 5 ;how fast projectile moves[State 3161, Velocity Multiply]type = VelMultrigger1 = Time = 0 ;kicks in immediatelyy = 5 ;Projectile accelerates downward[State 3161, After Image]type = AfterImagetrigger1 = AnimElem = 1 ;kicks in when animation reaches its first framelength = 10 ;after images lags 10 ticks behind projectiletime = 20 ;after images last for 20 ticks[State 3161, HitDef]type = HitDeftrigger1 = Time = 0 ;kicks in immediatelyattr = S, HP ;Attributes (Standing, Super Projectile)damage = 180, 18 ;Damage points to dealgetpower = 0, 0givepower = 180, 18hitflag = MAFD ;Can hit standing, aireal, falling, and lying down opponentguardflag = MA ;Can be blocked by standing or aerial opponentground.type = High ;opponent goes into hit high animationanimtype = Hard ;opponent goes into hit hard animationground.hittime = 10 ;opponent recovery timeground.velocity = 0 ;how fast grounded opponent slides background.slidetime = 1 ;how long opponent slides backair.velocity = 0, 5 ;how fast aerial opponent slides backfall = 1 ;knocks down opponentsparkno = -1 ;displays no sparkhitsound = S0, 8 ;plays Slam - Super (sound effect)guardsound = S0, 10 ;plays Hard hit - Blocked (sound effect)[State 3161, Velocity Set]type = VelSettrigger1 = Pos Y >= -5;^kicks in if projectile is 5 pixels above the ground or lower^x = 0 ;Projectile does not move horizontallyy = 0 ;Projectile does not move vertically[State 3161, Play Sound]type = Playsnd ;type of state: Play Soundtrigger1 = Pos Y >= -25;^kicks in if projectile is 25 pixels above the ground or lower^trigger1 = Vel Y > 0 ;kicks in if projectile is not fallingtrigger1 = P2MoveType != Hvalue = S0, 8 ;plays Slam - Super (sound effect)[State 3161, Environment Shake]type = EnvShake ;Shakes the screentrigger1 = Pos Y >= -25;^kicks in if projectile is 25 pixels above the ground or lower^trigger1 = Vel Y > 0 ;kicks in if projectile is not fallingTime = 30 ;Screen shakes for 30 ticksAmpl = -5 ;How far up & down the screen shakesFreq = 100 ;How fast the screen shakes[State 3161, Destroy Self]type = DestroySelf ;type of state: Destroy Selftrigger1 = Time = 80 ;kicks in after 80 ticks into the animation> The attack does everything I want it to do, except for two things. One, I couldn't get the PalFX to work, but there's a chance I'll try again later. And two, I need a whistle sound, but I'll probably include one in the second version of the character. Thanks for all your help, and I can now mark this topic as Solved.