Arrow sticking behaviour
Broadhead arrows will stick into some objects they hit. Here is a description of the logic behind whether or not an arrow sticks in.
- The most important thing is the surface type of the object. Arrows will only stick into "soft" surfaces; for example, flesh, wood, and dirt, among others.
- Arrows will not stick into living AIs. This is to avoid guards sauntering around with dirty great arrows sticking out of their chests, which looks silly. Note that an arrow which kills an AI will stick, even if the AI was alive before being shot.
- Arrows will not stick into objects attached to living AIs, principally because this includes AI heads.
- You can override some of these rules using two spawnargs, arrowsticking_forceenabled and arrowsticking_disabled, which are documented below.
Overriding arrow-sticking behaviour
To force arrows to never stick in an entity, set the spawnarg arrowsticking_disabled like so: "arrowsticking_disabled" "1"
To force arrows to always stick in an entity, provided that the surface type is soft, you can set the spawnarg arrowsticking_forceenabled like so: "arrowsticking_forceenabled" "1". However, arrows will still break rather than sticking into the entity's hard surfaces, if it has any.
AI heads are usually separate entities from AI bodies, so if you change these spawnargs for an AI entity make sure to also change the spawnargs for its head entity (if it has one).
Info for coders
This logic is in tdm_weapon_arrow_result_base.script. The active() method is called when an arrow hits a soft surface; dud() is called if it hits a hard surface.