Player
Written by: Alian713, Kramb
1. xsEffectAmount¶
Returning Type: void
Prototype: void xsEffectAmount(int effectId, int objectOrTechnologyId, int attributeOrOperation, float value, int playerNumber)
Parameters:
int effectId: The ID of the effect to use. See the Effect Type and Technology Attribute constantsint objectOrTechnologyId: The ID of the object, unit, or technology to effectint attributeOrOperation: The attribute to modify or the operation to perform, See the Effect Operation constantsfloat value: The value of the effect- (Optional)
int playerNumber: The player to apply the effect to. If unspecified, applies to all players except Gaia.
Change the specified attribute of the specified object or technology by the value for the specified player. Note that values for certain attributes such as sound events require to be passed after being converted using bitCastToFloat.
2. xsGetPlayerUnitIds¶
Returning Type: int
Prototype: int xsGetPlayerUnitIds(int playerId, int objectOrClassId, int arrayId)
Parameters:
int playerId: The player to get the unit IDs forint objectOrClassId: The ID of the object or class to get the unit reference IDs for- (Optional)
int arrayId: Reuse an existing array to save memory
Returns an array of unit IDs on the map for the given player and the specified object ID or class. The IDs here are the same as the reference_id used by the scenario editor
3. xsGetHandicapMultiplier¶
Returning Type: float
Prototype: float xsGetHandicapMultiplier(int playerId)
Parameters:
int playerId: The player to get the handicap for
Returns the handicap multiplier for the given player (a float between 1 and 2)
4. xsGetWorldPlayerId¶
Returning Type: int
Prototype: int xsGetWorldPlayerId(int scxPlayerId)
Parameters:
int scxPlayerId: The player to get the world index (lobby slot) for
Returns the lobby slot corresponding to the player number (usually the same as color) in the scenario.
5. xsGetPlayerCivilization¶
Returning Type: int
Prototype: int xsGetPlayerCivilization(int playerNumber)
Parameters:
int playerNumber: The player to get the civilization of
Returns the civilization ID of the given player. Refer to the Constant Reference for all the different civ IDs
6. xsGetPlayerInGame¶
Returning Type: bool
Prototype: bool xsGetPlayerInGame(int playerNumber)
Parameters:
int playerNumber: Check if this player is still alive
Returns true if the player given is still alive, and false otherwise.
7. xsGetPlayerNumberOfTechs¶
Returning Type: int
Prototype: int xsGetPlayerNumberOfTechs(int playerNumber)
Parameters:
int playerNumber: The player whose technology count is being requested.
Returns the number of technologies available to the player in the entire game.
8. xsPlayerAttribute¶
Returning Type: float
Prototype: float xsPlayerAttribute(int playerNumber, int resourceId)
Parameters:
int playerNumber: The player to get the resource of (0 for Gaia)int resourceId: The ID of the resource to get the amount of
Returns the amount the specified resource of the given player.
9. xsSetPlayerAttribute¶
Returning Type: void
Prototype: void xsSetPlayerAttribute(int playerNumber, int resourceId, float value)
Parameters:
int playerNumber: The player to set the resource of (0 for Gaia)int resourceId: The ID of the resource to set the amount offloat value: The amount to set the resource to
Sets the amount of the specified resource of the given player to the provided value.
10. xsGetPlayerName¶
Returning Type: string
Prototype: string xsGetPlayerName(int playerId)
Parameters:
int playerId: The lobby index of the player
Returns the given player's name.
11. xsGetPlayerType¶
Returning Type: int
Prototype: int xsGetPlayerType(int playerId)
Parameters:
int playerId: The player to get the type for
Returns the type of player. Refer to the Constant Reference for all the different player types
12. xsGetDiplomacy¶
Returning Type: int
Prototype: int xsGetDiplomacy(int sourcePlayerId, int targetPlayerId)
Parameters:
int sourcePlayerId: The player to get the stance forint targetPlayerId: The player to get the stance towards
Returns the source player's stance towards the target player
13. xsSetDiplomacy¶
Returning Type: bool
Prototype: bool xsSetDiplomacy(int sourcePlayerId, int targetPlayerId, int diploStance, bool mirror)
Parameters:
int sourcePlayerId: The player to set the stance forint targetPlayerId: The player to set the stance towardsint diploStance: The stance to set- (Optional)
bool mirror: If true, make the target player set their stance towards the source player to the same.
Sets the diplomacy of source player towards the target player
14. xsGetDifficulty¶
Returning Type: int
Prototype: int xsGetDifficulty()
Returns the difficulty setting for the game. Refer to the Constant Reference for all the different difficulty IDs