Members of the player structure: Difference between revisions

From EDukeWiki
Jump to navigation Jump to search
m Typo fix
Text changes
Line 1: Line 1:
Player Member Functions effect the players in the game by their player id.
The various members of the player structure affect various aspects of the player, and manipulating their values is a very important aspect of scripting in EDuke32.  Values can be retrieved from the game's internal player structures and stored in a [[gamevar]] with the [[getplayer]] command, and the [[setplayer]] command allows you to set any of the player structure member's value to that of a gamevar.


Syntax:
Here is the list of members of the player structure:
 
<get/set>player[<player id>].<functionname> <gamevar>
 
<get/set> - [[getplayer]] to set the [[gamevar]] <gamevar> to the value of <functionname>. [[setplayer]] to set the value of <functionname> to the gamevar <gamevar>.
 
<player id> is the reference number for a player. if you only care about single player then use [[THISACTOR]] to reference the one and only player. In multiplayer using THISACTOR will refer to the current player which for actor code is defined as the nearest player. In display events (nonsynchronsised) use screenpeek. There is almost never any reason to use [[myconnectindex]].
 
be warned that the use of THISACTOR as a player id in <get/set>player is a special case IE the following are NOT equivilent (and the second one won't do anything useful).
 
<get/set>player[THISACTOR].<functionname> <gamevar>
 
setvarvar TMP THISACTOR<br>
<get/set>player[TMP].<functionname> <gamevar>
 
<functionname> is the name of the Member Function you want to use.
 
<gamevar> is the [[gamevar]] to get or set the value of.
 
Here is the list of Member Functions for players:  


*[[access_incs]]
*[[access_incs]]

Revision as of 03:27, 8 September 2006

The various members of the player structure affect various aspects of the player, and manipulating their values is a very important aspect of scripting in EDuke32. Values can be retrieved from the game's internal player structures and stored in a gamevar with the getplayer command, and the setplayer command allows you to set any of the player structure member's value to that of a gamevar.

Here is the list of members of the player structure: