This repository has been archived by the owner on Sep 29, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
Respecting the screeps ai api
Anthony Van de Gejuchte edited this page May 25, 2015
·
3 revisions
Following document explains the guidelines the core API should follow (and nothing else).
Following fields should be set to:
-
Memory
to{}
-
Memory.spawns
to{}
-
Memory.sources
to{}
-
Memory.spawnQueue
toAI.settings.spawnQueue
-
Memory.spawnPriorityQueue
toAI.settings.spawnPriorityQueue
-
Each Memory.spawn member field should be set to:
-
Memory.spawns[spawn]
to{}
-
Memory.spawns[spawn].spawnQueue
to[]
-
Memory.spawns[spawn].spawnPriorityQueue
to[]
All memory is guaranteed to be removed except Memory.permanent
- Code
extensions/tools/hooks/getStats.js
- Gathers game state of the beginning of the round (and should be the only plugin to do that)
- Uses Memory.stats to add new data
- Has a pre hook to move Memory.stats to Memory.statsHistory
- So any other code executed after pre can store data (post hooks and stages behind pre can store data to it)
-
<creep>.memory.role
contains the role of the creep - Death checker reserves
<creep>.memory.copyOnDead
. If set this determines if the creep will spawn or not.