Help with Red Koopa Shells?

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
User avatar
Clownman
Posts: 883
Joined: Fri Oct 07, 2011 6:35 pm
Location: USA

Help with Red Koopa Shells?

Post by Clownman »

If anybody has played Mario Kart, You probably know how the Red Shells had homing properties. I'm giving them to my Mario playermod only I am having some slight issues, Moreso the fact they don't seem move at all depending on if you throw them straight down (may or may not work this into a feature as a trap laying system, just have them despawn later) and the fact they won't go up steps and also seem to always like to take flight if it finds it's target on a different height level. I want the shell to be throwable in a sense but then just slide along the ground.


Code: Select all

ACTOR ThrownRedShell
{
  Radius 11
  Height 8
  Speed 12
  Damage 13
  Mass 100
  Projectile
  +SEEKERMISSILE
  -NOGRAVITY
  +NOEXPLODEFLOOR
  +NOEXTREMEDEATH
  +CANPASS
  +DONTGIB
  SeeSound "SHLTHRW"
  DeathSound "SHELLHIT"
  RenderStyle Normal
  States
  {
  Spawn:
    RSHL A 0 NoDelay A_PlaySound("RedShellSpin", CHAN_WEAPON, 1, 1)
    RSHL ABCDEFGHIJKL 2 A_SeekerMissile(100, 60, SMF_LOOK)
    Loop
  Death:
	TNT1 A 0 A_Changeflag (NOGRAVITY,1)
    TNT1 A 0 A_NoBlocking
    TNT1 A 0 Bright A_StopSound(CHAN_WEAPON)
    TNT1 B 0 A_Spawnitem("ShellPieces")
    FIRX ABCD 2 bright
    Stop
  }
}
User avatar
dawnbreez
Posts: 202
Joined: Wed Jul 08, 2015 12:29 pm

Re: Help with Red Koopa Shells?

Post by dawnbreez »

I wonder if you can use SMF_CURSPEED here. Normal SeekerMissile logic basically sets its speed to whatever the "speed" property is, which probably causes the "flying" effect. SMF_CURSPEED forces the shell to use its current velocity and just change its angle.
User avatar
Ichor
Posts: 1783
Joined: Wed Jul 23, 2003 9:22 pm

Re: Help with Red Koopa Shells?

Post by Ichor »

Perhaps you could spawn a second shell when you throw the first one to the ground, creating a new one when it hits. The second one can then start homing in on a target. Also, you could try using +FLOORHUGGER on the second one to keep it on the ground.

Return to “Scripting”