Navigation and cameraLua table
Cross-map requests, running, destination records, and camera commands.
The advanced calls on this page are experimental. Check the installed function with type, handle unavailable results, and confirm changes from a later snapshot. A successful request does not mean arrival. For ordinary point-to-point movement, prefer request_path; configurable travel combines it with module settings.
Travel requests
game._map_info_candidate()
No arguments. Returns {map_id, area_id, dungeon_quest_id, is_dungeon, gold_state} with integer fields, or nil, error. is_dungeon is 0 or 1, not a Lua boolean. The quest ID can be zero when none is associated. No complete public mapping is supplied for gold_state. This is a current-area snapshot, not a map catalog or proof of travel eligibility.
game._map_session_state()
No arguments. Returns {map_id, area_id, dungeon_node_present, dungeon_node_key, gold_state}, or nil, error. dungeon_node_present is a boolean; the other fields are integers. The node key is a game association value, not a dungeon destination ID. Prefer the map-info reader above when its dungeon quest ID and integer dungeon flag fit the task.
game.request_cross_map(x, y, z, mode)
Requires exactly four integers. Coordinates are world units, not a map ID. Returns true when the client accepts the request, false when it rejects it, or nil, error when the call is unavailable or invalid.
The mode is reduced to its low eight bits. The gameplay convention uses 1 or 2; other values have no documented travel semantics and should not be invented. This function does not select a destination map by numeric ID and is not an unconditional teleport. Check position, current map, and destination on subsequent ticks. Never retry an uncertain action merely because its later result has not appeared yet.
game.start_running()
No arguments. Returns true when the running request is dispatched, or nil, error if the character is unavailable or the client rejects the request. It does not guarantee sustained movement or change a movement-speed setting. The existing facade also provides sdk.start_running().
game.set_infinite_fly(enabled)
Requires exactly one boolean. true enables Gameplay Infinite Fly controls for the local character; false disables it. It activates only after a normal takeoff, leaves walking unchanged, and releases control on landing. It never starts flight. No movement-component pointer is needed. Returns true when queued for the feature tick, or nil, error for invalid arguments or unavailable movement on enable. Disable works without a character, so call it from on_stop.
This uses the same simple flight controls as the menu. Gathering, casting, and pending actions pause added movement input. Flight state and stamina remain under game control: this version installs no native flight hooks, reports no artificial full flight power, and does not restart flight after exhaustion.
game.infinite_fly_enabled()
No arguments. Returns the current Gameplay toggle as a boolean. Read it on a later tick after a setter; it reports requested intent and can remain true on the ground or while gathering or panic pauses control. It does not prove the character is flying. Both functions also have sdk aliases.
function on_start()
local ok, err = game.set_infinite_fly(true)
if not ok then log.warn(err) end
end
function on_stop()
game.set_infinite_fly(false)
endgame._destination_record()
No arguments. Returns {obj, id, x, y, z} with integer fields, or nil, error. obj is an opaque short-lived record token, not a persisted destination handle. The coordinates are integer values; the simpler destination marker preserves fractional values when available. A record does not prove that a quest or path is currently reachable.
Camera commands
game._set_character_view_angle_candidate(yaw, pitch, mode)
Requires numeric yaw and pitch plus integer mode from 1 through 3. 1 changes yaw, 2 changes pitch, and 3 changes both. Each angle that is changed must be finite. Angles are in degrees; no additional public angle range is imposed.
Returns true when the requested values are applied and checked, or nil, error when the target changes or the command is unavailable. The result does not guarantee the final view after subsequent game camera updates.
game._set_camera_distance_candidate()
No arguments. Applies the fixed distance of 1800 world units to the current eligible camera arm. Returns true after the value is applied and checked, or nil, error. It takes no distance argument, does not save a camera preference, and does not supply a restore command. Subsequent camera changes may overwrite it.
function on_start()
local destination, err
if type(game._destination_record) == "function" then
destination, err = game._destination_record()
end
if destination then
log.info(string.format("Destination %d: %d, %d, %d",
destination.id, destination.x, destination.y, destination.z))
elseif err then
log.warn(err)
end
endMap and dungeon records are in progression; combat covers targeting and action cancellation.