Easy headshots in decorate

Sun Mar 28, 2021 12:15 am

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