walkto
walkto <vnum> [pause]
Walk the owner mobile to a room, one step at a time.
walkto is a convenience form of stepto: the compiler
expands it into a stepping loop that moves the owner one room closer to the
destination, pauses, and repeats until the mob arrives or
can no longer make progress. The mob travels under its own power along the
shortest path it can find.
Arguments
<vnum>— the destination room's vnum, an int.[pause]— an int number of ticks to wait between steps. Defaults to1when omitted. A larger pause makes the mob walk more slowly.
Returns
null. Like the other action commands, a
successful walkto in the handle phase suppresses the event's default
action.
Owner
The owner must be a mobile, standing or better. For any other owner the expanded loop takes no steps.
Examples
after command (say) {
walkto 3001 2
}
The mob walks toward room 3001, pausing two ticks between each step, until it arrives or gets stuck.
Omit the pause to step every tick:
after command (tick) {
walkto 3001
}
See also
stepto— take a single step toward a room.driveto— drive a vehicle to a room instead of walking.pause— the suspensionwalktouses between steps.- Handlers, events, and phases