Table of Contents

Player utilities

Stuff related to dealing with players and teams.

Constants

Also, remember that “no player” is player number -1, while player number 0 is the first player.

SetActivatorToPlayer2

bool SetActivatorToPlayer2(int player)

A replacement for both SetActivator with AAPTR_PLAYERx and SetActivatorToPlayer that works in any port.

SetActivator with AAPTR_PLAYERx only supports up to 8 players, while SetActivatorToPlayer isn't supported in ZDoom. This function attemps to use SetActivatorToPlayer, and then SetActivator(AAPTR_PLAYERx). This way, it works in both ZDoom and Zandronum.

Player classification

Functions to count various classes of players:

Functions to pick a random player:

Actor information

ActorPlayerNumber

int ActorPlayerNumber(int tid)

If the actor is a player, returns its player number. Otherwise returns -1.

IsPlayer

Returns true if the actor is a player.

Player information

PlayerName

str PlayerName(int player)

Returns the player's name. Shorthand for StrParam(n:player + 1).

GetPlayerTeam

int GetPlayerTeam(int player)

Returns the player's team number, or TEAM_NONE. Shorthand for GetPlayerInfo(player, PLAYERINFO_TEAM).

Team information

TeamPlayerCount

int TeamPlayerCount(int team)

Returns the number of players on the specified team. Shorthand for GetTeamProperty(team, TPROP_NumPlayers).

ConsolePlayer shorthands