GetActorZ

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

This article is issued from Zdoom. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.