cost ( Version 1.13.10 and later only): integer (read).
In general, note that moving a unit by changing the proxy unit's coordinates does not work if the goal hex is occupied (it is not executed), so it is necessary to check if the hex is available first. Setting x and y individually would result in two moves, and there's the possibility that the intermediate move fails if the hex is occupied by another unit.
loc: ( Version 1.13.11 and later only) shortcut to get/set both x and y at once (read/write).
( Version 1.13.11 and later only) These are now read/write under all circumstances, including for on-map units)
x, y: integers (read only, read/write if the unit is not on the map.
This page describes the LuaWML functions for handling units.Ī unit is a proxy table with the following fields: