GetActorZ

From ZDoom Wiki

Jump to: navigation, search

int GetActorZ (int tid)

Usage

This returns the Z coordinate of the actor. It will return the absolute height of the actor, not the height off the floor. To calculate the height off the floor, subtract GetActorFloorZ from this value.

Parameters

  • tid
TID of the actor.

Return value

The Z coordinate of the actor, as an fixed point value world coordinate.

Examples

This script rains health potions on the player from above for a while.

script 1 (int count)
{
    while (count-- > 0)
    {
        Delay (random (5, 15));
        Spawn ("HealthBonus",
            GetActorX (0),
            GetActorY (0),
            GetActorZ (0) + 256.0, 0, 0);
    }
}

Be careful as Spawn will not work when the spawning position is not valid.

See also GetActorX for other examples of similar commands.

Personal tools