ActivatorTID

From ZDoom Wiki
Jump to navigation Jump to search

int ActivatorTID (void)

Usage

Returns the TID of the actor that activated the script.

Return value

The TID of the actor that activated the script.

Examples

Can be used for a line that monsters can trigger, to see if a monster triggered it.

script 1 (void)
{
    if (ActivatorTID () == 999)
        Print (s:"You are not a zombie");
    else
        DamageThing (0); // kill it
}

script 10 ENTER
{
    Thing_ChangeTID (0, 999);
}

The ENTER script sets the player TIDs to 999 (as 0 usually implies the activator of the script). The script number 1 checks if the activator has a TID of 999, as in, is a player, and if so tells them so. Otherwise it kills them.

This could be helpful if you had scripted marines as your allies, and did not want them to be subjected to the same treatment as other monsters.