GetPlayerVal

Category: Get*Val
Since engine version: 1.0 OC

Description

Retrieves properties of a player by way of the name under which they are stored in the Game.txt component of a savegame.

Syntax

any GetPlayerVal(string entry, string section, int player, int entry_number);

Parameters

entry:
Name of the entry to be retrieved.
section:
[opt] Section of the entry to be retrieved. If not specified, all sections will be searched for an entry of the specified name.
player:
[opt] Number of the player of which you want to retrieve an entry.
entry_number:
[opt] Index of the value to be retrieved if an entry contains multiple values.

Remarks

Warning: the retrieved values may not be synchronization safe, meaning they may differ from computer to computer in a network game. Using these values may cause sync loss in a network game.
Most useful applications for entry are already implemented in System.ocg/GetXVal.c.

Example

Log("Player %d has %d objects!", player, GetPlrObjectsOwned(player));
Writes the number of objects owned by this player into the log file.
See also: GetActMapVal, GetDefCoreVal, GetObjectInfoCoreVal, GetObjectVal, GetPlayerInfoCoreVal, GetScenarioVal
PeterW, 2002-04