Difference between revisions of "Manual:DIL Manual/walkto()"

From DikuMUD Wiki
Jump to navigation Jump to search
(XML import)
(checked against the compiler and the interpreter; example compiles)
 
Line 1: Line 1:
−
<span id="bpwalkto"></span>
+
= walkto() =
−
walkto ( u : unitptr )
+
'''Obsolete.''' DIL has no procedure <code>walkto()</code>; vmc doesn't know the name.
−
    u : Room to walk to.
 
−
    result: Makes unit (self) walk to room, taking a 'step' at each 'tick'.
 
  
−
'''Example:'''
+
To find the way, [[Manual:DIL Manual/pathto()|pathto()]] gives the direction of the next step from where a unit is towards a room. To take the step, run the direction as a command, <code>exec("north", self)</code>, and check <code>self.outside</code> afterwards. The function <code>walk_room@function("inn@udgaard", speed)</code> in function.zon walks a monster all the way to the room with that symbolic name and returns TRUE when it got there. <code>pathto()</code> only finds routes that can be walked both ways, so it fails across one-way exits.
−
 
 
−
<nowiki>
 
−
  walkto(findroom("inn@udgaard"));</nowiki>
 
−
 
 
−
---~---~---~---~---~---~---~---~---
 
−
<span id="bpwalkto"></span>
 
−
walkto ( u : unitptr )
 
−
    u : Room to walk to.
 
−
    result: Makes unit (self) walk to room, taking a 'step' at each 'tick'.
 
−
 
 
−
'''Example:'''
 
−
 
 
−
<nowiki>
 
−
  walkto(findroom("inn@udgaard"));</nowiki>
 
−
 
 
−
---~---~---~---~---~---~---~---~---
 

Latest revision as of 23:25, 14 November 2026

walkto()

Obsolete. DIL has no procedure walkto(); vmc doesn't know the name.

To find the way, pathto() gives the direction of the next step from where a unit is towards a room. To take the step, run the direction as a command, exec("north", self), and check self.outside afterwards. The function walk_room@function("inn@udgaard", speed) in function.zon walks a monster all the way to the room with that symbolic name and returns TRUE when it got there. pathto() only finds routes that can be walked both ways, so it fails across one-way exits.