Thing_ChangeTID

From ZDoom Wiki

Jump to: navigation, search

176:Thing_ChangeTID (oldtid, newtid)

If oldtid is zero, then whatever activated the script will have its TID changed to newtid. If oldtid is non-zero, then everything with the TID oldtid will have their TID changed to newtid.

One of the primary uses for this special is to give a player a TID using a script like this:

script 100 enter
{
    Thing_ChangeTID (0, 1337+PlayerNumber());
}

This will give player 1 the TID 1337, player 2 the TID 1338, player 3 the TID 1339, and so on.

Use this script for multiplayer levels:

script 256 respawn
{
    Thing_ChangeTID(0, PlayerNumber()+256);
}

script 257 death
{
    Thing_ChangeTID(0, 0);
}

script 258 enter
{
    Thing_ChangeTID(0, PlayerNumber()+256);
}

This will give player 1 the TID 257, player 2 TID 258, etc. It will cause each player not to have a TID during death.

Personal tools
Namespaces
Variants
Actions
Navigation
ACS
DECORATE
ZDoom mods
Toolbox