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

Player Scripts

Each player in the game has a specific script associated with them...

 

You are not alone!

It doesn't matter what sort of player you are – human, scavenger, or computer – there's a script with your name on it watching every move you make!

There are two main categories of script, each fulfilling a specific role:

Script Summary

The table below summarises which scripts are responsible for the different player types in a skirmish or multiplayer game:

Human PlayerScavenger Faction (AI script)Computer Players (AI script)

Script: rules.js

Runs on: Players' local machine

Role: Game Rules & SitRep

Setup: Player Initialisation

Best example:


Script: scavfact.js

Runs on: Game host machine

Role: Player Automation

Setup: Map-placed buildings

Best example:


Script: Defined by .ai file

Runs on: Game host machine

Role: Player Automation

Setup: Player Initialisation

Best example:


In Challenge Games, the scripts associated with each player are set in the .ini file that defines the challenge. Challenges can also define an optional player-independent script, although it's not clear what purpose it would serve.

I've not yet investigated campaigns, fast play or tutorial modes so don't yet know what scripts are applicable in those scenarios.