ACSUtils Wiki

An ACS library for ZDoom-based ports

User Tools

Site Tools


new:player

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
new:player [2018/02/20 16:49] korshunnew:player [2018/02/20 18:36] korshun
Line 1: Line 1:
 +~~NOCACHE~~
 ====== Player utilities ====== ====== Player utilities ======
  
Line 11: Line 12:
 Also, remember that "no player" is player number -1, while player number 0 is the first player. Also, remember that "no player" is player number -1, while player number 0 is the first player.
  
 +===== SetActivatorToPlayer2 =====
  
-===== Actor information =====+''int SetActivatorToPlayer2(int player)''
  
-==== ActorPlayerNumber ====+A replacement for both [[zdoom>SetActivator]] with ''AAPTR_PLAYERx'' and [[zan>SetActivatorToPlayer]] that works in any port.
  
-''int ActorPlayerNumber(int tid)'' +[[zdoom>SetActivator]] with ''AAPTR_PLAYERx'' only supports up to 8 playerswhile [[zan>SetActivatorToPlayer]] isn't supported in ZDoomThis function attemps to use ''SetActivatorToPlayer'', and then ''SetActivator(AAPTR_PLAYERx)''This wayit works in both ZDoom and Zandronum.
- +
-If the actor is a playerreturns its player number. Otherwise returns -1. +
- +
-==== IsPlayer ==== +
- +
-  * ''bool IsPlayer()'' +
-  * ''bool ActorIsPlayer(int tid)'' +
- +
-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 numberor ''TEAM_NONE''. Shorthand for ''GetPlayerInfo(player, PLAYERINFO_TEAM)''.+
  
  
Line 67: Line 46:
  
   * ''int PickRandomTeamPlayer(int team)'' -- pick a random in-game player from the team.   * ''int PickRandomTeamPlayer(int team)'' -- pick a random in-game player from the team.
 +
 +
 +===== Actor information =====
 +
 +==== ActorPlayerNumber ====
 +
 +''int ActorPlayerNumber(int tid)''
 +
 +If the actor is a player, returns its player number. Otherwise returns -1.
 +
 +==== IsPlayer ====
 +
 +  * ''bool IsPlayer()''
 +  * ''bool ActorIsPlayer(int tid)''
 +
 +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)''.
 +
  
  
new/player.txt · Last modified: 2018/02/21 14:29 by korshun