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!)
ACTOR CyberdemonRocket : Rocket
{
Health 1
+SHOOTABLE
+NOBLOOD
+CANTSEEK
+DONTHARMSPECIES
-NOBLOCKMAP
Mass 10000000
States
{
Death:
TNT1 A 0 A_ChangeFlag("SHOOTABLE",0)
Goto Super::Death
}
}
ACTOR NewRevenantTracer : RevenantTracer replaces RevenantTracer
{
Health 1
+SHOOTABLE
+NOBLOOD
+CANTSEEK
+DONTHARMSPECIES
-NOBLOCKMAP
Mass 10000000
States
{
Death:
TNT1 A 0 A_ChangeFlag("SHOOTABLE",0)
Goto Super::Death
}
}
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?
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
}
}
EDIT: Upon further examination, it looks like there is nothing wrong with the D64 Archvile's height. It is just this huge!
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:
ACTOR NewArchvile : Archvile replaces Archvile
{
States
{
Missile:
VILE G 0 BRIGHT
VILE G 1 BRIGHT A_FaceTarget
VILE H 4 BRIGHT A_FaceTarget
VILE IJKLMN 4 BRIGHT A_FaceTarget
VILE O 4 BRIGHT A_CustomMissile("VileBomb",1)
VILE P 10 BRIGHT
Goto See
Heal:
VILE Z 10 BRIGHT
VILE [ 10 BRIGHT
VILE \ 10 BRIGHT
Goto See
Pain:
VILE R 5
VILE R 5 A_Pain
Goto See
Death:
VILE S 7
VILE T 7 A_Scream
VILE U 7 A_NoBlocking
VILE VWX 7
VILE Y -1
Stop
}
}
ACTOR VileBomb
{
+Missile
+DROPOFF
+NOTELEPORT
+RANDOMIZE
+RIPPER
+NOEXPLODEFLOOR
+FLOORHUGGER
Damage (0)
Speed 16
SeeSound "vile/firestrt"
States
{
Spawn:
TNT1 AAAAAAAAAAAAAAAAAA 4 A_SpawnItem("VileBombBoom") //Lasts 72 tics; just over 2 seconds
Stop
Death:
TNT1 A 0
Stop
}
}
ACTOR VileBombBoom
{
Radius 11
Height 8
Speed 0
+NOCLIP
RenderStyle Add
Alpha 1
YScale 0.5
States
{
Spawn:
TNT1 A 1
TNT1 A 0 A_PlaySound("vile/firestrt")
TNT1 A 0 A_Explode(70,24,0,0,1)
Doop:
FIRE B 0 A_SetScale(1,(scaleY + 0.5))
FIRE B 0 A_FadeOut(0.1)
FIRE B 2 BRIGHT
loop
}
}
ACTOR VileSpawnFire : SpawnFire
{
States
{
Spawn:
FIRE ABCDEFGH 4 Bright A_Fire
Stop
}
}
Which leaves me with the Arch-Vile's height. Does anyone know what is causing this?