GetActorProperty
From ZDoom Wiki
int GetActorProperty (int tid, int property)
Usage
Returns the value of the specified property of the actor.
Parameters
- tid
- TID of the actor. Use 0 to refer to the activator.
- property
- The property to get, one of:
- APROP_Health
- Actor's current health.
- APROP_Speed
- Actor's speed (not the current speed).
- For monsters, this is the distance they move every time A_Chase is called.
- For projectiles, this is the distance they move each tic.
- For players, this is multiplied by the player's class speed to determine the final speed the player will move for each tic that they have a movement key held down. Consequently, the standard APROP_Speed for a player is always 1.0, not what their actual speed is.
- APROP_Damage
- Actor's missile damage.
- APROP_Alpha
- Alpha value for the translucent render styles.
- APROP_RenderStyle
- How the actor is rendered:
- STYLE_None (do not draw)
- STYLE_Normal (normal - just copy the image to the screen)
- STYLE_Fuzzy (draw silhouette using "fuzz" (spectre) effect)
- STYLE_SoulTrans (draw translucent with alpha amount in r_transsouls)
- STYLE_OptFuzzy (draw as fuzzy or translucent, based on user preference)
- STYLE_Translucent (draw translucent)
- STYLE_Add (draw additive translucent)
- APROP_Ambush
- Whether the actor's Ambush flag is set or not.
- APROP_Invulnerable
- Actor will not lose any health.
- APROP_JumpZ
- Player's jump speed as an fixed point value.
- APROP_ChaseGoal
- Walks to goal instead of target if a valid goal is set.
- APROP_Frightened
- Monster runs away from player.
- APROP_SpawnHealth
- The current max health of the actor.
Return value
The value of the specified property of the actor.
Examples
This script checks for a few different properties and prints helpful messages about them.
script 1 (int tid)
{
if (GetActorProperty (tid, APROP_Health) <= 25)
print (s:"Thing ", d:tid, " has less than 26 health!!");
if (GetActorProperty (12, APROP_RenderStyle) == STYLE_OptFuzzy)
print (s:"Thing 12 is probably a spectre!");
}

