SetHealth (script event)

Game class

This event operates on an instance of the game class type idEntity

Description

Set the health of the associated entity via the health spawn argument. (i.e. item, NPC, etc.)

Usage

void setHealth( float health )

Parameters

  • health

A value which specifies the health of the associated entity.

Examples

 none

Notes

Along with setting the health variable, the event has the following implementation for different games:

Note: Doom 3 only:
Is an event on idAI only: Calling this event will set the takesdamage flag of the entity to true.
Note: Quake 4 only:
Event on idEntity.
Event on idPlayer: clamps to max health.
Event on idAI: Calling this event will set the takesdamage flag of the entity to true.
Note: Enemy Territory: Quake Wars only:
Event on idPlayer, calls script object function OnHealed if health is set greater than current and greater than 0.
Event on idProjectile.
sdScriptEntity: Calls script object function OnPostDamage **