Retrieve a game object based on it's ID... |
var gameObj = objFromId(idObj); // use with care!! |
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 wish to retrieve. For example, if you want to retrieve object #63, you'd pass in: You could also pass in a cached Game object to get a fresh copy of that game object (all game objects have an .id property). | 3.1 Beta 2 |
Value | Type | Description | Game version |
---|---|---|---|
<gameObj> | Game object | A Droid object, Structure object or Feature object that has the specified object id. | 3.1 Beta 2 |
null | Null | The object was not found. | 3.1 Beta 2 |
<error> | Error | Due to bugs, if object is not found an error is usually thrown. | 3.1 Beta 2 |
var lookingFor = {id:63}; var found; try { found = objFromId(lookingFor); } catch(e) { found = null; } if (found) { // do stuff with 'found' game object } |
This function is deprecated as of Warzone 3.2. |
AvailabilityRequires:
Replaced by:
Earlier versions:
|
ContentsJump to: |
See alsoRelated articles:
|