Overview
Quickly determine if a structure of the specified type has been fully built.Availability
Warzone 3.1 Beta 1 and above.
Code
function iHave(structure) { var list = enumStruct(me,structure); return (list.length && list[0].status = BUILT); // true = structure is built, false = no structure or not ready }
Example
// You need a HQ before you can design units or build defence towers if (iHave(HQ)) { // build defence towers } else { // instruct a truck to build a HQ! }
See also
- enumStruct() – get a list of structures
- BUILT – indicates structure is fully built
- HQ – headquarters (Command Control) structure type
- me – my player ID
- .status – the construction status of a structure object
- .stattype – constants defining structure types
- Structure object – defines a structure object