Easy headshots in decorate

Handy guides on how to do things, written by users for users.

Moderators: GZDoom Developers, Raze Developers

Forum rules
Please don't start threads here asking for help. This forum is not for requesting guides, only for posting them. If you need help, the Editing forum is for you.
Posts: 3
Joined: Sat Mar 27, 2021 11:55 pm
Graphics Processor: nVidia (Modern GZDoom)

Easy headshots in decorate

Post by RubenMelo »

so i don't know if someone already posted this before also this is my first post so I don't know if this is the right place to post it basically is a very simple hitbox trick to simulate headshots or head hitboxes

First, you create a simple actor that will be your hitbox

ACTOR Headhitbox
health 30
Radius 22 //supossing your main actor has 20 radius
Height 16
Damagetype Headshot // not necessary unless you want to do some custom death states
scale 0.8 // just for debug to see if the "hitbox" is in the correct place
+NODAMAGETHRUST // make so when the hitbox explodes it doesn't thrust the main actor AKA monster
TNT1 A 0 A_EXPLODE(60,4,0,0,0,0,0,0,"Headshot")//this is a very tiny explosion with just enough damage too kill the main actor it's attached to
HITB A 0 A_NoBlocking

then next thing is on the actor/monster you hant the hit box to be attached, all you need to do is a custom spawn state

TNT1 A 0
TNT1 A 0 a_SpawnItemEx("HEADHITBOX",0,0,0,0,0,0,0,SXF_SETMASTER) // spawn the hitbox and set as master
Goto Idle // new "spawn" state

SCZA AB 10 A_Look // standard spawn actions

so is a very simple trick and work very well, if you want your hitbox to be smaller than the Monster diameter you can, but normal hitscan won't reach it they will collide with the actor hitbox first, to counter that you can use railguns instead of normal hitscan, and limiting the penetration to 2 so it goes thru the actor hitbox and hit the fake head hitbox, and you can do all sorts of stuff like custom damage types and pain states, etc of even multiple hitboxes in a single actor like legs, torso, and head. is up to your creativity, also you may have to tweak where the hitbox spawn inside the actor or it heigh and radios to work better with your custom sprites or monsters my example is based on an imp size and radius
User avatar
Posts: 47
Joined: Sun Jan 17, 2021 3:41 am
Graphics Processor: Intel (Modern GZDoom)
Location: Aussieland - 3D REALMS OG DESIGNER

Re: Easy headshots in decorate

Post by Gunslaher_Pi »

This is all good and well. Actually got a proper display of script? When posting script, ensure all indentations are accurate and your code is viable.

We can't be expected to "fill in the gaps".

Return to “Tutorials”