Appearance
game.map
Native map reads return nil plus an error while loading/off-thread. A false walkability value is authoritative only after ready() succeeds.
Native global — no require.
ready
function · ready(): boolean|nil, ErrorMessage?
Native map reads return nil plus an error while loading/off-thread. A false walkability value is authoritative only after ready() succeeds.
Returns
| Type | Summary |
|---|---|
boolean|nil, ErrorMessage? | — |
walkable
function · walkable(x: integer, y: integer, z: integer): boolean|nil, ErrorMessage?
Native map reads return nil plus an error while loading/off-thread. A false walkability value is authoritative only after ready() succeeds.
Parameters
| Name | Type | Summary |
|---|---|---|
x | integer | — |
y | integer | — |
z | integer | — |
Returns
| Type | Summary |
|---|---|
boolean|nil, ErrorMessage? | — |
state
function · state(x: integer, y: integer, z: integer): 'walkable'|'blocked'|'unknown'|nil, ErrorMessage?
Native map reads return nil plus an error while loading/off-thread. A false walkability value is authoritative only after ready() succeeds.
Parameters
| Name | Type | Summary |
|---|---|---|
x | integer | — |
y | integer | — |
z | integer | — |
Returns
| Type | Summary |
|---|---|
'walkable'|'blocked'|'unknown'|nil, ErrorMessage? | — |
flags
function · flags(x: integer, y: integer, z: integer): MapFlags?, ErrorMessage?
Native map reads return nil plus an error while loading/off-thread. A false walkability value is authoritative only after ready() succeeds.
Parameters
| Name | Type | Summary |
|---|---|---|
x | integer | — |
y | integer | — |
z | integer | — |
Returns
| Type | Summary |
|---|---|
MapFlags?, ErrorMessage? | — |
cost
function · cost(x: integer, y: integer, z: integer): number?, ErrorMessage?
Native map reads return nil plus an error while loading/off-thread. A false walkability value is authoritative only after ready() succeeds.
Parameters
| Name | Type | Summary |
|---|---|---|
x | integer | — |
y | integer | — |
z | integer | — |
Returns
| Type | Summary |
|---|---|
number?, ErrorMessage? | — |
snap
function · snap(x: integer, y: integer, z: integer, radius?: integer): Position?, ErrorMessage?
Radius must be 0..64.
Parameters
| Name | Type | Summary |
|---|---|---|
x | integer | — |
y | integer | — |
z | integer | — |
radius | integer | — |
Returns
| Type | Summary |
|---|---|
Position?, ErrorMessage? | — |
find_path
function · find_path(from: Position, to: Position, options?: GameMapPathOptions): Position[]?, ErrorMessage?
Native map reads return nil plus an error while loading/off-thread. A false walkability value is authoritative only after ready() succeeds.
Parameters
| Name | Type | Summary |
|---|---|---|
from | Position | — |
to | Position | — |
options | GameMapPathOptions | — |
Returns
| Type | Summary |
|---|---|
Position[]?, ErrorMessage? | — |
solve_legs
function · solve_legs(waypoints: Position[], options?: GameMapPathOptions): table[]?, ErrorMessage?
Native map reads return nil plus an error while loading/off-thread. A false walkability value is authoritative only after ready() succeeds.
Parameters
| Name | Type | Summary |
|---|---|---|
waypoints | Position[] | — |
options | GameMapPathOptions | — |
Returns
| Type | Summary |
|---|---|
table[]?, ErrorMessage? | — |
spawns_in
function · spawns_in(x0: integer, y0: integer, x1: integer, y1: integer, z: integer): table[]?, ErrorMessage?
Native map reads return nil plus an error while loading/off-thread. A false walkability value is authoritative only after ready() succeeds.
Parameters
| Name | Type | Summary |
|---|---|---|
x0 | integer | — |
y0 | integer | — |
x1 | integer | — |
y1 | integer | — |
z | integer | — |
Returns
| Type | Summary |
|---|---|
table[]?, ErrorMessage? | — |
npcs
function · npcs(): table[]?, ErrorMessage?
Native map reads return nil plus an error while loading/off-thread. A false walkability value is authoritative only after ready() succeeds.
Returns
| Type | Summary |
|---|---|
table[]?, ErrorMessage? | — |
towns
function · towns(): table[]?, ErrorMessage?
Native map reads return nil plus an error while loading/off-thread. A false walkability value is authoritative only after ready() succeeds.
Returns
| Type | Summary |
|---|---|
table[]?, ErrorMessage? | — |
teleports
function · teleports(): table[]?, ErrorMessage?
Native map reads return nil plus an error while loading/off-thread. A false walkability value is authoritative only after ready() succeeds.
Returns
| Type | Summary |
|---|---|
table[]?, ErrorMessage? | — |
connectors
function · connectors(rect: GameMapRect): table[]?, ErrorMessage?
Native map reads return nil plus an error while loading/off-thread. A false walkability value is authoritative only after ready() succeeds.
Parameters
| Name | Type | Summary |
|---|---|---|
rect | GameMapRect | — |
Returns
| Type | Summary |
|---|---|
table[]?, ErrorMessage? | — |
waypoints
function · waypoints(): table[]?, ErrorMessage?
Native map reads return nil plus an error while loading/off-thread. A false walkability value is authoritative only after ready() succeeds.
Returns
| Type | Summary |
|---|---|
table[]?, ErrorMessage? | — |
houses
function · houses(): table[]?, ErrorMessage?
Native map reads return nil plus an error while loading/off-thread. A false walkability value is authoritative only after ready() succeeds.
Returns
| Type | Summary |
|---|---|
table[]?, ErrorMessage? | — |
occupancy
function · occupancy(rect: GameMapRect, max_cells?: integer): table?, ErrorMessage?
Rect spans are capped at 1024; max_cells is 1..256.
Parameters
| Name | Type | Summary |
|---|---|---|
rect | GameMapRect | — |
max_cells | integer | — |
Returns
| Type | Summary |
|---|---|
table?, ErrorMessage? | — |
stats
function · stats(): table?, ErrorMessage?
Native map reads return nil plus an error while loading/off-thread. A false walkability value is authoritative only after ready() succeeds.
Returns
| Type | Summary |
|---|---|
table?, ErrorMessage? | — |
solve_loop
function · solve_loop(options?: table): MapJobId?, ErrorMessage?
Native map reads return nil plus an error while loading/off-thread. A false walkability value is authoritative only after ready() succeeds.
Parameters
| Name | Type | Summary |
|---|---|---|
options | table | — |
Returns
| Type | Summary |
|---|---|
MapJobId?, ErrorMessage? | — |
densify
function · densify(waypoints: Position[], options?: GameMapPathOptions): MapJobId?, ErrorMessage?
Native map reads return nil plus an error while loading/off-thread. A false walkability value is authoritative only after ready() succeeds.
Parameters
| Name | Type | Summary |
|---|---|---|
waypoints | Position[] | — |
options | GameMapPathOptions | — |
Returns
| Type | Summary |
|---|---|
MapJobId?, ErrorMessage? | — |
plan_path
function · plan_path(from: Position, to: Position, options?: GameMapPathOptions): MapJobId?, ErrorMessage?
Native map reads return nil plus an error while loading/off-thread. A false walkability value is authoritative only after ready() succeeds.
Parameters
| Name | Type | Summary |
|---|---|---|
from | Position | — |
to | Position | — |
options | GameMapPathOptions | — |
Returns
| Type | Summary |
|---|---|
MapJobId?, ErrorMessage? | — |
job
function · job(id: MapJobId): GameMapJob?, ErrorMessage?
Native map reads return nil plus an error while loading/off-thread. A false walkability value is authoritative only after ready() succeeds.
Parameters
| Name | Type | Summary |
|---|---|---|
id | MapJobId | — |
Returns
| Type | Summary |
|---|---|
GameMapJob?, ErrorMessage? | — |
cancel
function · cancel(id: MapJobId): boolean
False for unknown or already-terminal jobs.
Parameters
| Name | Type | Summary |
|---|---|---|
id | MapJobId | — |
Returns
| Type | Summary |
|---|---|
boolean | — |