On making a homing rocket launcher

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!)
Post Reply
User avatar
Retraux Squid
Posts: 230
Joined: Sat Aug 13, 2016 8:41 pm
Location: E1M1

On making a homing rocket launcher

Post by Retraux Squid »

I'm aiming to make a DECORATE-based alt-fire for the vanilla rocket launcher featuring weaker missiles homing in on the crosshair (this mode toggled on and off by right-clicking) but I'm at a loss as to how I'd go about programming the weapon to fire a missile following the crosshair itself. Any pointers to get me on the right track? Thanks!
User avatar
ramon.dexter
Posts: 1529
Joined: Tue Oct 20, 2015 12:50 pm
Graphics Processor: nVidia with Vulkan support
Location: Kozolupy, Bohemia

Re: On making a homing rocket launcher

Post by ramon.dexter »

I think this cannot be achieved by decorate only.
Maybe only by zscript, but decorate will need the help of acs, since it lacks many crucial functions.
User avatar
kodi
 
 
Posts: 1355
Joined: Mon May 06, 2013 8:02 am

Re: On making a homing rocket launcher

Post by kodi »

You can do this in decorate only if you want to I think. Shoot a puff with a bullet attack. The puff calls A_TransferPointer to set itself as the player's Tracer or Master. Then fire a missile right after. The missile uses the same function to set its Target's Tracer/Master as it's own Tracer, and then you can do the usual seeker missile stuff. Should work, as ugly as it is.
User avatar
Ravick
Posts: 2003
Joined: Sun Aug 22, 2010 10:59 pm
Location: Tubarão, Brasil
Contact:

Re: On making a homing rocket launcher

Post by Ravick »

kodi wrote:You can do this in decorate only if you want to I think. Shoot a puff with a bullet attack. The puff calls A_TransferPointer to set itself as the player's Tracer or Master. Then fire a missile right after. The missile uses the same function to set its Target's Tracer/Master as it's own Tracer, and then you can do the usual seeker missile stuff. Should work, as ugly as it is.
If ACS is allowed, you could also give a TID to the puff, and order the missile to attack it. :)
User avatar
Amuscaria
Posts: 6628
Joined: Mon Jul 26, 2004 12:59 pm
Location: Growing from mycelium near you.

Re: On making a homing rocket launcher

Post by Amuscaria »

kodi wrote:You can do this in decorate only if you want to I think. Shoot a puff with a bullet attack. The puff calls A_TransferPointer to set itself as the player's Tracer or Master. Then fire a missile right after. The missile uses the same function to set its Target's Tracer/Master as it's own Tracer, and then you can do the usual seeker missile stuff. Should work, as ugly as it is.
I think Ghastly made something like this a while ago for Strife, IRC.
User avatar
Matt
Posts: 9696
Joined: Sun Jan 04, 2004 5:37 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Debian Bullseye
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
Contact:

Re: On making a homing rocket launcher

Post by Matt »

Ravick wrote:If ACS is allowed, you could also give a TID to the puff, and order the missile to attack it. :)
This sounds like a plan.

Weapon: fires missile

Missile: continually points towards the first actor it is aware of with TID 99000 (plus playernumber)

Weapon: continually shoots hitscans that do no damage and spawn invisible puffs

Puffs: assign themselves TID 99000 (plus target's playernumber), last a couple tics and go away
User avatar
insightguy
Posts: 1730
Joined: Tue Mar 22, 2011 11:54 pm

Re: On making a homing rocket launcher

Post by insightguy »

Matt wrote:Puffs: assign themselves TID 99000 (plus target's playernumber), last a couple tics and go away
[/quote]

I just realized, if a monster where to, say, have a continuous hitscan attack that produces a puff with the same TID, is it possible to have a sort of looney toons back and forth with a rocket? :D
User avatar
Matt
Posts: 9696
Joined: Sun Jan 04, 2004 5:37 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Debian Bullseye
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
Contact:

Re: On making a homing rocket launcher

Post by Matt »

Tbh I have no idea, I just assumed it would pick the first one and stick with it.
User avatar
Ravick
Posts: 2003
Joined: Sun Aug 22, 2010 10:59 pm
Location: Tubarão, Brasil
Contact:

Re: On making a homing rocket launcher

Post by Ravick »

I guess it won't be a problem. It was basically what I've done for the flashlight's light beam in Mindfuck in order to it to troll lost souls: https://www.youtube.com/watch?v=bQkRq9qKiEI (I'm not "embedding" the video to avoid waste people's bandwidth and stuff.)
Post Reply

Return to “Scripting”