Other great resources: Official JS API docs, Scripting Forum
hackGetObj()
- Aubergine
Owned by Aubergine
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:
| 3.2 | |
player | Number | The player to which the object belongs. When retrieving feature objects, specify player as | 3.2 | |
id | Number | The object ID. | 3.2 |
Return value
Value | Type | Description | Game version |
---|---|---|---|
<gameObj> | Game object | The Droid object, Structure object or Feature object that was found. | 3.2 |
null | Null | The object was not found. | 3.2 |
<error> | Error | Invalid parameters specified. | 3.2 |
Example
Always wrap calls to objFromId() in try...catch blocks...
var obj = hackGetObj(DROID, me, 63); // retrieve my droid #63 Â if (obj) { // do stuff with the obj }
This function was only available in some early development releases of Warzone 3.2 and has since been replaced by getObject().
Availability 3.2 EARLY DEV
Requires:
- Warzone 3.2 early development releases only
Replaced by:
- getObject() – Warzone 3.2 and above
Earlier versions:
- On Warzone 3.1 Beta 2 → 3.1.0 use objFromId()
- On Warzone 3.1 Beta 1, use droidFromId()
Contents
Jump to:
See also
Related articles:
- enumFeature() – get a list of feature objects
- enumDroid() – get a list of droid objects
- enumStruct() – get a list of structure objects
Â