(info) Other great resources: Official JS API docs, Scripting Forum

Game Configuration

There's two parts to game settings - the game set-up, and player initialisation...

 

Game set-up

Game set-up is currently beyond the realms of the JS API – the game settings are defined in the following ways:

However, once the game starts all of the the settings are available to your scripts...

SettingJS API features

The map defines maxPlayers, startPositions[] and derrickPositions[].

Scripts also have access to mapName, mapWidth and mapHeight.

 

Sets values of scavengers.

When scavengers are enabled, scavfact.js will be loaded to control the  scavengerPlayer.

  

Sets alliancesType and has an effect on Victory Conditions.

Obviously, this affects Players & Alliances.

  

Sets baseType and has a profound effect on Player Initialisation.

AIs should adapt their build orders and early game strategy accordingly.

Structure limits can be determined using getStructureLimit().

Scripts should adapt, in particular to disabled factory types: Working with Factories.

Limits set during game-setup will override those set during Player Initialisation when applyLimitSet() is called.

 The playerData[] array provides a Player object for each player slot in the game, with the exclusion of the Scavenger Faction, regardless of whether there is a player in that slot or not.

Player Initialisation

<to follow>