Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Excerpt

Retrieve a game object based on it's type, player and ID...

 

Syntax

Code Block
themeRDark
languagejavascript
linenumberstrue
var gameObj = hackGetObj(type, player, id);

Parameters

ParameterTypeMandatoryDescriptionGame version
typeConstant(tick)

The type of object to retrieve:

3.2
playerNumber(tick)The player to which the object belongs.3.2
idNumber(tick)

The object ID.

3.2

Return value

ValueTypeDescriptionGame version
<gameObj>Game objectThe Droid object, Structure object or Feature object that was found.3.2
nullNullThe object was not found.3.2
<error>ErrorInvalid parameters specified.3.2

Example

Code Block
themeRDark
languagejavascript
titleAlways wrap calls to objFromId() in try...catch blocks...
linenumberstrue
var obj = hackGetObj(DROID, me, 63); // retrieve my droid #63
 
if (obj) {
	// do stuff with the obj
}
Div
classnotice box ping

This function has an uncertain future so use with caution!

Div
classbox
Availability
Status
colourRed
titleDev

Requires:

  • Warzone 3.2 and above

Earlier versions:

  • On Warzone 3.1 Beta 1, use droidFromId2 → 3.1.0 use objFromId()
  • On Warzone 3.1 Beta 2 → 3.1.0 use objFromId1, use droidFromId()
Div
classbox
Contents

Jump to:

Table of Contents
maxLevel5

Div
classbox

See also

Related articles: