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 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 an fixed point value world coordinate.

If the argument passed is 0, then it returns the Z coordinate of the activator. (development version r2787+ only)

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
Namespaces
Variants
Actions
Navigation
ACS
DECORATE
ZDoom mods
Toolbox