Arrow sticking behaviour: Difference between revisions

From The DarkMod Wiki
Jump to navigationJump to search
Crispy (talk | contribs)
New page: 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_Types#What...
 
Crispy (talk | contribs)
usage examples
Line 9: Line 9:


To force arrows to never stick in an entity, set the spawnarg '''arrowsticking_disabled''' like so: "arrowsticking_disabled" "1"
To force arrows to never stick in an entity, set the spawnarg '''arrowsticking_disabled''' like so: "arrowsticking_disabled" "1"
* Usage example: There are sometimes instability problems with certain ragdolls (AFs) when they have arrows fired into them. arrowsticking_disabled provides a quick and dirty way to get around this.


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.
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.
* Usage example: Suppose you've given an AI a wooden shield to carry. Since the shield is attached to the AI, arrows won't normally stick in it, according to the rules above. To fix this, you can set "arrowsticking_forceenabled" "1" on the shield.


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).
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).

Revision as of 07:03, 14 July 2008

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"

  • Usage example: There are sometimes instability problems with certain ragdolls (AFs) when they have arrows fired into them. arrowsticking_disabled provides a quick and dirty way to get around this.

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.

  • Usage example: Suppose you've given an AI a wooden shield to carry. Since the shield is attached to the AI, arrows won't normally stick in it, according to the rules above. To fix this, you can set "arrowsticking_forceenabled" "1" on the shield.

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.