(info) Other great resources: Official JS API docs, Scripting Forum

hackGetObj()

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

 

Syntax

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

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:

Earlier versions:

Contents

Jump to:

See also

Related articles: