Jump to content

Player Property

From OpenBOR
Revision as of 13:08, 20 July 2026 by Dcurrent (talk | contribs) (Created page with "== Introduction == Player property is API interface for OpenBOR's player structure. This structure is responsible for tracking player game state, lives, credits, control inputs, and transferable status between player controlled entities. Each player has an independent instance of the player structure maintained globally. == Obtaining Object == The player property is a global array of structures referenced by player index. === Single Access === You may obtain the point...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Introduction

Player property is API interface for OpenBOR's player structure. This structure is responsible for tracking player game state, lives, credits, control inputs, and transferable status between player controlled entities. Each player has an independent instance of the player structure maintained globally.

Obtaining Object

The player property is a global array of structures referenced by player index.

Single Access

You may obtain the pointer to individual structures as an openborvariant(). Note this is a legacy method, and should never be used when you need to scan each player. Use the collection access method below.

Player one is exposed as openborvariant("player").

// Get player one structure.
void player_1 = openborvariant("player");

To get other players, add numeric to the call:

/* Get player structures. */

void player_1 = openborvariant("player1");

void player_2 = openborvariant("player2");

void player_3 = openborvariant("player3");

void player_4 = openborvariant("player4");

Collection Access

Obtain the player collection array pointer.

void player_collection = openborvariant("player_collection");