This section describes various game objects defined by the script interface, and which are both accepted by functions and returned by them. Changing the fields of a game object has no effect on the game before it is passed to a function that does something with the game object.
Describes a research item. The following properties are defined:
powerNumber of power points needed for starting the research.pointsNumber of research points needed to complete the research.startedA boolean saying whether or not this research has been started by current player or any of its allies.doneA boolean saying whether or not this research has been completed.nameA string containing the full name of the research.idA string containing the index name of the research.typeThe type will always beRESEARCH_DATA.
Describes a structure (building). It inherits all the properties of the base object (see below). In addition, the following properties are defined:
statusThe completeness status of the structure. It will be one ofBEING_BUILTandBUILT.typeThe type will always beSTRUCTURE.costWhat it would cost to build this structure. (3.2+ only)stattypeThe stattype defines the type of structure. It will be one ofHQ,FACTORY,POWER_GEN,RESOURCE_EXTRACTOR,LASSAT,DEFENSE,WALL,RESEARCH_LAB,REPAIR_FACILITY,CYBORG_FACTORY,VTOL_FACTORY,REARM_PAD,SAT_UPLINK,GATEandCOMMAND_CONTROL.modulesIf the stattype is set to one of the factories,POWER_GENorRESEARCH_LAB, then this property is set to the number of module upgrades it has.canHitAirTrue if the structure has anti-air capabilities. (3.2+ only)canHitGroundTrue if the structure has anti-ground capabilities. (3.2+ only)isSensorTrue if the structure has sensor ability. (3.2+ only)isCBTrue if the structure has counter-battery ability. (3.2+ only)isRadarDetectorTrue if the structure has radar detector ability. (3.2+ only)rangeMaximum range of its weapons. (3.2+ only)hasIndirectOne or more of the structure's weapons are indirect. (3.2+ only)
Describes a feature (a game object not owned by any player). It inherits all the properties of the base object (see below). In addition, the following properties are defined:
typeIt will always beFEATURE.stattypeThe type of feature. Defined types areOIL_RESOURCE,OIL_DRUMandARTIFACT.damageableCan this feature be damaged?
Describes a droid. It inherits all the properties of the base object (see below). In addition, the following properties are defined:
typeIt will always beDROID.orderThe current order of the droid. This is its plan. The following orders are defined:DORDER_ATTACKOrder a droid to attack something.DORDER_MOVEOrder a droid to move somewhere.DORDER_SCOUTOrder a droid to move somewhere and stop to attack anything on the way.DORDER_BUILDOrder a droid to build something.DORDER_HELPBUILDOrder a droid to help build something.DORDER_LINEBUILDOrder a droid to build something repeatedly in a line.DORDER_REPAIROrder a droid to repair something.DORDER_PATROLOrder a droid to patrol.DORDER_DEMOLISHOrder a droid to demolish something.DORDER_EMBARKOrder a droid to embark on a transport.DORDER_DISEMBARKOrder a transport to disembark its units at the given position.DORDER_FIRESUPPORTOrder a droid to fire at whatever the target sensor is targeting. (3.2+ only)DORDER_COMMANDERSUPPORTAssign the droid to a commander. (3.2+ only)DORDER_STOPOrder a droid to stop whatever it is doing. (3.2+ only)DORDER_RTROrder a droid to return for repairs. (3.2+ only)DORDER_RTBOrder a droid to return to base. (3.2+ only)DORDER_HOLDOrder a droid to hold its position. (3.2+ only)DORDER_REARMOrder a VTOL droid to rearm. If given a target, will go to specified rearm pad. If not, will go to nearest rearm pad. (3.2+ only)DORDER_OBSERVEOrder a droid to keep a target in sensor view. (3.2+ only)DORDER_RECOVEROrder a droid to pick up something. (3.2+ only)DORDER_RECYCLEOrder a droid to factory for recycling. (3.2+ only)
actionThe current action of the droid. This is how it intends to carry out its plan. The C++ code may change the action frequently as it tries to carry out its order. You never want to set the action directly, but it may be interesting to look at what it currently is.droidTypeThe droid's type. The following types are defined:DROID_CONSTRUCTTrucks and cyborg constructors.DROID_WEAPONDroids with weapon turrets, except cyborgs.DROID_PERSONNon-cyborg two-legged units, like scavengers.DROID_REPAIRUnits with repair turret, including repair cyborgs.DROID_SENSORUnits with sensor turret.DROID_ECMUnit with ECM jammer turret.DROID_CYBORGCyborgs with weapons.DROID_TRANSPORTERCyborg transporter.DROID_SUPERTRANSPORTERDroid transporter.DROID_COMMANDCommanders.
groupThe group this droid is member of. This is a numerical ID. If not a member of any group, will be set to \emph{null}.armedThe percentage of weapon capability that is fully armed. Will be \emph{null} for droids other than VTOLs.experienceAmount of experience this droid has, based on damage it has dealt to enemies.costWhat it would cost to build the droid. (3.2+ only)isVTOLTrue if the droid is VTOL. (3.2+ only)canHitAirTrue if the droid has anti-air capabilities. (3.2+ only)canHitGroundTrue if the droid has anti-ground capabilities. (3.2+ only)isSensorTrue if the droid has sensor ability. (3.2+ only)isCBTrue if the droid has counter-battery ability. (3.2+ only)isRadarDetectorTrue if the droid has radar detector ability. (3.2+ only)hasIndirectOne or more of the droid's weapons are indirect. (3.2+ only)rangeMaximum range of its weapons. (3.2+ only)bodyThe body component of the droid. (3.2+ only)propulsionThe propulsion component of the droid. (3.2+ only)weaponsThe weapon components of the droid, as an array. Contains 'name', 'id', 'armed' percentage and 'lastFired' properties. (3.2+ only)cargoCapacityDefined for transporters only: Total cargo capacity (number of items that will fit may depend on their size). (3.2+ only)cargoSpaceDefined for transporters only: Cargo capacity left. (3.2+ only)cargoCountDefined for transporters only: Number of individual \emph{items} in the cargo hold. (3.2+ only)cargoSizeThe amount of cargo space the droid will take inside a transport. (3.2+ only)
Describes a basic object. It will always be a droid, structure or feature, but sometimes the difference does not matter, and you can treat any of them simply as a basic object. These fields are also inherited by the droid, structure and feature objects. The following properties are defined:
typeIt will be one ofDROID,STRUCTUREorFEATURE.idThe unique ID of this object.xX position of the object in tiles.yY position of the object in tiles.zZ (height) position of the object in tiles.playerThe player owning this object.selectedA boolean saying whether 'selectedPlayer' has selected this object.nameA user-friendly name for this object.healthPercentage that this object is damaged (where 100 means not damaged at all).armourAmount of armour points that protect against kinetic weapons.thermalAmount of thermal protection that protect against heat based weapons.bornThe game time at which this object was produced or came into the world. (3.2+ only)
Describes a template type. Templates are droid designs that a player has created. The following properties are defined:
idThe ID of this object.nameName of the template.costThe power cost of the template if put into production.droidTypeThe type of droid that would be created.bodyThe name of the body type.propulsionThe name of the propulsion type.brainThe name of the brain type.repairThe name of the repair type.ecmThe name of the ECM (electronic counter-measure) type.constructThe name of the construction type.weaponsAn array of weapon names attached to this template.