GetActorAngle

From ZDoom Wiki

Jump to: navigation, search

int GetActorAngle (int tid)

Usage

Returns the actor's angle.

Parameters

  • tid
TID of the actor.

Return value

The actor's angle as an fixed point angle value.

Examples

This irritating script spins the player round and round for a while when it is activated.

script 1 (int spintime)
{
    while (spintime-- > 0)
    {
        SetActorAngle (100, GetActorAngle (100) + 0.02);
        Delay (1);
    }
}
	
script 10 ENTER
{
    Thing_ChangeTID (0, 100);
}

This script will thrust an actor in the direction the player is facing when executed (assuming the player's tid is 100). This could be used to simulating pushing an actor away from you. The >> 8 function is used to convert fixed point angles to byte angles (see Definitions for more information).

script 2 (void)
{
    ThrustThing (GetActorAngle (100) >> 8, 50, 1, 0);
}
Personal tools