Appearance
sdk.movement
Thin wrappers around native game.walk / game.move_to. Directional steps are official one-shot TGameActionPlayerMovementIntent actions; bounded town recovery segments use MoveTo so the client keeps normal pre-walk cadence. Rotate / turn is the facing packet fallback when game.rotate is missing.
lua
local M = require("sdk.movement")walk
function · walk(dir)
Walk one tile (or stop) through the native client action queue.
Parameters
| Name | Type | Summary |
|---|---|---|
dir | string|integer | Compass name/abbreviation, or an sdk.math.dir value. |
Returns
| Type | Summary |
|---|---|
boolean|nil | ok |
string|nil | err walk missing, unknown direction, or the native send error. |
moveTo
function · moveTo(x, y, z)
Ask the official client to walk toward a world-map coordinate.
Parameters
| Name | Type | Summary |
|---|---|---|
x | number | — |
y | number | — |
z | number | Floor in the inclusive range 0..15. |
Returns
| Type | Summary |
|---|---|
boolean|nil | ok |
string|nil | err invalid position, move_to missing, or the native send error. |
stop
function · stop()
Cancel an in-flight walk / MoveTo. Publishes official TMovementIntentStop and enqueues GameclientMessageStop. Stop alone only ends the current step; the stored click-to-walk waypoint keeps republishing Go* until the handler sees Stop.
Returns
| Type | Summary |
|---|---|
boolean|nil | ok |
string|nil | err |
rotate
function · rotate(dir)
Face a cardinal. Diagonals collapse to the nearest east/west so the four Rotate* packets stay valid. Prefers game.rotate; falls back to Packet.empty. Common: call after a path step when the next action needs a facing (use, talk).