The unit object
From Scenario League Wiki
Back To TOTPP Functions
unit.id -> integer
Returns the unit's id.
unit.type -> unittype
Returns the unit's type.
unit.location -> tile
Returns the unit's location.
unit.homeCity -> city
Returns the unit's home city, or `nil` if it doesn't have one.
unit.damage -> integer
Returns the damage taken by the unit in hitpoints.
unit.hitpoints -> integer
Returns the number of hitpoints left. It is defined as unit.type.hitpoints - unit.damage.
unit.moveSpent -> integer
Returns the number of moves spent by the unit.
unit.order -> integer
Returns the current order of the unit.
unit.owner -> tribe
Returns the unit's owner.
unit.carriedBy -> unit
Returns the carrying unit if this unit is currently on board, `nil` otherwise.
unit.attributes -> integer
Returns the attributes of the unit (bitmask).
unit.veteran -> boolean
Returns the veteran status of the unit.
unit.gotoTile -> tile
Returns the tile the unit is moving to under the goto order, or `nil` if it doesn't have the goto order.
Activates a unit, clearing its orders, and, if it has a human owner and movement points left, selects it on the map.
Alias for `civ.teleportUnit(unit, tile)`.