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

label()

Retrieve the object associated with a label...

 

Syntax

var returnValue = label(labelName);

Parameters

ParameterTypeMandatoryDescriptionGame version
labelNameString(tick)

The label whose associated object you want to retrieve.

3.1 Beta 2

Return value

ValueTypeDescriptionGame version
<object>

Game object

Location object

The object associated with the label.

3.1 Beta 2
{}Empty Object

If the label does not exist, an empty object is returned.

(warning) Note that this object does not have a .type property.

3.1 Beta 2

Example

Processing a label object
// grab the object:
var someObj = label("something");
 
if (!someObj.hasOwnProperty("type")) {
	// no .type property = no object found
} else switch (someObj.type) {
	case DROID: {
		/* do stuff */
		break;
	}
	case STRUCTURE: {
		/* do stuff */
		break;
	}
	case FEATURE: {
		/* do stuff */
		break;
	}
	case AREA: {
		/* do stuff */
		break;
	}
	case POSITION: {
		/* do stuff */
		break;
	}
	default: {
		// the type of object returned is something unexpected!
	}
}
Availability 3.1 B2→3.2.0

Requires:

  • Warzone 3.1 Beta 2 and above.
  • Deprecated in Warzone 3.2

Replaced by:

Contents

Jump to:

Scripting: Labels

Related Objects:

 Create them:

List them:

Retrieve their objects:

Monitor them:

Remove them: