Skip to content

UnitsTargetObject

UnitsTargetObject(units, target, append?) · UnitsTargetObjectTracked(units, target, append?)

Inputs: units is one object or a dense array; target is the object to act on. Optional append is a boolean, defaulting to false.

Description: Requests the game's default contextual action, such as attack or gather. true appends to the actors' native orders. The target is re-resolved before submission; the tracked form can also observe the actors' current target. See Append an object-target order.

Output: UnitsTargetObject returns true for queue admission, otherwise false. UnitsTargetObjectTracked returns accepted, receipt.

Errors: Wrong Lua argument types raise an argument error. Invalid actors or a lost target reject; invalid-target identifies a target lost before dispatch. A non-boolean append raises a Lua argument error. A tracked receipt gives the rejection reason when available.