Players¶
You can use the player manager to edit many player related attributes.
Editing¶
Here's an example of how to view a player and edit their starting civilization, architecture and resources.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
|
Players have many attributes, below is a list of most of their attributes which you can change.
Attribute name | Type | Dataset | Attributes |
---|---|---|---|
player_id | int | - | Read only |
active | bool | - | Read onl |
starting_age | int | StartingAge | |
lock_civ | bool | - | |
population_cap | int | - | |
food | int | - | |
wood | int | - | |
gold | int | - | |
stone | int | - | |
color | int | ColorId | |
human | bool | - | |
civilization | int | Civilization | |
architecture_set | int | Civilization | |
diplomacy | List[int] | - | Non-GAIA |
int | - | Non-GAIA | |
int | - | Non-GAIA | |
allied_victory | bool | - | Non-GAIA |
disabled_techs | List[int] | - | Non-GAIA |
disabled_buildings | List[int] | - | Non-GAIA |
disabled_units | List[int] | - | Non-GAIA |
tribe_name | str | - | Non-GAIA |
base_priority | int | - | Non-GAIA |
string_table_name_id | int | - | Non-GAIA |
initial_player_view_x | int | - | Non-GAIA |
initial_player_view_y | int | - | Non-GAIA |
*: Deprecated properties which don't affect anything
Active Players¶
You can also set the active players with the player manager. Unfortunately, the game does not support enabling players in 'gaps'. If you want p4 enabled, you need to have p1, p2 and p3 enabled. This is why the 'active' attribute in the player object is read-only.
You can set the active player like:
1 |
|
Disables¶
Disables are used to disable units, buildings and technologies for a certain player.
For example, if you want to disable archery ranges
, stables
and siege workshops
for player two,
and you want to disable the market
, the tech loom
and Paladins
for the fifth player, you can do so like this:
1 2 3 4 5 6 7 8 9 10 11 |
|
You can also copy the list of units from one player to another:
1 2 3 4 |
|
Diplomacy¶
You can set diplomacy through the player manager or directly per player.
Set diplomacy teams¶
If you want to quickly set the diplomacy in teams where everyone is allied to the rest of the team, you can use the player_manager.set_diplomacy_teams
function.
It accepts a list of lists with integers or PlayerId
numbers.
The code below creates four teams of two. This sets the players to ally as you can see with the final diplomacy
argument.
1 2 3 4 |
|
Set diplomacy directly¶
You can also set the diplomacy directly for a single player. For example, below you can see that player one is set to enemy with player 5 and player 2, 3 and 4 are set to ally.
This is not mutual!
These function calls will only set the diplomacy one-way.
All 'target' players (2, 3, 4 and 5) are still on the default Enemy stance.
1 2 3 |
|