GetActorZ

From ZDoom Wiki
Jump to navigation Jump to search

fixed GetActorZ (int tid)

Usage

This returns the Z coordinate of the actor. If tid is 0, the function uses the activator. It will return the absolute height of the actor, not the height relative to the floor. To calculate the height of the floor, subtract the result of GetActorFloorZ from this value.

Parameters

  • tid: TID of the actor.

Return value

The Z coordinate of the actor as a 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