Squirrly missiles?

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!)
Okgo5555
Posts: 77
Joined: Thu Mar 23, 2017 11:18 am

Squirrly missiles?

Post by Okgo5555 »

I was looking for answers on the "how do I... thread", but it appears to be closed? Anyway, I have been trying to make my sort of "devietator/mini rocket launcher" weapon shoot rockets that behave a bit squirrly (ala the revenant's rockets in DooM 2016) is such a thing possible? Is there a code pointer that I am maybe not familiar with? It sort of kills the asthetich of what I am going for to have the rockets fly in a straight line to their spread angles.
User avatar
wildweasel
Posts: 21643
Joined: Tue Jul 15, 2003 7:33 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): A lot of them
Graphics Processor: Not Listed

Re: Squirrly missiles?

Post by wildweasel »

The "How Do I" thread was closed to encourage users to start new topics for editing questions - further, the Editing forum was split into several subsections to help organize them better. I've moved your question into Scripting, as that is the best fit for it.
User avatar
Matt
Posts: 9695
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

Re: Squirrly missiles?

Post by Matt »

Cheapest way to do it: call the following ZScript every frame that the projectile is in the air:

Code: Select all

---- A 0 {vel+=(frandom(-1,1),frandom(-1,1),frandom(-1,1));} 
(or whatever #s you want - you can even create a bias (using [wiki]A_ChangeVelocity[/wiki] for a left or right bias))

[wiki]A_Weave[/wiki] is handy too.
Okgo5555
Posts: 77
Joined: Thu Mar 23, 2017 11:18 am

Re: Squirrly missiles?

Post by Okgo5555 »

I feel bad. I found A_Weave right after posted this. I'm working on something very "vanilla" and unintrusive so I am just doing some DECORATE hackiness so that everything sort of stays true to the 90's. That, and I haven't hopped on to the cool new "ZScript" bandwagon yet. haha.
Okgo5555
Posts: 77
Joined: Thu Mar 23, 2017 11:18 am

Re: Squirrly missiles?

Post by Okgo5555 »

It has alot to do with how unfamiliar I am with the code pointers from Hexen and Heretic. I barely played those games when I was younger and I certainly never modded them in any way.

Return to “Scripting”