Making all projectiles shootable

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
JohnnyTheWolf
Posts: 1192
Joined: Mon Oct 05, 2015 8:37 am

Making all projectiles shootable

Post by JohnnyTheWolf »

Hello everyone,

Using Beed28's fantastic Contra Doom as reference, I sought to make the Cyberdemon rockets and the Revenant missiles shootable.
Spoiler:
This worked well, but I am struggling to replicate this with other projectile types. I have found the following entry on the ZDoom wiki, but I do not quite understand the instructions.

Would someone more experienced in scripting than I be kind enough to walk me through this?

Thanks in advance!
JohnnyTheWolf
Posts: 1192
Joined: Mon Oct 05, 2015 8:37 am

Re: Making all projectiles shootable

Post by JohnnyTheWolf »

Got my answer on the Discord server. I will share my findings here for newcomers who might come in here asking the same question:

Disregard the script for the custom Cyberdemon actor above. Instead just go with:

ACTOR CyberdemonRocket : Rocket replaces Rocket { Health 1 //Die in one shot +SHOOTABLE //Can be hurt by hitscans and projectiles +NOBLOOD //Won't bleed when shot +CANTSEEK //Seeker missiles won't seek it +THRUSPECIES //Do not collide with your own species +DONTTHRUST //Won't be pushed when shot -NOBLOCKMAP //Needs to be in the blockmap to get shot Mass 10000000 States { Death: TNT1 A 0 A_ChangeFlag("SHOOTABLE",0) Goto Super::Death } }

and you are set - for both the Cyberdemon, the Tyrant and your own rocket launcher!

Use the same template for other projectiles, e.g. ACTOR ShootableCacoBall : Cacodemonball replaces cacodemonball

Many thanks to CarThief and Agent_Ash!

EDIT: The Mancubus is a special case, as it shoots two projectiles at once and as such they cancel each other when used the script above. Use this instead:

ACTOR ShootableFatShot : FatShot replaces FatShot { Species "FatShot" //Yes, this is needed! Health 1 +SHOOTABLE +NOBLOOD +CANTSEEK +THRUSPECIES +DONTTHRUST -NOBLOCKMAP States { Death: TNT1 A 0 A_ChangeFlag("SHOOTABLE",0) Goto Super::Death } }

Thanks Fishytza!
JohnnyTheWolf
Posts: 1192
Joined: Mon Oct 05, 2015 8:37 am

Re: Making all projectiles shootable

Post by JohnnyTheWolf »

EDIT: Upon further examination, it looks like there is nothing wrong with the D64 Archvile's height. It is just this huge! :shock:

I am playing Unseen Evil with the mod I made using the code above - which I named "NASMR" - and I am noticing the following issue:

The Arch-Vile is now taller - about as tall as the Cyberdemon! -
and uses more frames. I was able to fix the latter by adding the code in red (and separate "VILE Z[\" in three lines to avoid a SC_GetNumber: Bad numeric constant error) and converting it to DECORATE.
Spoiler:
Which leaves me with the Arch-Vile's height. Does anyone know what is causing this?
Post Reply

Return to “Scripting”