Other great resources: Official JS API docs, Scripting Forum
Compatibility Matrix
- Aubergine
Overview
Warzone's JS API is still relatively new and undergoing regular changes, most of which are addition of new features.
If you want to make a mod that uses scripting, it's important to be aware of the of compatibility between different releases, especially during beta release cycles.
The following information is available:
- Change log — A summary of the main changes in the JS API from Warzone 3.1 Beta 1 to present day...
- Constants 3.1 — Matrix of constant availability in Warzone 3.1...
- Events 3.1 — Matrix of events availability in Warzone 3.1...
- Functions 3.1 — Matrix of functions availability in Warzone 3.1...
- Globals 3.1 — Matrix of globals availability in Warzone 3.1...
The script
Needs technical review
To gather information I made a fake AI script that, after a 15 second delay, lists all JS API features in the AI's console (so you need to enter debug mode and switch to the AI player to see the list).
Here's that script:
var globalobj = this; function tracebot() { console("game version "+version); var gk = Object.keys(globalobj); var alphaSort = function(a,b) { if (a<b) return -1; if (a>b) return 1; return 0; } gk.sort(alphaSort); var ar = []; while (gk.length) { ar.push(gk.pop()); if (ar.length>8) { console(ar.join(',')); ar = []; } } if (ar.length) console(ar.join(',')); } function eventStartLevel() { setTimer("tracebot",15000); }
After outputting the list, I screen grab the console and then manually update the table further up this page.
Gallery of screen grabs:
Tracebot screenshots |
|
---|---|
A huge thanks to Artofeel and NoQ for getting 3.1 Beta 1 screenshots!