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

Change log

A summary of the main changes in the JS API from Warzone 3.1 Beta 1 to present day...

 

Warzone 3.1

Warzone 3.1 brings some major improvements over earlier releases, in particular a fully functional JS API.

You can find a full list of Warzone releases, since the game was first released to present day, here: Warzone Versions

3.1 Alpha releases

The JS API started getting used by developers during the MASTER snapshot releases in late 2011 and early January 2012.

There were a significant number of changes in the alpha releases. It's recommended that you base your scripts on Warzone 3.1 Beta 1 and above to avoid adding lots of cruft to your code.

3.1 Beta 1

This was the first major release in which the JS API gained popularity. In particular a large number of events were added, and API features relating to cyborgs were significantly changed.

A bug in pickStructLocation(), relating to positions returned for cyborg factories, was fixed.

The enumDroid() and buildDroid() functions have issues in relation to Combat Engineers and Cyborg Mechanics which persist until 3.2 branch.

The addDroid() function is broken and unusable - a problem that persists up to and including 3.1.0.

The version global was very unreliable on Mac OS X builds, up to 3.1 Beta 4.

The effects of these changes were so profound that Javascript AIs (namely NoQ's NullBot) became more effective than the existing WZScript AIs such as Nexus and Semperfi.

3.1 Beta 2

Beta 2 made the JS API much more robust by fixing some bugs, adding some new stuff and deprecating some badly named old stuff.

ConstantsEventsFunctionsGlobalsObjects

(minus) OPTIONS

(plus) eventObjectSeen()

(plus) eventObjectTransfer()

(plus) enumBlips()

(warning) structureIdle() 

(warning) enumDroid()

(warning) addDroid() 

(warning) buildDroid()

No changes

(warning) version

not investigated yet

This website was started and the major project of writing detailed documentation for the JS API began.

3.1 Beta 4

Beta 3 was not released due to some serious bugs, so we skipped to Beta 4.

The version global was standardised across platforms, it's value being fixed to 3.1. Previously, on Mac OS X version returned "TRUNK".

ConstantsEventsFunctionsGlobalsObjects

(error) OPTIONS

No changes

(warning) debug()

(plus) enumStructOffWorld()

(warning) structureIdle() 

(warning) enumDroid()

(warning) addDroid() 

(warning) buildDroid()

(info) versionnot investigated yet

3.1 Beta 5

Beta 5 fixed a long-term issue with save games, but introduced a new bug in multiplayer games.

A new DROID_SUPERTRANSPORTER constant was added, allowing easy differentiation between cyborg and tank transports. Prior to 3.1 Beta 5, it's recommended to avoid using transporters.

The DORDER_RECOVER code was fixed so AI players are now able to pick up oil barrels and artefacts when specifically instructed to do so.

ConstantsEventsFunctionsGlobalsObjects

(plus) DROID_SUPERTRANSPORTER

(info) DROID_TRANSPORTER

(info) DORDER_RECOVER fixed

No changes

No changes

(warning) structureIdle() 

(warning) enumDroid()

(warning) addDroid() 

(warning) buildDroid()

No changes

No changes

3.1 Beta 6

Beta 6 was released a day after Beta 5, in order to fix a serious multiplayer bug.

There were no other changes between Beta 5 and 6. Nothing at all changed in the JS API.

3.1 Beta 7

The BEING_DEMOLISHED constant was removed after it was discovered it wasn't actually used at all in the main WZ codebase.

ConstantsEventsFunctionsGlobalsObjects

(error) BEING_DEMOLISHED

No changes

(warning) structureIdle() 

(warning) enumDroid()

(warning) addDroid() 

(warning) buildDroid()

No changes

No changes

3.1 Beta 8

The enableTemplate() function was added, allowing production of DROID_CONSTRUCT prior to building a HQ (for human players). It's used in rules.js.

ConstantsEventsFunctionsGlobalsObjects

No changes

No changes

(plus) enableTemplate()

(warning) structureIdle() 

(warning) enumDroid()

(warning) addDroid() 

(warning) buildDroid()

No changes

No changes

3.1 Beta 9

No changes in the JS API.

3.1 Beta 10

No changes in the JS API.

3.1 Beta 11

Two new constants were added: PLAYER_DATA (value 7) and RESEARCH_DATA (value 8). For reference, the numeric values are 6 for AREA and 5 for POSITION.

With the exception of pickStructLocation() (see 3.1 RC3 for update), all JS API features that return an Area objectPosition objectPlayer object or Research object now have a .type property that has the relevant constant as it's value. This change affects label()Player object and Research object, and any research object returned by other functions (but not the functions themselves).

ConstantsEventsFunctionsGlobalsObjects

(plus) PLAYER_DATA

(plus) RESEARCH_DATA

No changes

(info) label()

(warning) structureIdle() 

(warning) enumDroid()

(warning) addDroid() 

(warning) buildDroid()

No changes

(info) Player object

(info) Research object

3.1 RC 2

Note: 3.1 RC 1 was skipped due to some major bugs.

The getDroidLimit() function was added.

ConstantsEventsFunctionsGlobalsObjects

No changes

No changes

(plus) getDroidLimit()

(warning) structureIdle() 

(warning) enumDroid()

(warning) addDroid() 

(warning) buildDroid()

No changes

No changes

3.1 RC 3

The pickStructLocation() function now returns a full Position object (it has a .type property set to POSITION).

ConstantsEventsFunctionsGlobalsObjects

No changes

No changes

(info) pickStructLocation()

(warning) structureIdle() 

(warning) enumDroid()

(warning) addDroid() 

(warning) buildDroid()

No changes

No changes

3.1.0

Note: This section still under construction.

A bug in groupSize(), specific to this release, causes the group size to sometimes be reported as having 1 droid too many. If you do an enumGroup(), use the length of the returned array rather than the value of groupSize() to iterate it, or better still use Javascript's .forEach() method to iterate the array.

ConstantsEventsFunctionsGlobalsObjects
  

(warning) groupSize()

(warning) enumDroid()

(warning) addDroid() 

(warning) buildDroid()

  
Trivia: The JS API was first announced in April 2011.
Icon Key

(error) Removed/Missing

(plus) Added

(warning) Buggy

(minus) Deprecated but present

(info) Updated

Contents

Jump to version: