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

eventSelectionChange()

Triggered when the user selects or deselects objects...

 

Syntax

function eventSelectionChanged(selected) {
  // do stuff
}

Parameters

ParameterTypeMandatoryDescriptionGame version
selected

Array of
Game objects

(tick)

An array of selected game objects.

Array will be empty if no objects are selected.

3.2

Return value

Warzone does not process the event handler's return value.

Notes

The event is triggered after each selection change, but with a slight delay to avoid being triggered too many times.

Remember that a player might select objects one at a time, or in groups, or hold down shift to add or remove objects to or from the selection.

Example

Iterate through selected game objects...
function eventSelectionChanged(selectedObjects) {
	selectedObjects.forEach(function get(gameObject) {
		// do stuff with selected game object
	}
}
Availability 3.2+

Requires:

  • Warzone 3.2 and above
Contents

Jump to:

See also

Related articles: