Page 1 of 1

Seeking Missiles

Posted: Fri Feb 28, 2014 12:40 pm
by Donald Duck
Hello everyone,

I've tried to make a missile that seeks for targets on its own.
If the gamemode is coop it should only attack monsters, else it should attack monsters and other players.

Now I tried A_SeekerMissile() and the SEEKERMISSILE flag. But this just works if I am aiming directly at the target. But the missile is supposed to search for targets itself like the holy spirits or the Bloodscourge missiles from Hexen.

I tried to inherit from MageStaffFX2 class (Bloodscourge projectile: http://zdoom.org/wiki/Classes:MageStaffFX2 ) and call A_MStaffTrack. It works excellent.
The only problem I encountered is that the projectile rips through enemies for some reason, even hough I removed the RIPPER flag and added the NOBOSSRIP flag.

I tried to inherit from HolySpirit ( http://zdoom.org/wiki/Classes:HolySpirit ) but I got the same problem.

Is it possible to remove this behaviour? Or am I forced to think of a new projectile that does not inherit from MageStaffFX2 or HolySpirit?

RE: Seeking Missiles

Posted: Fri Feb 28, 2014 1:21 pm
by Popsoap
Creating a seeking missile like this is an exact science.

MageStaffFX2 is the best actor to inherit from, but it has a hardcoded ripper effect (it isn't the RIPPER flag).

You have to do something similar to this.

RE: Seeking Missiles

Posted: Fri Feb 28, 2014 2:24 pm
by Konda
Theoretically you can make a projectile that acts like a monster and tries to shoot another projectile when it finds its target, and then disappears. The other projectile should have the SEEKERMISSILE flag and execute A_SeekerMissile() in its spawn state. It should also look the same as the first projectile. That way it looks like first projectile finds targets and follows them on its own, but it's actually 2 projectiles, the first one finding a target and deleting itself shortly after firing the second projectile which has the homing properties.

EDIT: I haven't covered one case - if the second projectile's target dies before it manages to hit the target. In that case you can make the second projectile fire the first projectile (the one that looks for targets) in the direction the second projectile is flying, and then disappear. Checking if a target is dead is simple - you can use A_JumpIfInTargetInventory, with the inventory type being "health".

RE: Seeking Missiles

Posted: Fri Feb 28, 2014 2:31 pm
by -Jes-
Unfortunately, the highly useful flag SMF_LOOK, which does exactly what you want, is not supported by Zandronum 1.2.
If the other methods noted above are not helpful, then you will have to wait for Zandronum 2.0 to hit official release.