Other great resources: Official JS API docs, Scripting Forum

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Current »

Alphabetical page index...

 

Space Index

0-9 ... 0 A ... 20 B ... 8 C ... 26 D ... 56 E ... 61
F ... 7 G ... 29 H ... 8 I ... 11 J ... 2 K ... 0
L ... 5 M ... 13 N ... 3 O ... 11 P ... 19 Q ... 4
R ... 17 S ... 42 T ... 4 U ... 2 V ... 2 W ... 16
X ... 0 Y ... 0 Z ... 0 !@#$ ... 0    

0-9

A

Page: activateStructure()
Activates the special feature of a structure, such as firing laser satellite... Syntax var returnValue = activateStructure(structure, [target[, ability]]); Parameters Parameter Type Mandatory Description Game version structure Structure object The struc
Page: addBeacon()
Send a beacon to a specific player or allies... Syntax addBeacon(x, y, to[, message]); Parameters Parameter Type Mandatory Notes Game Version x Number The x co-ordinate of the beacon. 3.2 y Number The y co-ordinate of the beacon. 3.2 to Number Constant
Page: addDroid()
Instantly place a droid on the map... Syntax // Warzone 3.1 syntax addDroid(player, x, y, name, body, propulsion, reserved, droidType, t1[, t2[, t3]]); // Warzone 3.2 syntax -- droidType no longer required addDroid(player, x, y, name, body, propulsion
Page: addFeature()
Add a feature object (tree, log cabin, etc.) to the map... Syntax addFeature(name, x, y); Parameters Parameter Type Mandatory Notes Game Version name String The id of the feature to add (most likely from features.txt?) 3.2 x Number The x co-ordinate of
Page: addLabel()
Associate a game or map object with a label... Syntax addLabel(object, label); Parameters Parameter Type Mandatory Notes Warzone Version object Game object Location Object The object to label... Game objects: Droid object Structure object Feature object
Page: addReticuleButton()
Enable a reticule button... Syntax addReticuleButton(button); Parameters Parameter Type Mandatory Description Game version button Constant A constant defining which button to display: reticule.png For more information, see: Reticule buttons 3.1 Beta 1 R
Page: addStructure()
addStructure(structure type, player, x, y) Create a structure on the given position. Returns true on success. in wz3.2+ returns structure object if successful or null if failed.
Page: ALL_PLAYERS
Overview Send a chat message to all players. Example chat(ALL_PLAYERS,"Hello"); See also chat() – send a chat message eventChat() – receive a chat message Players & Alliances – summary of all API functions relating to players and alliances
Page: Alliance
Page: allianceExistsBetween()
Determine whether two players are allies with each other... Syntax var returnValue = allianceExistsBetween(playerA, playerB); Parameters Parameter Type Mandatory Description Game version playerA Number The ID of the first player 3.1 Beta 1 playerB Numbe
Page: ALLIANCES
Page: ALLIANCES_TEAMS
Page: alliancesType
Defines the alliance mode selected for the current game... Values Icon Value Description image_noalli.png NO_ALLIANCES No Alliances A "free for all" - every man for himself: You win when all other players are defeated. You lose as soon as you are defeated
Page: ALLIES
Overview Send a chat message to your allies. Example chat(ALLIES,"Hello"); See also chat() – send a chat message eventChat() – receive a chat message Players & Alliances – summary of all API functions relating to players and alliances
Page: applyLimitSet()
Merges limits set by your script with limits set on the Structure Limits Screen... Syntax hackNetOff(); /* set default structure limits here using setStructureLimits() */ applyLimitSet(); hackNetOn(); Parameters There are no parameters for this function
Page: AREA
an Area object
Page: Area object
Specifies the top-left and bottom-right co-ordinates of an area of the map. Properties area-1.png Property Type Description Game version type Constant AREA 3.1 Alpha x Number The x co-ordinate of the top-left corner of the area 3.1 Alpha y Number The y
Page: ARTIFACT
Indicates an artifact Feature object... Availability Requires: Warzone 3.2 or above
Page: Atmosphere
Page: audioAlert(filename,pos,despam)
Throttled alternative for playSound(). Code /* ####################################################################################### audioAlert.js v0.1 audioAlert(filename, pos despam) -- plays an audio alert to the human player * filename -- Required

B

Page: baseType
A constant defining what sort of bases players start with in the current game. How is the Base Type set? The base type is chosen when starting a new Skirmish or Multiplayer game: baseType-1.png If you are creating Challenge Games, use the "Bases" proper
Page: BEING_BUILT
indicates a Structure object is currently being built by a DROID_CONSTRUCT once built, it goes to BUILT
Page: BEING_DEMOLISHED
This constant is no longer available, but this article provides some guidance on dealing with structure demolition... Why demolish buildings? There are three main reasons for demolishing structures: To get a partial refund of their construction cost (if
Page: bind()
Register a function to be called when a game object gets destroyed. Syntax bind(functionName, gameObject); Parameters Parameter Type Mandatory Description Game version functionName String The name of the function that should be called immediately before
Page: BUILD
Overview Used to show or hide the "Build" (hammer) reticule button. reticule.png See also: addReticuleButton() – display a reticule button removeReticuleButton() – hide a reticule button setTutorialMode() – you need to be in tutorial mode before using the
Page: buildDroid()
Instruct a factory to build a droid... Syntax For warzone 3.1 and earlier: buildDroid(factory, name, body, propulsion, "", droidType, turret[, turret2[, turret3]]); In master / warzone 3.2 and later, the droidType parameter is no longer required (it is
Page: BUILDING
A Feature object representing a building... Availability Requires: Warzone 3.2 or above
Page: BUILT
indicates a Structure object is fully built, and is now operational sometimes structure can be idle: structureIdle() / eventStructureReady() previous state is BEING_BUILT. once built, you can optionally order a DROID_CONSTRUCT to demolish it causing state

C

Page: Camera
Page: cameraSlide()
Change the camera position... Syntax cameraSlide(x, y); Parameters Parameter Type Mandatory Notes Warzone Version x Number 3.2 y Number 3.2 Return value Example Availability Requires: Warzone 3.2 or above Contents Jump to: See also Related articles: c
Page: cameraTrack()
Instruct the camera to track a droid... Syntax cameraTrack(droid); Parameters Parameter Type Mandatory Notes Warzone Version droid Droid object The droid to track – the camera will follow the droid until its destroyed. You can stop tracking by passing i
Page: cameraZoom()
Zoom the camera in or out... Syntax cameraZoom(zoom, speed); Parameters Parameter Type Mandatory Notes Game Version zoom Number The zoom level to transition to. Normal zoom range is 500 ↔ 5000. 3.2+ speed Number The amount of time for the camera to tran
Page: CAMP_BASE
Overview Walls, gates, defences, HQ and cyborg factory will be removed at the start of the game. Insane AIs keep their walls and defences. For more information, see: baseType.
Page: CAMP_CLEAN
Overview Base structures will be removed at the start of the game, except for Scavengers and "Insane" AIs. For more information, see: baseType.
Page: CAMP_WALLS
Overview All structures will remain at the start of the game. For more information, see: baseType.
Page: CANCEL
Overview Used to show or hide the "Cancel" (central) reticule button. reticule.png See also: addReticuleButton() – display a reticule button removeReticuleButton() – hide a reticule button setTutorialMode() – you need to be in tutorial mode before using t
Page: centreView()
Centre the camera view on a specific x,y tile co-ordinate... Syntax centreView(x,y); Parameters Parameter Type Mandatory Description Game version x Number The x co-ordinate to show 3.1 Beta 1 y Number The y co-ordinate to show 3.1 Beta 1 Return value Va
Page: 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, si
Page: chat()
Send an in-game message to a specific player, your alliance or everyone. Syntax chat(to, message); Parameters Parameter Type Mandatory Description Game version to Number, Constant Who should the message be sent to? Specify a player id to send to that sp
Page: Code sandboxing
A brief tutorial showing how to sandbox a chunk of code, primarily to avoid it's variables leaking on to the global scope. Why Sandbox? Sandboxing helps avoid some common pitfalls when using include(). It's my term for a self-running http://sarfraznawaz
Page: COMMAND
Overview Used to show or hide the "Command" (star) reticule button. reticule.png See also: addReticuleButton() – display a reticule button removeReticuleButton() – hide a reticule button setTutorialMode() – you need to be in tutorial mode before using the
Page: COMMAND_CONTROL
Command relay centre, not to be confused with HQ enables commander units to be built: DROID_COMMAND
Page: Common Mistakes
A summary of common issues you *will* run in to whilst developing against the JS API... Error exceptions Many of the Functions will throw an exception (generic Error object) if not properly used. If you don't trap the exception, your script could crash.
Page: Compatibility Matrix
A record of all changes to the Javascript API features since it's initial release... 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 script
Page: completeResearch()
completeResearch(research[, player]) Finish a research for the given player.
Page: componentAvailable()
Check if a droid component is available... Syntax // Warzone 3.1.0 and earlier componentAvailable(type, name) // Warzone 3.2 and later: the type param is deprecated componentAvailable([type,] name) Parameters Parameter Type Mandatory Notes Game versio
Page: Components & Templates
Droids in Warzone are predominantly built from component parts, with component configurations stored as templates... Warzone2100ComponentsB.png
Page: console()
Outputs text to the player console associated with the script. Syntax console(text[, text[, ...]]); Parameters Parameter Type Mandatory Description Game version text String The text to output to the console. If you pass multiple parameters, each string
Page: Constants
Overview This page is in need of technical review – eg. you can't create custom constants inside function scope in current releases. The JS API defines a number of constants which are used in Functions and Objects. Constants are static read-only values –
Page: Constants 3.1
Matrix of constant availability in Warzone 3.1... Changes by version For sake of brevity, releases where nothing interesting happened are not included in this table. Constants ↓Click links for docs 3.1 Master Jan2012 3.1 Beta 1 3.1 Beta 2 3.1 Beta 4
Page: Contents
Javascript API
Page: countDroid()
Count the number of droids of a given type for a specific player. Syntax var numDroids = countDroid([droidType[, player]]); Parameters Parameter Type Mandatory Notes Warzone Version droidType Constant What sort of droid should be counted? DROID_ANY– all
Page: countStruct()
Count the number of structures of a given type... Syntax var numStructs = countStruct(structureID[, player]); Parameters Parameter Type Mandatory Notes Game Version structureID String The ID of the structure type to count. 3.1.0 player Number Constant W
Page: CYBORG_FACTORY
a factory that can produce cyborgs cyborgs built here using buildDroid() are DROID_CYBORG (for weapon cyborgs), DROID_REPAIR (for mechanic cyborgs) and DROID_CONSTRUCT (for engineer cyborgs) usually there can be 5 of these factories per player, game setti

D

Page: Data objects
These objects relate to players and game config ("stats")... Overview The following objects are in this category: Object Notes Related features Availability Group Object Information about a group defined in labels.ini. The .type of this object is GROUP.
Page: debug()
Outputs text to the terminal or log file depending on operating system. Syntax try { debug(text); } catch(e) { console(e.message); // error occurred } Parameters Parameter Type Mandatory Description Game version text String The text to output to the com
Page: DEFENSE
any type of base defence (eg. pit, bunker, hardpoint, etc) but also includes sensors, ECM towers and radar detector towers. really hope the sensors/etc get split out in to their own types at some point! you can get more accurate idea of what type of struc
Page: derrickPositions[]
An array of oil resources on the map, filtered to those that don't have derricks built on them at the start of the game. Overview This array lists map-placed oil resources, which you can build a derrick on if there isn't already one there. Depending on
Page: DESIGN
Overview Used to show or hide the "Design" (blue components) reticule button. reticule.png See also: addReticuleButton() – display a reticule button removeReticuleButton() – hide a reticule button setTutorialMode() – you need to be in tutorial mode before
Page: difficulty
A constant representing the difficulty level selected for your script. Overview End users can choose a difficulty level for AI players in skirmish or multiplayer games on the game set-up screen: difficulty.png In challenges, the difficultly level is def
Page: distBetweenTwoPoints()
Returns the straight-line distance between two points on the map... This article is in need of technical review - returned distance seems to have been in world coords in 3.1.0 and earlier. Syntax var returnValue = distBetweenTwoPoints(x1, y1, x2, y2); P
Page: donateObject()
Transfer an object to another player... Hopefully this function will be renamed transferObject() in keeping with eventObjectTransfer(). Syntax var success = donateObject(gameObj, to); Parameters Parameter Type Mandatory Notes Game Version gameObj Game o
Page: donatePower()
Transfer some power to another player... Hopefully this function will be renamed transferPower() and be given an associated event. Syntax var success = donatePower(amount, to); Parameters Parameter Type Mandatory Notes Game Version amount Number The amo
Page: DORDER_ATTACK
Overview Instruct a droid to attack something. Availability Warzone 3.1 Beta 1 and above. Example // tell myDroid to attack enemyObject orderDroidObj(myDroid,DORDER_ATTACK,enemyObject); Notes The droid's current order can be determined from it's .order pr
Page: DORDER_BUILD
Overview Instruct a construction droid to build a Structure object at a specific location. Availability Warzone 3.1 and above. Example // Assuming "truckDroid" contains a DROID_CONSTRUCT object... // Structure to be built (you need its ID): var struct =
Page: DORDER_CIRCLE
Overview Instruct a VTOL to circle around a specific location. Availability backport_icon.png Requires backport.dorder.js. This isn't a standard feature of the JS API, however it's a constant used by the game engine so it's recognised by Warzone from at l
Page: DORDER_COMMANDERSUPPORT
Overview Assign an attacker droid to a commander droid so that it will attack whatever the commander droid targets. Availability backport_icon.png Requires backport.dorder.js v0.1 or above. This isn't a standard feature of the JS API, however it's a const
Page: DORDER_DEMOLISH
Overview Instruct a construction droid to demolish one of your structures. Availability Warzone 3.1 Beta 1 and above. Example // tell constructionDroid to demolish myStructureObject orderDroidObj(constructionDroid,DORDER_DEMOLISH,myStructureObject); Notes
Page: DORDER_DESTRUCT
Overview Instruct a droid to self-destruct! Availability backport_icon.png Requires backport.dorder.js and backport.orderDroid.js. This isn't a standard feature of the JS API, however it's a constant used by the game engine so it's recognised by Warzone f
Page: DORDER_DISEMBARK
order a droid to disembark from a DROID_TRANSPORTER (i think?) currently there's no way to tell if a droid is on a transport (you'll have to remember from the point where you tell droid to DORDER_EMBARK), and there's no way to know if a transport is lande
Page: DORDER_DROIDREPAIR
Overview Instruct a repair droid to repair a damaged Droid object. Availability backport_icon.png Requires backport.dorder.js. This isn't a standard feature of the JS API, however it's a constant used by the game engine so it's recognised by Warzone from
Page: DORDER_EMBARK
order a droid to go in to a DROID_TRANSPORTER currently there's no way to work out what sort of transporter it is - a cyborg transport should only contain cyborgs, a heavy transport can contain anything (incl. vtols). also, number of units you can put on
Page: DORDER_FIRESUPPORT
Overview Assign a attacker droid to a sensor droid so that it can attack whatever the sensor droid targets. Availability Warzone 3.2 and above. backport_icon.png Backport to earlier versions with backport.dorder.js and baseObject.js. Example // Assuming t
Page: DORDER_GUARD
Overview Instruct a droid to guard a structure. Availability backport_icon.png Requires backport.dorder.js and backport.js. This isn't a standard feature of the JS API at present (but likely to be added in the future), however it's a constant used by the
Page: DORDER_HELPBUILD
Overview Instruct a construction droid to help with an existing structure building site. Availability Warzone 3.1 Beta 1 and above. Example // function that will identify part-built structures: var toPartiallyBuilt = function(struct) { return struct.statu
Page: DORDER_HOLD
Overview Instruct the droid to hold its current position until instructed otherwise. Availability Warzone 3.2 and above. backport_icon.png Backport to earlier versions with backport.dorder.js and backport.orderDroid.js. Example orderDroid(myDroid,DORDER_H
Page: DORDER_LINEBUILD
Overview Indicates that a construction droid is building a line of structures (eg. a long wall). Availability Warzone 3.1 Beta 1 and above. Example if (enemyTruck.order == DORDER_LINEBUILD) { // it's probably building defences, you should destroy it! } No
Page: DORDER_MOVE
Overview Instruct a droid to move to a new location. Availability Warzone 3.1 Beta 1 and above. Example // move to specific location (assuming droid can get there) orderDroidLoc(myDroid,DORDER_MOVE,startPositions[me].x,startPositions[me].y); // move to
Page: DORDER_NONE
Overview Indicates that a droid is currently idle. Availability backport_icon.png Requires backport.dorder.js. This isn't a standard feature of the JS API, however it's a constant used by the game engine so it's recognised by Warzone from at least 3.1 Bet
Page: DORDER_OBSERVE
Overview Instruct a sensor droid to observe (target) a Droid object, Structure object, or even a Feature object. sensors-longrange.jpeg Availability backport_icon.png Requires backport.dorder.js v0.1 or above. This isn't a standard feature of the JS API a
Page: DORDER_PATROL
Overview Instruct a droid to patrol between it's current location and a specified location, attacking any enemies it detects along the way. Availability Warzone 3.1 Beta 1 and above. Example // assuming we have a droid object "myDroid" and a location defi
Page: DORDER_REARM
Overview Instruct a VTOL to return to a rearming pad for repairs and rearming. Availability Warzone 3.2 and above. backport_icon.png Backport to earlier versions with backport.dorder.js and backport.orderDroid.js. Example // use nearest available rearming
Page: DORDER_RECOVER
Order a droid to recover a collectible item such as an oil barrel or artefact (crate). Example if (someDroid.order == DORDER_RECOVER) { // it's picking up an artefact or oil barrel } // get one of my droids to pick something up orderDroidObj(myDroid,
Page: DORDER_RECYCLE
Recycle a droid... Syntax DORDER_RECYCLE Example // use specific recycling structure (factory or repair station) orderDroidObj(myDroid, DORDER_RECYCLE, recycleStructure); // use any recycling point (WZ 3.2+ only) orderDroid(myDroid, DORDER_RECYCLE); N
Page: DORDER_REPAIR
Overview Instruct a construction droid to repair a damaged Structure object. Availability Warzone 3.1 Beta 1 and above. Example orderDroidObj(myConstructionDroid,DORDER_REPAIR,damagedStructureObject); Notes The droid's current order can be determined from
Page: DORDER_RETREAT
Overview Instruct a droid to retreat to a pre-defined retreat point. Does not retreat to HQ! Read docs before using! Availability Warzone 3.1 Beta 1 and above. Example // this will always work (assuming the droid can get to the location): orderDroidLoc(my
Page: DORDER_RTB
Overview Instruct a droid to return to your base. Availability Warzone 3.2 and above. backport_icon.png Backport to earlier versions with backport.dorder.js and backport.orderDroid.js. Example // choose a location automatically (recommended) orderDroid(my
Page: DORDER_RTR
Overview Instruct a land droid to go to a repair facility for repairs. Availability Warzone 3.2 and above. backport_icon.png Backport to earlier versions with backport.dorder.js and backport.orderDroid.js. Example // go to nearest repair facility (recomme
Page: DORDER_RTR_SPECIFIED
Overview Instruct a land droid to go to a specific repair facility for repairs. Availability backport_icon.png Requires backport.dorder.js. This isn't a standard feature of the JS API, however it's a constant used by the game engine so it's recognised by
Page: DORDER_SCOUT
Overview Instruct a droid to "scout" to a new location. Availability Warzone 3.1 Beta 1 and above. Example // scout to specific location (assuming droid can get there) orderDroidLoc(myDroid,DORDER_SCOUT,startPositions[me].x,startPositions[me].y); // sco
Page: DORDER_STOP
Overview Instruct a droid to stop what it's doing. This is particularly useful in the case of VTOLs because they keep attacking their last target until it's destroyed – the only way to stop them is DORDER_STOP. Availability Warzone 3.2 and above. backport
Page: DORDER_TEMP_HOLD
Overview Use DORDER_HOLD instead of DORDER_TEMP_HOLD.
Page: DORDER_UNUSED
Overview As it's name suggests, this constant is not used. Availability backport_icon.png Requires backport.dorder.js.
Page: DROID
a Droid object
Page: Droid object
Droids are mobile game objects (items on the map), and have a huge number of properties and related API features... Properties Inherits all properties of a Game object (id, x, y, z, player, selected, name, health, armour, thermal, born, etc.) then adds/
Page: DROID_ANY
Used to bypass droid type filtering in functions that list or count droids. Syntax DROID_ANY Notes Can be used in countDroid() and enumDroid() to bypass the droid type filter. Prior to Warzone 3.1.0, you'll need to manually define the constant: const DR
Page: DROID_COMMAND
Overview A commander unit, to which other units can be assigned. There is currently no way to assign units to a commander via the JS API, so not much point in using these yet.
Page: DROID_CONSTRUCT
Overview A construction truck or a cyborg engineer. These units are capable of building, repairing and demolishing structures. There is currently no way to determine if the unit is a cyborg or not. See also orderDroidBuild() – order the droid to build som
Page: DROID_CYBORG
Overview A cyborg warrior capable of attacking the enemy. Note that cyborg engineers are reported as DROID_CONSTRUCT and cyborg mechanics are reported as DROID_REPAIR. There is currently no way to differentiate between normal and super cyborgs. Prior to W
Page: DROID_ECM
Overview A droid that has an Electronic Counter Measures (radar jammer) turret. These droids block enemy radar and are thus useful for protecting nearby droids from enemy artillery and long range missile attacks. Currently you have to install a mod to ena
Page: DROID_PERSON
Overview A droid that uses "legs" propulsion, for example a civilian or a scavenger machinegunner. You can work out if a game has scavengers enabled via the scavengers global, although this does not necessarily mean that there will be any scavs on the map
Page: DROID_REPAIR
Overview A droid that has a repair turret, capable of repairing other droids. Not to be confused with a construction truck (DROID_CONSTRUCT) that can repair structures.
Page: DROID_SENSOR
Overview A droid with a sensor turret, capable of detecting enemy units and structures. There is currently no way to determine what type of sensor turret is attached to the droid. There is currently no way to assign units to a sensor droid. It is not clea
Page: DROID_SUPERTRANSPORTER
A heavy transport unit, capable of airlifting any type of droid (including VTOLs) to some other location on the map... Scripting Transports Prior to Warzone 3.1 Beta 5, there was only a DROID_TRANSPORTER constant and it was used for both cyborg transpor
Page: DROID_TRANSPORTER
Overview A cyborg transporter (or possibly a super transporter in Warzone 3.1 Beta 4 and earlier), capable of airlifting droids to some other location on the map. Availability Warzone 3.1 Beta 1 and above. It's recommended that you avoid using transporter
Page: DROID_WEAPON
Overview A droid capable of attacking other droids. This can be either a vehicle (wheeled, half-tracked, tracked, hover) or VTOL, but not a cyborg. Cyborg attack droids are classified as DROID_CYBORG instead. Prior to Warzone 3.2, super-cyborgs were class
Page: droidCanReach()
Find out if a specific droid can reach a specific location from it's current location... Syntax var returnValue = droidCanReach(droid, x, y); scrat.jpg Parameters Parameter Type Mandatory Notes Game version droid Droid object An object representing the
Page: droidFromId()
Get an object based on it's object ID and player ID... Syntax var gameObj = droidFromId( id, player ); Parameters Parameter Type Mandatory Notes Game version id Number The ID of the object to retrieve 3.1 Beta 1 ONLY player Number The ID of the player t
Page: Droids
A wide range of features for working with droids (tanks, etc)... What are droids? Droids are player-owned movable units such as trucks, tanks, cyborgs and VTOLs. What can I do with droids? They are the most flexible objects in the game: Construction dro
Page: dump()
Dumps text to a log file... filename: "logs/" + script name + ".log" 3.2+ file deleted at end of game (or maybe on next game start)?

E

Page: EASY
Act like a punching bag... Overview The "Easy" difficulty level indicates that the human who set-up the game wants your AI to behave like a punch bag. On Warzone 3.2 and above, EASY AIs receive a hard-coded penalty that makes them produce 25% less oil.
Page: enableComponent()
Enable a player to research a specific droid component... Syntax enableComponent(component, player); Parameters Parameter Type Mandatory Notes Game version component String The component name to enable. 3.1 Beta 1 player Number The player who will be ab
Page: enableResearch()
enableResearch(research[, player]) Enable a research for the given player, allowing it to be researched.
Page: enableStructure()
enableStructure(structure type[, player]) The given structure type is made available to the given player. It will appear in the player’s build list. I assume the structure can be something from structures.txt?
Page: enableTemplate()
Used to make construction trucks available before building a HQ... Syntax enableTemplate(templateID); Parameters Parameter Type Mandatory Description Game Version templateID String The ID of the template to enable. You should only ever enable the "Const
Page: ENEMIES
Filter enumeration to enemy objects. wz 3.2+
Page: enumArea()
Get a list of game objects within a specific area of the map... Syntax // syntax #1: specify co-ordinates of area var results = enumArea( x1, y1, x2, y2[, filter[, seen]] ); // syntax #2: reference an AREA object by it's label var results = enumArea(
Page: enumBlips()
Get positions of non-transient radar blips as seen by your radar detectors... Syntax var returnValue = enumBlips( seenBy ); Parameters Parameter Type Mandatory Description Game version seenBy Number A list of blips seen by the specified player will be r
Page: enumCargo()
enumCargo(transport) Returns an array of droid objects in the cargo hold of a transporter. 3.2+
Page: enumDroid()
Returns an array of droid objects, optionally filtered to a specific player, droid type and looking player... Syntax var returnValue = enumDroid([player[, droidType[, viewer]]]); Parameters Parameter Type Mandatory Description Game version player Number
Page: enumEnemyStruct(structure[,viewer])
Returns an array of all enemy structures of a given type, optionally filtered to visibility of lookingPlayer. Code function enumEnemyStruct(structure,viewer) { var list = []; var enemies = getEnemyPlayerIDs(); enemies.forEach(function(enemy) { if (!!vie
Page: enumFeature()
Returns an array of feature objects (like trees and boulders), optionally filtered to a specific looking player... Syntax var returnValue = enumFeature([viewer[, featureID]]); Parameters Parameter Type Mandatory Description Game version viewer Number Li
Page: enumGateways()
* enumGateways(), gives array of objects with x1, y1, x2, y2 properties 3.2+ only enumGateways() Return an array containing all the gateways on the current map. The array contains object with the properties x1, y1, x2 and y2. Gateways are special invisibl
Page: enumGroup()
Retrieve a list of objects in a group... Syntax var list = enumGroup(group); Parameters Parameter Type Mandatory Notes Game version group Number The numeric ID of the group. 3.1 Beta 1 Return values Value Type Notes Game version <list> Array of Droid ob
Page: enumLabels()
Returns a list of all currently defined labels... Syntax // Warzone 3.1 Beta 3 and above var list = enumLabels(); // Warzone 3.2 and above var list = enumLabels([filter]); Parameters Parameter Type Mandatory Notes Game version filter Constant Optional
Page: enumRange()
List all objects within a specified range of a position on the map... Syntax var results = enumRange(x, y, range[, filter[, seen]]); Parameters Parameter Type Mandatory Notes Game Version x Number The x co-ordinate of the position 3.2 y Number The y co-
Page: enumResearch()
List all technologies that can you can start researching immediately... Syntax var technologies = enumResearch(); Parameters The function does not have any parameters. Return values Value Type Notes Game Version <technologies> Array of Research object I
Page: enumSelected()
Get a list of all objects selected by the the game host... Syntax var results = enumSelected(); Parameters No parameters. Return values Value Type Notes Game Version <results> Array of Game objects An array of game objects that are currently selected by
Page: enumStruct()
List structures on the current map... Syntax var structures = enumStruct([player[, structTypeOrID[, viewer]]]); Parameters Parameter Type Mandatory Description Game version player Number The ID number of the player who's structures you want to list. Def
Page: enumStructOffWorld()
numStructOffWorld([player[, structure type[, looking player]]]) Returns an array of structure objects in your base when on an off-world mission, NULL otherwise. If no parameters given, it will return all of the structures for the current player. The secon
Page: enumTemplates()
Return a list of buildable templates for the player... Syntax var templates = enumTemplates(player); Parameters Parameter Type Mandatory Notes Game version player Number The player to whose templates should be listed. 3.2 Return value Value Type Notes G
Page: Environment Sequences
Details of the main environment sequences that occur in Warzone... New Game When the player starts a new game the following sequence occurs: Player starts a new game (multiplayer, skirmish, challenge, etc) Loading screen appears Map is loaded and initia
Page: Error Handling
Most JS API functions and Javascript operations will "thow" an error if you use them incorrectly... Error objects In Javascript, the Error object https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Error (or derivative) is used to provi
Page: eventArea<Label>()
An event that's triggered when a droid enters a labelled Area object... Syntax // see important notes about event name and usage below! function eventArea<Label>(droid) { // do stuff } Parameters & References Parameter/ Reference Type Mandatory Descript
Page: eventAttacked()
This event is called when your droids or structures are attacked. Syntax function eventAttacked(victim[, attacker]) { // do stuff } Parameters Parameter Type Mandatory Description Game version victim Structure object Droid object Which of my things did
Page: eventAttackedUnthrottled()
The event is "unthrottled", which means that it is called for every single attack. It's therefore useful for micromanagement of droids when they are engaged in battle or come under attack. If you do not require droid micromanagement, use eventAttacked() i
Page: eventBeacon()
This event is triggered each time a new beacon is received. Syntax function eventBeacon(x, y, sender, to[, message]) { // do stuff } Parameters Parameter Type Mandatory Description x Number The x co-ordinate of the beacon. y Number The y co-ordinate of
Page: eventBeaconRemoved()
This event is triggered each time a beacon is removed. Syntax function eventBeaconRemoved(sender, to) { // do stuff } Parameters Parameter Type Mandatory Description sender Number The id of the player who sent the beacon. to Number Constant The id of th
Page: eventChat()
This event is triggered each time a chat message is received. Syntax function eventChat(sender, to, message) { // do stuff } Parameters Parameter Type Mandatory Description sender Number The id of the player who sent the message to Number The id of the
Page: eventCheatMode()
This event is called when the human player enters cheat mode... Syntax function eventCheatMode(entered) { // do stuff } Parameters Parameter Type Mandatory Description Game version entered Boolean Was cheat mode enabled? true – yes, cheat mode is active
Page: eventDesignCreated()
Triggers when a player saves a new template in the droid designer... Syntax function eventDesignCreated(template) { // do stuff } Parameters & References Parameter Type Mandatory Description Game version template Template Object An object describing the
Page: eventDestroyed()
Triggered when a game object is destroyed... Syntax function eventDestroyed(gameObject) { // do stuff } Parameters Parameter Type Mandatory Description Game version gameObject Game object The droid, structure or feature that was just destroyed. See "Not
Page: eventDroidBuilt()
This event is triggered when you get a new droid as a result of buildDroid() or addDroid()... Syntax function eventDroidBuilt(droid, structure) { // do stuff } Parameters Parameter Type Mandatory Description Game version droid Droid object An object rep
Page: eventDroidIdle()
Overview This event is triggered when a droid is twiddling it's turrets because it's got nothing to do. Unlike the game Dungeon Keeper II http://en.wikipedia.org/wiki/Dungeon_Keeper_2 you can't slap http://www.youtube.com/watch?v=I1Zpl0SoEx8 your imps dro
Page: eventGameInit()
This event is triggered once at the start of a new game before the map is ready. Overview This event is only ever triggered once when a new game starts, it is not called when a saved game is loaded. When the event is triggered, all your scripts have bee
Page: eventGameLoaded()
This event is triggered once after a saved game is loaded. Overview This event is triggered once, when a saved game is loaded, just prior to the game being resumed. The primary use of this event is to re-create any data objects that might not have been
Page: eventGameSaved()
triggered after a game has been saved, allowing you to remove any variables put on the global scope prior to saving see also: eventGameSaving() warzone 3.2+
Page: eventGameSaving()
triggered when the user saves the game, before the game is saved. allows you to put variables on the global scope ready for saving. the variables can be removed after the game is saved, as denoted by eventGameSaved() Warzone 3.2+
Page: eventGroupLoss()
Triggered when a game object leaves a group... Syntax eventGroupLoss(gameObject, groupID, groupSize) Parameters Parameter Type Notes Game Version gameObject Game object The object that left the group. Note that in WZ 3.2+, any type of game object can be
Page: eventLaunchTransporter()
Triggered when a mission transporter has been instructed to launch.... Syntax function eventLaunchTransporter() { // do stuff } Parameters This event has no parameters. Return value Warzone does not process the return value of this event. Notes In a mis
Page: eventMissionTimeout()
This event triggers when the mission timer runs out... Syntax function eventMissionTimeout() { // do stuff } Parameters No parameters. Return values The JS API does not process the return value of this event handler. Examples function evnetMissionTimeou
Page: eventObjectRecycled()
Triggered when a droid is recycled or when a structure is demolished by a truck... Syntax function eventObjectRecycled( gameObject ) { // do stuff } Parameters Parameter Type Mandatory Notes Game version gameObject Droid object Structure object The droi
Page: eventObjectSeen()
This event is triggered when one of your sensors detects something new on the map. Syntax function eventObjectSeen(sensor, gameObject) { // do stuff } Parameters Parameter Type Mandatory Description Game version sensor Structure object Droid object The
Page: eventObjectTransfer()
This event is triggered when a droid or structure is transferred to or from another player... Syntax function eventObjectTransfer(gameObject, from) { // do stuff } Parameters Parameter Type Mandatory Description Game version gameObject Droid object Stru
Page: eventPickup()
Triggered when an oil barrel or artifiact is picked up by a droid... Syntax function eventPickup(item, droid) { // do stuff } Parameters Parameter Type Mandatory Notes Game version item Feature object The item that was picked up. You can look at its .st
Page: eventPlayerLeft()
Triggers if a player leaves the game... Syntax function eventPlayerLeft(player) { // do stuff } Parameters & References Parameter Type Mandatory Description Game version player Number The ID of the player that left. 3.2 Return value Warzone does not pro
Page: eventReinforcementsArrived()
Triggered when a mission transporter has arrived on the map with reinforcements.... Syntax function eventReinforcementsArrived() { // do stuff } Parameters This event does not have any parameters. Return value Warzone does not process the return value o
Page: eventResearched()
Triggered when a new technology has been researched by you or an ally... Overview The event is also triggered when you gain technology by picking up an artefact (something that an AI cannot currently do, but a human ally can). Syntax function eventResea
Page: Events & Timers
Events are the driving force behind your scripts... Overview When Warzone is processing your script, everything else in the game stops. So your script can't just run in a never-ending loop - it has to do something, then stop, so that Warzone can get on
Page: Events 3.1
Matrix of events availability in Warzone 3.1... Changes by version Events ↓Click links for docs 3.1 Master 20120109 3.1 Beta 1 3.1 Beta 2 3.1 Beta 4 3.1 Beta 5 & 6 3.1 Beta 10 3.1 Beta 11 3.1 RC 2 eventAttacked() eventAttackedUnthrottled() Planned
Page: eventSelectionChange()
Triggered when the user selects or deselects objects... Syntax function eventSelectionChanged(selected) { // do stuff } Parameters Parameter Type Mandatory Description Game version selected Array of Game objects An array of selected game objects. Array
Page: eventStartLevel()
This event is triggered once at the start of a new game after the map is ready and all game data loaded. It is also triggered once after a new level is loaded. Overview This event is triggered once when a new game starts, it is not called when a saved g
Page: eventStructureBuilt()
triggered when you get a new structure eventStructureBuilt(structure[, droid]) An event that is run every time a structure is produced. The droid parameter is set if the structure was built by a droid. It is not triggered for building theft (check eventOb
Page: eventStructureReady()
Overview This event is triggered when a structure is ready to perform its special ability. Currently, this only applies to the Laser Satellite Command Post, indicating that your next laser strike is available. Each time the building is ready to perform it
Page: eventTransporterArrived()
Triggered when a mission transporter has arrived on the map with reinforcements.... Syntax function eventTransporterArrived(transport) { // do stuff } Parameters Parameter Type Mandatory Notes Game version transport Droid object The transporter that has
Page: eventTransporterDone()
Stick a fork in it, it's done... Syntax function eventTransporterDone(transport) { // insert fork here. } Parameters Parameter Type Mandatory Notes Game version transport Droid object The transporter that no longer has any reinforcements available to co
Page: eventTransporterExit()
Triggered when a mission transporter leaves the map... Syntax function eventTransporterExit(transport) { // do stuff } Parameters Parameter Type Mandatory Notes Game version transport Droid object The transporter that left the map. 3.2 Return value Warz
Page: eventTransporterLanded()
Triggered when a transporter lands... Syntax function eventTransporterLanded(transport) { // do stuff } Parameters Parameter Type Mandatory Notes Game version transport Droid object The transporter that just landed. 3.2 Return value Warzone does not pro
Page: eventTransporterLaunch()
Triggered when a mission transporter has been instructed to launch.... Syntax function eventTransporterLaunch(transport) { // do stuff } Parameters Parameter Type Mandatory Notes Game version transport Droid object The transporter that was launched. 3.2
Page: eventVideoDone()
eventVideoDone() An event that is run when a video show stopped playing. I have no idea how to start a video playing :s Possibly related? playSound()
Page: extraPowerTime()
Increase the player's power reserve as if they'd played the game for an additional number of seconds... Syntax extraPowerTime(time, player); Parameters Parameter Type Mandatory Notes Game Version time Number The extra time, in seconds, the player is gra

F

Page: FACTORY
a normal factory that can produce land vehicles (incl. hovercraft) usually there can be 5 of these per player, game settings allow limit to be set between 0 (none) and 5. some mods exist that allow more
Page: FEATURE
a Feature object
Page: Feature object
Feature objects describe inanimate game objects such as oil barrels and resources, artefacts, log cabins and skyscrapers, trees, etc. Properties Inherits all the properties of a Game objects (id, x, y, z, player, selected, name, health, armour, thermal,
Page: Features
Trivia Features are owned by player 12 (oil drums/barrels, artefacts and oil resources) or player 99 (everything else). Bounders are indestructible. Oil barrels and artefacts can only be destroyed by picking them up. Oil resources can only be destroyed by
Page: findResearch()
Overview Returns a list of technologies that need to be researched to achieve a specific research goal. This is an incredibly useful function because you can use it to make decisions about your research path. Availability Warzone 3.2 and above. Syntax var
Page: Functions
<--- functions moved to topics shown in sidebar
Page: Functions 3.1
Matrix of functions availability in Warzone 3.1... Changes by version Versions where nothing changed are not included. You might need to horizontally scroll this table to see the last few columns, sorry about that... Functions ↓Click links for docs 3.1

G

Page: Game Configuration
There's two parts to game settings - the game set-up, and player initialisation... Game set-up Game set-up is currently beyond the realms of the JS API – the game settings are defined in the following ways: Via GUI: Skirmish Game Screen, Multiplayer Gam
Page: Game objects
The common properties for all objects that appear on the map such as droids, features and structures. Properties Property Type Description Game Version type Constant DROID, STRUCTURE or FEATURE (as applicable) Additional properties are added depending o
Page: gameOverMessage()
Overview End the game in either victory or defeat. The game rules (rules.js https://github.com/Warzone2100/warzone2100/blob/master/data/mp/multiplay/skirmish/rules.js) determine when a game is over and call this function accordingly. Availability Warzone
Page: gameTime
An integer representing the number of milliseconds since the game started. Notes When the game is paused, the game timer is also paused. The JS API will update the value of gameTime every time it calls your script, for example when triggering an event o
Page: GATE
a gate that will open when a droid owned by same player is nearby
Page: generatorsRequired(player)
Determine if more generators are required to power our oil derricks. Code function generatorsRequired(player) { if (player == null) { player == me; } else if (player<0 || player>maxPlayers) { return 0; } var num_res = enumStruct(player,RESOURCE_EXTRACTO
Page: getBurnDamage()
Get the base damage applied per second to a player's burning objects... Syntax amount = getBurnDamage(player); Parameters Parameter Type Mandatory Notes Game Version player Number The player who's burn damage setting should be changed. 3.2 Return values
Page: getBurnTime()
Define how long units burn for when they catch fire... Syntax var time = getBurnTime(player); Parameters Parameter Type Mandatory Notes Game Version player Number The player to inspect. 3.2 Return values Value Type Notes Game Version <time> Number The p
Page: getDroidLimit()
Get the current production limit for a specific droid type or the total number of droids a player can produce... Syntax var limit = getDroidLimit(player[, droidType]); Parameters Parameter Type Mandatory Notes Warzone Version player Number The id of the
Page: getDroidProduction()
Determine what droid, if any, a factory is currently producing... Syntax var fakeDroid = getDroidProduction(factory); Parameters Parameter Type Mandatory Notes Game Version factory Structure object The structure object associated with the factory to che
Page: getEnemyPlayerIDs()
Returns an array of all enemy player IDs, including scavengers, using caching for extra performance. Code const ENEMY_ID_LIST_TTL = 5000; // cache TTL (time to live) for getEnemyPlayerIDs() function // getEnemyPlayerIDs() will return an array of enemy
Page: getExperienceModifier()
Set the rate at which droids gain experience... Syntax getExperienceModifier(player) Parameters Parameter Type Mandatory Notes Game Version player Number The player to inspect. 3.2 Return values Value Type Notes Game Version 3.2 <error> Error Invalid pa
Page: getLabel()
Get the label, if any, associated with a game object... Syntax var labelName = getLabel(object); Parameters Parameter Type Mandatory Notes Game version object Game object The object to inspect. 3.2 Return value Value Type Notes Game version <labelName>
Page: getMissionTime()
Get the current value of the mission timer... Syntax var time = getMissionTime(); Parameters No parameters. Return value Value Type Notes Game Version <time> Number The amount of mission time remaining, in seconds. 3.2 -1 Number The timer is not active.
Page: getObject()
Three ways to retrieve a specific object... Syntax // Syntax #1: Retrieve object by label: var obj = getObject(labelName); // Syntax #2: Retrieve object by location (map tile): var obj = getObject(x, y); // Syntax #3: Retrieve object by player, id a
Page: getResearch()
getResearch(research) Fetch information about a given technology item, given by a string that matches its definition in "research.txt". returns a Research object if the tech item was found, otherwise it throws an error if not found (nasty!!)
Page: getStructureLimit()
Determine the structure limits for a given type of structure... Syntax var limit = getStructureLimit(structureID[, player]); Parameters Parameter Type Mandatory Notes Game Version structureID String The ID of the structure to check. 3.1.0 player Number
Page: getThreatsNear(x,y[,range])
Returns an array of dangerous enemy objects near a specific location on the map. Code const DEFAULT_THREAT_RANGE = 10; // default range (in tiles) for getThreatsNear() function // getThreatsNear(x,y[,range]) will return an array of dangerous enemy objec
Page: getWeaponInfo()
getWeaponInfo(weaponID) Warzone 3.2+ returns weapon object
Page: Globals
Page: Globals 3.1
Matrix of globals availability in Warzone 3.1... Changes by version Globals ↓Click links for docs 3.1 Master 20120109 3.1 Beta 1 3.1 Beta 2 3.1 Beta 4 3.1 Beta 5 & 6 3.1 Beta 10 3.1 Beta 11 3.1 RC 2 alliancesType baseType derrickPositions[] difficul
Page: GROUP
A group object. Availabilty Requires: Warzone 3.2 or above
Page: Group Object
A group of Game objects... Properties Property Type Notes Availability id Number The group ID. You can retrieve the objects in the group using enumGroup(). type Constant GROUP Notes Group objects are currently only defined in labels.ini and are only acc
Page: groupAdd()
Add a game object to a group... Syntax groupAdd(group, gameObj); Parameters Parameter Type Mandatory Description Game version group Number The unique ID of the group you want to add to. If the group ID doesn't exist, a group will be created automaticall
Page: groupAddArea()
Add most objects within an area of the map to a group... In need of technical review - looks like some stuff has changed http://forums.wz2100.net/viewtopic.php?f=35&t=10606 in WZ 3.2. Also, looks like the x,y params were world coords instead of tile coord
Page: groupAddDroid()
Add a droid to an existing group... Syntax groupAddDroid(group, droid); Parameters Parameter Type Mandatory Description Game version group Number The unique ID of the group. The ID is the return value of the newGroup() function called when creating the
Page: Groups
Organise game objects in to groups for easier iteration... What are groups? Groups are collections of Game objects. There are several benefits to using groups instead of custom arrays: Objects will be removed from groups automatically if they are destro
Page: groupSize()
Find out how many droids there are in a specific group... Syntax var size = groupSize(groupID); Parameters Parameter Type Mandatory Description Game version groupID Number The ID of the droid group. This ID is generated when you create a new group using
Page: groupSizes[]
An array of group sizes... Syntax // size of a group var size = groupSizes[id]; // will throw error if element missing // next available group ID var numGroups = groupSizes.length; Properties Property Type Mandatory Description Game version id Number

H

Page: hackAssert()
Assert a value and throw a game assert and JS error if it's falsey... Syntax hackAssert(value, message); Parameters Parameter Type Mandatory Notes Warzone Version value Variant The value to assert as truthy. 3.2 message String A message to associate wit
Page: hackGetObj()
Retrieve a game object based on it's type, player and ID... Syntax var gameObj = hackGetObj(type, player, id); Parameters Parameter Type Mandatory Description Game version type Constant The type of object to retrieve: DROID – a Droid object FEATURE – a
Page: hackMarkTiles()
Highlight map tiles with a pulsing red glow... Syntax // syntax #1: POSITION or AREA label hackMarkTiles(labelName); // syntax #2: x,y tile reference hackMarkTiles(x, y); // syntax #3: area co-ordinates hackMarkTiles(x, y, x2, y2); // syntax #4: c
Page: hackNetOff()
Used to disable network updates during Player Initialisation... Syntax hackNetOff(); // initialise players here hackNetOn(); Parameters No parameters. Return values Does not return anything. Example See Player Initialisation for more information. This f
Page: hackNetOn()
Syntax hackNetOff(); // initialise players here hackNetOn(); Parameters No parameters. Return values Does not return anything. Example See Player Initialisation for more information. This function should only be used during Player Initialisation. The func
Page: HARD
Act like a seasoned MP player... Overview At "Hard" difficulty level, your AI should act like a seasoned MP gamer: Use specialised build orders Use adaptive research paths Use excellent droid designs and attack in groups Use micro-management and early r
Page: How To's
Page: HQ
command center (CC) enables minimap - see also: setMiniMap() enables unit design - see also: setDesign() usually there can be only one of these per player trivia: if you nexus link an enemy CC, you steal map visibility data (ie. you get to see what that C

I

Page: iHave(structure)
Quickly determine if a structure of the specified type has been fully built. Code // iHave(structureTypeOrID) returns true if you have // at least one of those structures fully built var iHave = (function(){ var buildingIsBuilt = function(building) { re
Page: include()
Include library scripts in to your main script... Syntax var returnValue = include(file); Parameters Parameter Type Mandatory Description Game verison file String The path (relative to your mods folder), file name and extension of the file that should b
Page: Index
Alphabetical page index... h2, .smalltext {display:none;visibility:hidden;}
Page: INSANE
Be evil, cheat if you have to... Overview At "Insane" difficulty, your AI is free to use every dirty trick in the book in order to win the game. AI Cheating is almost certainly required. The human who chose "Insane" wants the fiercest possible ally or o
Page: INTELMAP
Overview Used to show or hide the "Intelligence" (earth map) reticule button. reticule.png See also: addReticuleButton() – display a reticule button removeReticuleButton() – hide a reticule button setTutorialMode() – you need to be in tutorial mode before
Page: Interactions
Page: Introduction
Warzone2100 contains a scripting language for implementing AIs, campaigns and some of the game rules... Introduction This wiki contains a more detailed version of the API documentation, with example code and extensive inter-linking to related topics. Th
Page: isMultiplayer
Determine if the game is an online multiplayer game... Notes Use this global to determine if your script is running in an online multiplayer game, with multiple human players. true – Multiplayer false – Skirmish, Challenge or Campaign You can determine
Page: isStructureAvailable()
isStructureAvailable(structure type[, player]) checks to see if a structure (specified by name, not constant) is available checks that the player can build another structure of this type (takes in to account research and structure limits) player param d
Page: isTransporter(droidObj)
Determine if a droid object is a transporter. Notes The code snippet below adds an isTransporter() function that returns true if the passed in object is a transport. Code var transportTypes = [ DROID_TRANSPORTER, DROID_SUPERTRANSPORTER ] // Determine
Page: isVTOL()
Overview Determine if a droid is using VTOL propulsion. You can use this function on droids owned by any player, not just your own. weather-balloon.jpg Note: Recent versions of the API provide an .isVTOL property on Droid objects. Availability Warzone 3.1

J

Home page: Javascript API
AtmosphereJavascript API Atmosphere Components & TemplatesJavascript API Components & Templates DroidsJavascript API Droids Events & TimersJavascript API Events & Timers FeaturesJavascript API Features Game ConfigurationJavascript API Game Configuration G
Page: Javascript Debugger
The JS debugger allows you to inspect scripts and labels... How do I access it? Enter cheat mode and then use cheat code "jsdebug". Script tabs scripts.pngEach scripting environment has it's own tab. The name shown on the tab is the value of scriptName

K

L

Page: label()
Retrieve the object associated with a label... Syntax var returnValue = label(labelName); Parameters Parameter Type Mandatory Description Game version labelName String The label whose associated object you want to retrieve. 3.1 Beta 2 Return value Value
Page: Labels
Functions for labelling objects... What are labels? A label is a string that can be associated with an object, and later used to retrieve that object: A label can only be associated with one object at a time An object can have multiple labels at the sam
Page: LASSAT
a laser satellite command post usually you can only have one of these per player, they can be disabled during game set-up see also: activateStructure() – fire laser eventStructureReady() – when laser is charged structureIdle() – determine if laser is char
Page: loadLevel()
Mark the current mission as complete and start a new level in a campaign... Syntax loadLevel(level); Parameters Parameter Type Mandatory Notes Game Version level String The level to load, as defined in the campaign data. For more information see Creatin
Page: Location objects

M

Page: makeComponentAvailable()
Make a component available to the player so they can use it in droid designs... Syntax makeComponentAvailable(component, player); Parameters Parameter Type Mandatory Notes Game version component String The component to make available. 3.1 Beta 1 player
Page: makeTemplate()
Create a fake droid object that can be used to inspect droid attributes prior to production... Syntax var result = makeTemplate(player, name, body, prop, reserved, t1[, t2[, t3]]); Parameters Parameter Type Mandatory Description Game version player Numb
Page: Making your first AI mod
Scenario I want to make an AI mod for warzone, where do I start? Solution An AI mod requires you to do 5 things: Create folder structure in which to place your files Create an ".ai" file that tells Warzone about your AI script Create a ".js" file that con
Page: MANUFACTURE
Overview Used to show or hide the "Maufacture" (factory) reticule button. reticule.png See also: addReticuleButton() – display a reticule button removeReticuleButton() – hide a reticule button setTutorialMode() – you need to be in tutorial mode before usi
Page: Map
Trivia Edit maps using FLAME. Structures pre-placed on maps will be removed at the start of the game depending on what baseType the host selects. The maximum map size is currently 256x256 tiles, however most maps are 250x250 or smaller. Each tile is 128x1
Page: mapHeight
Overview Defines the map height, in tiles, as an integer. A tile is 128 pixels in size. Currently, the largest map http://forums.wz2100.net/viewtopic.php?f=35&t=8816 can be 256 tiles high, however most map editors are limited to 250 tiles high.
Page: mapName
Overview A string containing the name of the map being played. This can be quite useful when your script behaves oddly on a certain map - you can use mapName to make your script behave differently when played on that map. For example, on a map with lots o
Page: mapWidth
Overview Defines the map width, in tiles, as an integer. A tile is 128 pixels in size. Currently, the largest map http://forums.wz2100.net/viewtopic.php?f=35&t=8816 can be 256 tiles wide, however most map editors are limited to 250 tiles wide.
Page: maxPlayers
Defines the maximum number of human/AI player slots on the current map, regardless of whether those slots are filled in the current game. Notes Scavenger faction is not a normal player slot as far as Warzone is concerned. For more information, see scave
Page: me
Stores the player ID your script is associated with... Syntax me Values The value of me, which is read-only, will be an integer in the range -1 ≤ me ≤ Math.max(scavengerPlayer, maxPlayers): Value Notes Game version -1 Means your script will receive even
Page: MEDIUM
Act like a regular skirmish player... Overview At "Medium" difficulty level, the human that set-up the game is expecting your AI to act like a seasoned skirmish player: Use a more beneficial build order (factories and labs before power gens and HQ) Chos
Page: Mini Map and Design Mode
Enable or disable the mini map and design mode depending on the presence of a HQ. Summary Under normal game rules a HQ is required to enable the Design Mode (droid design tool) and mini map. If the HQ gets destroyed, both those features must be disabled
Page: Missions / Campaign
Trivia There are currently 3 campaigns in Warzone, with several more being planned .wiki-content ul {padding-left: 16px;} Functions centreView() enumGateways() enumLabels() enumStructOffWorld() gameOverMessage() label() loadLevel() playSound() setMissionT

N

Page: Native JS Features
A summary of the native Javascript features of the Warzone JS environment. Native JS Environment Features To find out what's in the JS environment, I used my tracebot AI script to prod and poke at various things. Each of the headings below represents so
Page: newGroup()
Create a new droid group... Syntax var returnValue = newGroup(); Parameters This function does not have any parameters. Return value Value Type Notes Game version <groupID> Number The unique ID for the newly created group. 3.1 Beta 1 Example var myGroup
Page: NO_ALLIANCES

O

Page: Objects
The JS API has several object types that you'll encounter regularly when developing scripts... JS API Objects Each object has a number of properties that defines its specific attributes. For more information, see the links below: Note: PLAYER_DATA & RE
Page: objFromId()
Retrieve a game object based on it's ID... Syntax var gameObj = objFromId(idObj); // use with care!! Parameters Parameter Type Mandatory Description Game version idObj Object An object that has an .id property who's value is the ID of the object you wis
Page: OIL_DRUM
Indicates an oil drum (barrel) Feature object... appear as green-ish smudges on the minimap eventPickup DORDER_PICKUP Availability Requires: Warzone 3.2 or above
Page: OIL_RESOURCE
Indicates an oil resource Feature object... Overview To use an oil resource, you must fist build a RESOURCE_EXTRACTOR on top of it and then power the extractor with a POWER_GEN. oil.jpeg Availability Requires: Warzone 3.2 or above
Page: OPTIONS
This constant is deprecated, use COMMAND instead.
Page: orderDroid()
Overview Send a basic command, that does not require an object or location, to a droid. Availability Warzone 3.2 and above. backport_icon.png Backport to earlier versions with backport.orderDroid.js and backport.dorder.js. Syntax var returnValue = orderDr
Page: orderDroidBuild()
Order a construction droid to build a new structure... This article is in need of technical review – specifically it seems that in Warzone 3.1.x the function is not returning true when the order is successful. Please see comments at bottom of page for mor
Page: orderDroidLoc()
orderDroidLoc(droid, order, x, y) Give a droid an order to do something at the given location.
Page: orderDroidObj()
orderDroidObj(droid, order, object) Give a droid an order to do something to something.
Page: orderDroidStatsLoc()
Early implementation of orderDroidBuild()... Syntax Deprecated, use orderDroidBuild() instead. orderDroidStatsLoc(droid, order, structureID, x, y); Parameters Parameter Type Mandatory Notes Game Version droid Droid object The droid that will build the s
Page: orderGroupObj(group,dorder,obj)
Similar to orderDroidObj() but for a group of droids Code function orderGroupObj(group,dorder,obj) { enumGroup(group).forEach(function(droid) { if (droid.type==DROID) orderDroidObj(droid,dorder,obj); }); } Example // when attacked, tell all droids in a

P

Page: pickStructLocation()
Find a good location for a specific droid to build a specific structure. Syntax var pos = pickStructLocation(droid, structure, x, y); Parameters Parameter Type Mandatory Notes Game Version droid Droid object The construction droid that will do the build
Page: Player Initialisation
Initialise player structures, components, technologies and bases before the game starts... Summary Player initialisation takes within rules.js during eventGameInit(): Enabling certain structures Enabling certain cyborg components Enabling primary techno
Page: Player object
Specifies useful static information about a specific player in the game. Properties Property Type Description Game version difficulty Constant The player's difficulty level, which can be set for AI players on the game set-up screen: difficulty Human pla
Page: Player Scope
These constants group players in various ways. Constants The constants are generally used with chat features (chat() and eventChat()) or game object enumeration (enumRange() or enumArea()). Constant Chat Enums Notes Game Version ALL_PLAYERS Send message
Page: 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 ma
Page: PLAYER_DATA
Indicates the object contains player data. Notes This constant is assigned to the .type property of Player objects (which are located in the playerData[] array). Backporting The constant was added in Warzone 3.1 Beta 11. You can easily backport it to ea
Page: playerData[]
An array of Player objects describing each human/AI player slot on the current map regardless of whether those slots have been assigned players for the current game. Overview By inspecting the player data stored in this array, you can determine some use
Page: playerPower()
Find out how much available power a specific player has... Syntax var returnValue = playerPower([player]); Parameters Parameter Type Mandatory Description Game version player Number The player to inspect. Defaults to "me". 3.1 Beta 1 Return value Value
Page: Players
Page: Players & Alliances
Player data and scripts, alliances/teams, and player interactions... How are they defined? Players and their alliances/teams are defined during game set-up. There are several ways which game set-up can be performed: Skirmish Game Screen or Multiplayer G
Page: playSound()
Overview Plays a sound, optionally displaying a beacon on the map and mini map. Sounds (and their beacons if applicable) are added to a queue so that if multiple sounds are requested they will be played one after the other. Sounds and beacons will only be
Page: POSITION
a Position object
Page: Position object
Defines a position on the map via its x,y co-ordinates. Properties Property Type Description Game version type Constant POSITION 3.1 x Number The x co-ordinate of the position 3.1 y Number The y co-ordinate of the position 3.1 Availability Available sin
Page: Power
<stub page>
Page: POWER_GEN
a power generator, required to "power" oil derricks what actually happens is that power gens burn oil generated by derricks to produce $ (but everyone refers to $ as "power") - somewhat confusing game mechanic really - more on that here: http://forums.wz2
Page: powerType
Defines the rate at which oil derricks produce power, prior to applying any power upgrades. Values The power level setting defines the rate at which your derricks produce oil. The higher the power level, the more oil they will produce. In Warzone 3.2+,
Page: Prioritising research
This article is in dire need of a technical review and update. Ignore it for now. Scenario Based on events in the game, how can I change my research priorities? This is a tricky one, and the solution below is very much a work in progress (it's not even
Page: propulsionCanReach()
Find out if a specific propulsion can travel between two points on the map... Syntax var returnValue = propulsionCanReach(propulsion, x1, y1, x2, y2); Parameters Parameter Type Mandatory Notes Game version propulsion String A string defining the propuls
Page: pursueResearch()
pursueResearch(lab, research) Start researching the first available technology on the way to the given technology. First parameter is the structure to research in, which must be a research lab. The second parameter is the technology to pursue, as a text s

Q

Page: queue()
Invoke a function at some point in the future... Syntax // syntax #1: optional game object as third parameter (WZ 3.1 b1+) queue(functionName, delay[, gameObject]); // syntax #2: optional string as third parameter (WZ 3.2+) queue(functionName, delay[,
Page: queuedPower()
Find out if your power reserves have gone negative, indicating that you have one or more tasks stalled due to lack of power... Syntax var power = queuedPower(player); Parameters Parameter Type Mandatory Description Game version player Number The player
Page: Quick Reference
Links to all the main JS API features (see also: Index or Contents)... Atmosphere Atmosphere Components & Templates Components & Templates Droids Droids Events & Timers Events & Timers Timers Features Features Game Configuration Game Configuration Groups
Page: Quickly testing script changes
Scenario What's the fastest way to check changes to my scripts? Solution If you're just checking changes to a script, you don't need to keep reloading Warzone every time you make a change. Instead, just start a new skirmish, MP, challenge or campaign and

R

Page: Random Stuff
Overview This section contains some random things that you might find useful... Guides
Page: REARM_PAD
a vtol rearming pad usually a player can have up to 50 of these. game settings allow limit to be set between 0 (none) and 50 (default). some mods exist that allow more. vtols will continue attacking their last target (if it still exists) or their last pat
Page: removeBeacon()
Send a beacon to a specific player or allies... Syntax removeBeacon(sentTo); Parameters Parameter Type Mandatory Notes Game Version sentTo Number Constant The player id who you had previously sent a beacon to. Alternatively you can send the beacon to al
Page: removeLabel()
Remove a label from the game... Syntax removeLabel(label); Parameters Parameter Type Mandatory Notes Warzone Version label String The label to remove. 3.2 Return value Value Type Notes Warzone Version <number> Number The number of labels that were remov
Page: removeObject()
Remove a game object from the map... Syntax removeObject(obj[, effect]); Parameters Paramter Type Mandatory Notes Game version obj Game object The object to remove. 3.2 effect Boolean Should the destruction effect be played? true – yes, make it explode
Page: removeReticuleButton()
Disable a reticule button... Syntax removeReticuleButton(button); Parameters Parameter Type Mandatory Description Game version button Constant A constant defining which button to hide: reticule.png For more information, see: Reticule buttons 3.1 Beta 1
Page: removeStruct()
Immediately remove a structure object from the map... Syntax if (typeof removeObject == "function") { // use new method removeObject(structureObj); } else { // use old method removeStructure(structureObj); } Parameters Parameter Type Mandatory Notes Gam
Page: removeTimer()
Allows you to cancel all queued and timed calls associated with a specific function... Syntax The queue() function uses the timer functionality behind the scenes, so when you use removeTimer() it will remove both timers and queued calls for the specifie
Page: REPAIR_FACILITY
a repair facility that can repair land units (incl. hovercraft and cyborgs) usually a player can have up to 5 of these. game settings allow limit to be set between 0 (none) and 5 (default). some mods exist that allow more send a droid to DORDER_REPAIR
Page: RESEARCH
Overview Used to show or hide the "Research" (green circuit board) reticule button. reticule.png See also: addReticuleButton() – display a reticule button removeReticuleButton() – hide a reticule button setTutorialMode() – you need to be in tutorial mode
Page: Research & Technology
Trivia The baseType setting defines which technologies will be already researched at the start of the game. Instruct your droids to pick up artefacts (DORDER_RECOVER) to gain new technologies Attacking enemy factories with a NEXUS Link turret will sometim
Page: Research object
Describes various attributes related to a specific researchable technology. Properties Property Type Description Game Version power Number The number of power points required to start the research. 3.1 points Number The number of research points require
Page: RESEARCH_DATA
An object with .type == RESEARCH_DATA is a research object, eg. from enumResearch() and findResearch() results. v3.1 beta 11
Page: RESEARCH_LAB
a research lab for researching technologies using pursueResearch() function, calling eventResearched() when completed usually player can have up to 5 of these, game settings allow limit between 0 and 5, some mods exist that allow more
Page: resetArea()
Reset a labelled area trigger... Syntax resetArea(label[, filter]); Parameters Parameter Type Mandatory Notes Warzone Version label String The label associated with an Area object. 3.2 filter Number Constant Optionally filter whose droids will trigger t
Page: RESOURCE_EXTRACTOR
an oil derrick they can be built on oil resources power gens are needed to make oil derricks pump oil - see POWER_GEN for more info on that because players can usually only have max 5 power gens, that translates in to a max of 20 derricks that you can "po
Page: Reticule buttons
In order to add or remove reticule buttons, you need to be in tutorial mode - see setTutorialMode() for details. Overview These constants are used by addReticuleButton() and removeReticuleButton(). Reticule buttons are shown below, indicating which consta

S

Page: safeDest()
Overview Determine if, based on the script player's current knowledge of the map, whether a specific map location is safe or not. Because this function is based on knowledge of the map, any enemy droids/structures that are in the fog of war (or otherwise
Page: SAT_UPLINK
a satellite uplink station usually a player can have just one of these. game settings allow range of 0 (none) to 1. some mods exist that allow more. if allies build a sat uplink, you will also see whole map as they share their map data with you see also:
Page: Save / Load Cycle
<stub article>
Page: Saved game files
Scenario How do I work out what data is getting stored in save game files? Will it show me why my script is broken? If you run in to problems with the save/load cycle, it's often useful to inspect savegame files - you'll be able to see exactly (well, sort
Page: scavengerPlayer
Defines the player ID for the scavenger faction on the map. Values The scavenger player always uses a fixed player slot on maps, depending on the number of players the map is designed to accommodate. maxPlayers: 2 3 4 5 6 7 8 9 10 scavengerPlayer value:
Page: scavengers
Indicates whether scavengers are enabled in this game. Values Icon Value Notes image_scavengers_on_hi.png true Scavengers are enabled. However, this doesn't mean there will be scavengers on the map! The map must define a scavenger base for the scavenger
Page: Scopes & Closures
This article explains some important javascript concepts... Scope All variables and constants in Javascript are stored in a "scope". I'll explain why it's called a "scope" later. There's a "global scope", that everything can see: var str1 = "global"; Th
Page: Script Environment
This section contains general information about the Javascript environment used by Warzone. Are there any processing time limits? There's no hard time-liimt, like there is in a web browser. Instead, Warzone has "soft limits" that are used to detect prob
Page: scriptName
The filename of the main script loaded in to a particular scripting environment... Syntax scriptName Values This is the filename, without the extension or path, of the main script that was loaded in to your scripting environment. Examples: if the script
Page: scriptPath
The path to the main script loaded in to a particular scripting environment... Syntax scriptPath Values This is the path, without the filename or extension, of the main script that was loaded in to your scripting environment. Examples: for AIs, for some
Page: selectedPlayer
Overview Indicates which player is currently being played/viewed by the human on the current machine. This can be useful on challenges and skirmishes, as it tells you who the human player is if you capture the value of selectedPlayer at the very start of
Page: setAlliance()
setAlliance(player1, player2, value) Warzone 3.2+
Page: setAssemblyPoint()
setAssemblyPoint(struct, x, y) warzone 3.2+
Page: setBurnDamage()
Define the base damage applied per second to burning objects... Syntax setBurnDamage(player, amount); Parameters Parameter Type Mandatory Notes Game Version player Number The player who's burn damage setting should be changed. 3.2 amount Number The amou
Page: setBurnTime()
Define how long units burn for when they catch fire... Syntax setBurnTime(player, time); Parameters Parameter Type Mandatory Notes Game Version player Number The player who's burn time should be changed. 3.2 time Number The amount of time, in millisecon
Page: setDesign()
Enable or disable the design tool... Syntax setDesign(enable); Parameters Parameter Type Mandatory Description Game version enable Boolean Should the design tool be enabled? true – yes, enable the design tool false – no, disable the design tool Default:
Page: setDroidExperience()
setDroidExperience(droid, experience) Set the amount of experience a droid has. Experience is set using floating point precision. droid param = a Droid object you can use the .experience property of a Droid object to find the current experience of a droid
Page: setDroidLimit()
Define the maximum number of droids a player can create. Syntax setDroidLimit(player, limit[, droidType]); Parameters Parameter Type Mandatory Notes Warzone Version player Number Which player(s) should the droids be counted for? Specify the player id fo
Page: setExperienceModifier()
Set the rate at which droids gain experience... Syntax setExperienceModifier(player, percent) Parameters Parameter Type Mandatory Notes Game Version player Number The player who's droid's will be affected 3.2 percent Number The percentage at which droid
Page: setMiniMap()
Display or hide the localhost human player's radar mini-map... Syntax setMiniMap(show); Parameters Parameter Type Mandatory Description Game version show Boolean Should the minimap be shown? true – yes, show the mini map false – no, hide the mini map De
Page: setMissionTime()
Set or clear the mission countdown timer... Syntax setMissionTime(time); Parameters Parameter Type Mandatory Notes Game Version time Number Defines the amount of time the player has to complete the mission, causing a mission timer to be shown to the use
Page: setNoGoArea()
setNoGoArea(x1, y1, x2, y2, player) Creates an area on the map on which nothing can be built. If player is zero, then landing lights are placed. If player is -1, then a limbo landing zone is created and limbo droids placed. what is a limbo landing zone? a
Page: setPower()
Set the power reserves for a player... Syntax setPower(power[, player]); Parameters Parameter Type Mandatory Description power Number The amount of power to give to the player. player Number Optionally define which player will get the power. Default: me
Page: setPowerModifier()
setPowerModifier(power[, player]) Set a player’s power modifier percentage. (Do not use this in an AI script.) WZ 3.2+
Page: setReinforcementTime()
Set or clear reinforcement timer... Syntax setReinforcementTime(time); Parameters Parameter Type Mandatory Notes Game Version time Number Defines the amount of time before reinforcements arrive, causing a reinforcement timer to be shown to the user. In
Page: setScrollParams()
setScrollParams(x1, y1, x2, y2) Limit the scrollable area of the map to the given rectangle.
Page: setSky()
Set the sky image, rotation speed and scale... Syntax var success = setSky(texturePage, windSpeed, skyboxScale); Parameters Parameter Type Mandatory Notes Warzone Version texturePage String Sets the sky image. Can reference either an existing page name
Page: setStructureLimits()
Set limits on how many structures of a specific type a player can build. Syntax hackNetOff(); setStructureLimits(structure,limit[,player]); applyLimitSet(); // need to call this to apply the limits hackNetOn(); Parameters Parameter Type Mandatory Descri
Page: setSunIntensity()
Change the lighting effects applied to game objects... Syntax setSunIntensity(aR, aG, aB, dR, dG, dB, sR, sG, sB); Properties Property Type Mandatory Notes Game Version aR Number Ambient Red light. Game default: 0.5 3.2 aG Number Ambient Green light. Ga
Page: setSunPosition()
Set the position of the Sun, which affects shadows on the map... Syntax setSunPosition(x, y, z); Parameters Parameter Type Mandatory Notes Warzone Version x Number The x-position of the Sun Game default: 225.0 3.2 y Number The y-position of the Sun Game
Page: setTimer()
Allows you to trigger a function at some point in the future. Syntax // syntax #1: optional game object as third parameter (WZ 3.1 b1+) setTimer(functionName, delay[, gameObject]); // syntax #2: optional string as third parameter (WZ 3.2+) setTimer(func
Page: setTransporterExit()
Define the location where transports will exit the map... Syntax setTransporterExit(x, y, player); Parameters Parameter Type Mandatory Notes Game version x Number The x co-ordinate where the transport should disappear. 3.2 y Number The y co-ordinate whe
Page: setTutorialMode()
Toggles "tutorial mode" in a single-player game... Syntax setTutorialMode(active); Parameters Parameter Type Mandatory Notes Game version active Boolean Make tutorial mode active? true – yes, tutorial mode is active false – no, the game is in normal mod
Page: setWeather()
Sets the weather effect applied to the whole map. Syntax setWeather(weather); Parameters Parameter Type Mandatory Notes Warzone Version weather Constant Defines the type of weather to apply: 3.2 Return value Unknown at present. Example // make it rain s
Page: startPositions[]
An array of player starting positions on the map. Overview When you start a game, you see starting positions shown on the map preview – 'startPositons' is an array of Position objects defining the co-ordinates of those starting positions. The array inde
Page: startTransporterEntry()
Bring a mission transporter on to the map... Syntax startTransporterEntry(x, y, player); Parameters Parameter Type Mandatory Notes Game version x Number The x co-ordinate where the transport should appear from. 3.2 y Number The y co-ordinate where the t
Page: Stats
UNDER CONSTRUCTION A read-only list of the default game stats (prior to any modifiers or upgrades) for droid components, buildings, etc... Syntax // normal syntax (component/building stats) var val = Stats.<section>[<name>].<property> // syntax specif
Page: STRUCTURE
a Structure object
Page: Structure object
Describes a structure (something a truck can build) on the map. Properties Inherits all the properties of a Game objects (id, x, y, z, player, selected, name, health, armour, thermal, born, etc.) then adds/overrides the properties listed below. Property
Page: structureIdle()
Check if a structure is idle... Syntax var returnValue = ( (structure.status == BUILT) && structureIdle(structure) ); Parameters Parameter Type Mandatory Notes Game version structure Structure object The structure to examine. See warning box top-right o
Page: Structures
Trivia The baseType setting determines which map-defined structures will be removed during Player Initialisation. .wiki-content ul {padding-left: 16px;} Functions activateStructure() addStructure() bind() enableStructure() enumArea() enumRange() enumStruc
Page: syncRandom()
Generate a synchronised random integer... Syntax var returnValue = syncRandom(limit); Parameters Parameter Type Mandatory Description Game verison limit String The upper limit of the random number. The number will be in the range: 0 ≤ <number> < limit.

T

Page: Template Object
An object describing a droid template... Properties It's not clear what values will be present for properties that are not applicable - eg. if construction droid can't have an ECM turret or weapon turret, so what would the 'ecm' and 'weapons' properties
Page: tilesetType
A global which states the major tileset used by the current map... Syntax tilesetType Values The constant will have one of the following String values: "ARIZONA" "URBAN" "ROCKIES" "CUSTOM" The tilesetType global is read-only so it's value cannot be chan
Page: Timers
Page: To-Do List
Overview Just a dumping ground for things I spot in the forums that need adding to this guide... Next docs to get attention...

U

Page: Useful Links
There's lots of useful information elsewhere on the intertubes... Official JS API guide The JS API guide that's provided by the development team is generated from comments in the game's source code. While it's more basic than the guide you'll find on th
Page: User Interface
CameraUser Interface Camera Mini Map and Design ModeUser Interface Mini Map & Design Mode Reticule buttonsUser Interface Reticule buttons

V

Page: version
For Warzone 3.1 Beta 2 and earlier, only the Linux & Windows builds http://developer.wz2100.net/ticket/3187#comment:3 showed the correct version information. Other builds showed something like "TRUNK" or "MASTER". This bug was fixed in Warzone 3.1 Beta 4,
Page: VTOL_FACTORY
a factory capable of producing vtols and transporters usually a player can have up to 5 of these, game settings allow limit between 0 (none) and 5. some mods exist which allow more

W

Page: WALL
relates to walls, corner walls, and gates. not aware of any limits on this structure
Page: wasDemolished(structure)
Determine if a destroyed structure was demolished by trucks or engineers. Code // Determine if a STRUCTURE object is being demolished function wasDemolished(structure) { return (!structure.status); // status == 0 if structure was demolished } Example fu
Page: Weapon Object
An object describing a weapon turret... Properties Property Type Description Game version type <not implemented yet> name String The weapon turret id (eg. what weapon is it) 3.2 fullname String Human readable name of the weapon turret. 3.2 class Str
Page: WEATHER_CLEAR
Clears any active weather effect. Example setWeather(WEATHER_CLEAR); // weather effects stopped Only one weather effect can be active at any given time. Availability Requires: Warzone or above See also Environmental effects: setWeather()– apply a weathe
Page: WEATHER_RAIN
Adds a rain effect to the entire map, disabling any previous weather setting in the process. Example setWeather(WEATHER_RAIN); // rain starts, any other weather ends Only one weather effect can be active at any given time. Availability Requires: Warzone
Page: WEATHER_SNOW
Adds a snow effect to the entire map, disabling any previous weather setting in the process. Example setWeather(WEATHER_SNOW); // snow starts, any other weather ends Only one weather effect can be active at any given time. Availability Requires: Warzone
Page: Working with Commanders
<stub page>
Page: Working with Construction
<stub page> Methods of Construction There are two primary methods of construction in the JS API: orderDroidBuild() – Make a construction droid build the structure, like a player would in the game addStructure() – Instanly place a structure on the map This
Page: Working with Factories
This guide explains the basics of working with factories in your scripts... <stub page> Droid Bodies The number of factory modules determines which droid bodies can be produced... Tank Factory The Project New Paradigm The Collective NEXUS Other factory-
Page: Working with Modules
<stub page> factory modules research modules power gen modules What are modules? Modules are buildable upgrades for certain kinds of Structures – they make the structure more durable and able to perform it's task better. Note: The effects listed in the ta
Page: Working with Power
<stub article>
Page: Working with Repairs & Rearming
<incomplete stub article> eventDroidIdle() is triggered once the repairs/rearming is complete. You can keep track of every stage of the repair process by looking at the properties of the Droid object. If the .order property is DORDER_RTR, DORDER_RTR_SPE
Page: Working with Sensors
<stub page>
Page: Working with Transports
How to build and use transports... What are transports? Transports are special Droids that can transport other droids in their cargo holds. There are currently two types of transport: <pics & info> The main benefit of using transports is their ability t
Page: Working with VTOLs
<stub page>
Page: WZscript (.vlo and .slo) to Javascript (.js)
Under constuction! This guide is designed to help developers who are converting their old WZScripts to the new Javascript API... Introduction In the old Warzone scripting (WZscript) system, two files were required: .slo – the main wz script .vlo – varia

X

Y

Z

!@#$

  • No labels