Other great resources: Official JS API docs, Scripting Forum
Player Scripts
- Aubergine
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:
- AI scripts are responsible for player automation – see: AI Guide.
- The human's script is responsible for Game Rules & SitRep.
Script Summary
The table below summarises which scripts are responsible for the different player types in a skirmish or multiplayer game:
Human Player | Scavenger 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.