GetHealthPercentage

From GECK
Jump to: navigation, search


A function included in the GECK for Fallout 3.

Description

Determines how injured an actor is. Health percentage is measured as a value from 0 to 1.0.

Syntax

[help]
(healthPercent:float) GetHealthPercentage

Example

If JohnDoeRef.GetHealthPercentage < 0.50

Checks to see if John Doe is below 50% of his base health.

Notes

  • Base effects modifying Health actor value such as IncreaseHealth will make the function return values higher than 1.
  • The code that is executed by this function is equivalent to:
float fHealthPerc
int iBaseHealth 

iBaseHealth = actor.GetBaseActorValue Health
if (iBaseHealth)
   fHealthPerc = (actor.GetActorValue Health) / iBaseHealth 
else
   fHealthPerc = 1.0
endif

See Also