Project Sylvanas docs axiombot.net Discord

Events

For things you want to hear about while a walk is under way. The walk's own done function is still the way to know how it ended; events are for what happens on the way.

Listen and stop listening

-- fn(data, event_name). owner: your plugin's table
client:on("stuck_detected", function(data) core.log("stuck, getting free") end, self)
client:on("arrived", function(data) core.log("there") end, self)

client:off(self)   -- when your plugin stops: drops all of its listeners at once
CallWhat it does
client:on(name, fn, owner?)Listen. Returns an id
client:off(owner)Drop all of owner's listeners
client:off(id)Drop one listener
client:off(name, fn)Drop one listener

Each event's full name is axiom_nav.<name> (axiom_nav.arrived). client:on takes either.

The events

EventWhenData
state_changedAny change of state or sub-state{ from, to, substate_from, substate_to }
arrivedThe walk ended at its place
failedThe walk ended without getting there
stuck_detectedStuck; it is getting free
stuck_recoveredFree again
deviation_detectedPushed off the route
repath_started, repath_completedA new route asked on the way, and its answer
obstacle_detectedSomething on the route ahead
path_requested, path_received, path_failedRoute requests (retarget = true when a new move_to re-aimed the walk)
waypoint_reachedA point of the route passed{ index, total }
dismount_neededMounted at the route's get-off point{ at, why, first_misfit, get_off, destination }
ride_fromOn foot with mount = true: where the route can be ridden from{ ride_from, index, why_not_before, ride, fits_from_here, rides, destination }
mount_hereOn foot at the get-on point, waiting for the mount{ at, index, why_not_before, ride, destination }
server_connected, server_retry, server_disconnected, server_errorThe route server

No path_requested or path_received comes for a walk done by close-range direct steering: no route is asked.

The mount events

AXIOM NAV never mounts or dismounts. These two are your cue:

client:on("dismount_needed", function(d)
    -- d.why: "indoors", "low", "narrow" or "no_mounts_area"
    core.input.dismount()     -- the walk goes on by itself once on foot
end, self)

client:on("mount_here", function(d)
    -- after move_to(..., { mount = true }) on foot
    cast_my_mount()           -- your own mount cast; the walk rides on once mounted
end, self)

States

client:get_state() answers the first word, client:get_state_detail() all of it.

Top levelSub-states
idle
navigatingawaiting_path, following_path, repathing, deferred (waiting for a cast), recovering (jumping, probing, strafing, backtracking)
arrived
failed

Example: "navigating.recovering.strafing".