Is there any easy way to make a seekermissile choose...

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Locked
User avatar
Ceeb
Posts: 5125
Joined: Wed Jun 11, 2008 4:07 pm
Location: Castle Wut

Is there any easy way to make a seekermissile choose...

Post by Ceeb »

Ran out of space. :P

Is there any easy way to make a seekermissile choose a new target after it's current one is dead? You see, I've made a high-speed, bouncy razorblade that locks onto whatever the player aims at, and basically zooms around it until it's dead. It works great on large enemies, but on small enemies, the razor will usually cut once and then zip off somewhere to bounce around and break.

Is there a way I can make it chase another enemy if it's close enough to one it kills? I'm open to scripting or hacky methods if it's necessary. I will post the razor's code if necessary.
User avatar
Cutmanmike
Posts: 11354
Joined: Mon Oct 06, 2003 3:41 pm
Operating System Version (Optional): Windows 10
Location: United Kingdom
Contact:

Re: Is there any easy way to make a seekermissile choose...

Post by Cutmanmike »

As seeker missiles don't even use real targets, there's no way to do this. :(
Gez
 
 
Posts: 17946
Joined: Fri Jul 06, 2007 3:22 pm

Re: Is there any easy way to make a seekermissile choose...

Post by Gez »

Though you may try to inherit from [wiki=Classes:MaceFX4]MaceFX4[/wiki] and use [wiki]A_DeathBallImpact[/wiki]. It'll only work when it bounces off the floor (or ceiling) and you'll have to play with the [wiki=Actor_flags#Bouncing]bounce flags[/wiki] to make it work correctly.
User avatar
Phobus
Posts: 5984
Joined: Thu May 05, 2005 10:56 am
Location: London
Contact:

Re: Is there any easy way to make a seekermissile choose...

Post by Phobus »

Make it a friendly monster with a limited lifespan that rushes about doing damage to things.
User avatar
Ceeb
Posts: 5125
Joined: Wed Jun 11, 2008 4:07 pm
Location: Castle Wut

Re: Is there any easy way to make a seekermissile choose...

Post by Ceeb »

Phobus wrote:Make it a friendly monster with a limited lifespan that rushes about doing damage to things.
I'll give this a shot and get back to you guys.

If not, I suppose aiming for larger, sturdier enemies in packs will be part of using the weapon strategically.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49252
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Is there any easy way to make a seekermissile choose...

Post by Graf Zahl »

Yesterday I committed a submission that exposes the auto-seeking feature of Hexen's Bloodscourge projectile.
User avatar
Snarboo
Posts: 2599
Joined: Tue Nov 29, 2005 4:37 am

Re: Is there any easy way to make a seekermissile choose...

Post by Snarboo »

I hate to hijack the thread, but I just tried using the improved [wiki=A_SeekerMissile]A_SeekerMissile[/wiki] behavior with my sticky bombs but GZDoom reported that it couldn't read the new parameters. Has the new seeker missile code been added yet?
Gez
 
 
Posts: 17946
Joined: Fri Jul 06, 2007 3:22 pm

Re: Is there any easy way to make a seekermissile choose...

Post by Gez »

http://forum.drdteam.org/viewtopic.php?f=24&t=4448

Another victim of the "always commit from /src" issue. You can fix that for yourself by editing gzdoom.pk3 with Slumped to carry the same changes to actor.txt, constants.txt and (but that's less important) magestaff.txt.
User avatar
Ceeb
Posts: 5125
Joined: Wed Jun 11, 2008 4:07 pm
Location: Castle Wut

Re: Is there any easy way to make a seekermissile choose...

Post by Ceeb »

Graf Zahl wrote:Yesterday I committed a submission that exposes the auto-seeking feature of Hexen's Bloodscourge projectile.
Exactly what I need, thanks for the info, Graf. :mrgreen:
User avatar
Ethril
Posts: 2677
Joined: Sun Nov 16, 2008 2:59 am
Location: with you in the dark

Re: Is there any easy way to make a seekermissile choose...

Post by Ethril »

Graf Zahl wrote:Yesterday I committed a submission that exposes the auto-seeking feature of Hexen's Bloodscourge projectile.
Image

It's about time this happened.
User avatar
Snarboo
Posts: 2599
Joined: Tue Nov 29, 2005 4:37 am

Re: Is there any easy way to make a seekermissile choose...

Post by Snarboo »

I just updated gzdoom.pk3 and holy shit this is awesome. I think have a good idea for my final weapon in my mod now.
User avatar
InsaneFury
Posts: 105
Joined: Mon Nov 23, 2009 6:51 am

Re: Is there any easy way to make a seekermissile choose...

Post by InsaneFury »

Sorry for the thread resurrection and hijacking, but as this one came up in a search for my problem, I figure this could help other people in the same situation. :)
Ceeb wrote:Is there any easy way to make a seekermissile choose a new target after it's current one is dead?
I'm actually trying to create a seekermissile that does not choose a new target after it's current one is dead. Furthermore, I want it to seek a target when it doesn't have one (initially, that is).

Code: Select all

actor RottHeatSeeker : Rocket //MageStaffFX2
{
  height 8
  radius 6
  damage 5
  speed 28
  alpha 1
  deathsound "misc/shotx"
  PROJECTILE
  +SEEKERMISSILE
  +SCREENSEEKER // only seek for enemies in shooter's FOV
  +RocketTrail
  -Ripper
  states
  {
  See:
    MISL A 2 bright A_SeekerMissile(5,20,SMF_LOOK,255) //,SMF_LOOK,255 // A_MStaffTrack
    MISL A 1 bright A_ActiveSound
    Loop
  Spawn:
    MISL A 10 bright
    Goto See
  Death:
    MISL B 8 bright A_Explode
    MISL CDEFGHIJKLMNO 2 Bright
    stop
  }
}
As-is now, the rocket will fire, start seeking after 10 tics (Spawn->See). It'll loop the SeekerMissile directive, then dies whenever it hits a target.

However, when firing 2 missile after another at the same target, they'll both home in on it but when the 1st kills the target, the 2nd one will (again) home in on another target.

I suppose this is due to the missile looking for a new target in the See-loop (with the SMF_LOOK flag), but as I want to make sure the rocket finds any target (even if he didn't get one from the player), I see no other option than to have that loop.

I also tried the MageStaffFX2 / A_MStaffTrack approach, but no luck there. I also couldn't disable the Ripper effect there anyway.

Does anyone have the code to a single target seeking homing missile? Or is this a limitation that would require an extension to A_SeekerMissile, possibly adding an int seektimes to the SMF_LOOK flag to limit the seeks, or create a new SMF_LOOKONCE flag altogether?
Locked

Return to “Editing (Archive)”