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.

When retrieving feature objects, specify player as -1.

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
colour
Red
Yellow
title
Dev
3.2+

Requires:

  • Warzone 3.2 and above

Earlier versions:

Div
classbox
Contents

Jump to:

Table of Contents
maxLevel5

Div
classbox

See also

Related articles: