Htextra: Difference between revisions
No edit summary |
TrooperDan (talk | contribs) No edit summary |
||
Line 7: | Line 7: | ||
If the actor in question is a [[useractor]] enemy, it will not count damage higher than the actor health. | If the actor in question is a [[useractor]] enemy, it will not count damage higher than the actor health. | ||
sets TEMP to the amount of damage [[THISACTOR]] will take from the weapon currently hitting it. This amount can be modified before the actor | sets TEMP to the amount of damage [[THISACTOR]] will take from the weapon currently hitting it. This amount can be modified before the actor processes any damage. If you want no damage be taken, set to -1 (the default value), not 0. | ||
Modifying the htextra value can be used to increase, decrease, or otherwise simulate damage from a weapon. | |||
The commands ifhitweapon and ifdead return if this value is positive, so setting it to a positive value will register as damage. Important note: the ifhitweapon CON command will cause the actor to process damage, decreasing the actor's extra member by the amount of htextra and resetting htextra to -1. Therefore, in order to modify damage taken by an enemy, manipulation of htextra should occur in the actor's code before a call to ifhitweapon is made. | |||
[[Category:Sprite structure members]] | [[Category:Sprite structure members]] |
Revision as of 11:36, 23 August 2016
htextra is the amount of damage to be incurred by the weapon that is currently hitting the actor in question.
Example:
getactor[THISACTOR].htextra TEMP
If the actor in question is a useractor enemy, it will not count damage higher than the actor health.
sets TEMP to the amount of damage THISACTOR will take from the weapon currently hitting it. This amount can be modified before the actor processes any damage. If you want no damage be taken, set to -1 (the default value), not 0.
Modifying the htextra value can be used to increase, decrease, or otherwise simulate damage from a weapon. The commands ifhitweapon and ifdead return if this value is positive, so setting it to a positive value will register as damage. Important note: the ifhitweapon CON command will cause the actor to process damage, decreasing the actor's extra member by the amount of htextra and resetting htextra to -1. Therefore, in order to modify damage taken by an enemy, manipulation of htextra should occur in the actor's code before a call to ifhitweapon is made.