[Solved] Give one Thing ID to all players?!
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
- Tormentor667
- Posts: 13556
- Joined: Wed Jul 16, 2003 3:52 am
- Preferred Pronouns: He/Him
- Operating System Version (Optional): Windows 11
- Graphics Processor: nVidia (Modern GZDoom)
- Location: Germany
- Contact:
[Solved] Give one Thing ID to all players?!
How can I give a certain Thing ID via script to each player? For example I want every player to have the thing id 99, how do I do that?
Last edited by Tormentor667 on Sat Oct 06, 2007 7:44 am, edited 1 time in total.
- The NUtcracker
- Posts: 843
- Joined: Sun Jan 14, 2007 9:12 pm
- Location: South Dakota
- Contact:
Code: Select all
Sript 100 ENTER
{
Thing_ChangeTID(0,99);
}
You'll also need to do this if you intend on making it multiplayer-compatible in order for the tids to always refer to the living players, rather than only the ones that spawned when the map started:This will remove the tid from a player corpse when that player dies, and reassign it to them when they respawn. (It's also a good idea to move the script no.'s above 255 if you don't plan on calling them in the map from a line)
Code: Select all
script 300 ENTER
{
Thing_ChangeTID(0, 99);
}
script 301 DEATH
{
Thing_ChangeTID(0, 0);
}
script 302 RESPAWN
{
Thing_ChangeTID(0, 99);
}
- Tormentor667
- Posts: 13556
- Joined: Wed Jul 16, 2003 3:52 am
- Preferred Pronouns: He/Him
- Operating System Version (Optional): Windows 11
- Graphics Processor: nVidia (Modern GZDoom)
- Location: Germany
- Contact:
Do the JOP!(tm) Come on everybody, do the JOP!(tm)
ANYWAY....
Why would you want every player to have the same TID? You won't be able to single them out for any actions that way.
If you're just using it to determine whether a player triggered a script or something, this will work just as well:
Or just give your players TIDs starting at 9000 or something and make sure nothing has a higher TID. Then you can use an even easier check:
ANYWAY....
Why would you want every player to have the same TID? You won't be able to single them out for any actions that way.

If you're just using it to determine whether a player triggered a script or something, this will work just as well:
Code: Select all
if (ActivatorTID() > 98 && ActivatorTID() < 107) // Player
Code: Select all
if (ActivatorTID() >= 9000) // Player
Don't forget the wonderful function [wiki]PlayerNumber[/wiki]! You can use it to give each player a unique TID in an obvious range with a single script:
And you can use it to determine if a player activated a script:
Code: Select all
script 1 ENTER
{
Thing_ChangeTID(0, 99 + PlayerNumber());
}
Code: Select all
script 2 (void)
{
if( PlayerNumber() != -1 )
{
// Stuff
}
}
- Tormentor667
- Posts: 13556
- Joined: Wed Jul 16, 2003 3:52 am
- Preferred Pronouns: He/Him
- Operating System Version (Optional): Windows 11
- Graphics Processor: nVidia (Modern GZDoom)
- Location: Germany
- Contact: