Paths

Unlike the other social types listed above, Paths use a nonstandard nomenclature and setup, so read this section carefully.

There are two ways to use Paths:
1) To create a patrol route for a particlar mob vnum, that automatically activates itself and continues until the mob dies.
2) As an action in response to a trigger or periodic action.

Paths - Format

MOB: [vnum] TIMED
ID: [Path ID for this MOB]
TYPE: [Path ID for this MOB]
ROOMS: [Path ID for this MOB]
DIRS: [Path ID for this MOB]
DONE

Path Initiator Command

The special command to activate a path from within a trigger or periodic action is #1004. Specify the ID# to be activated in the arguments field - only one please!

Examples - Paths

The following is an example of a standard round-trip patrol path. This mob will patrol the set of rooms listed within automatically when it is loaded.

MOB: 91104 PATH
ID: 0 ;; Auto Path
TYPE: 2 ;; Roundtrip Path
DELAY: 10 ;; Move every 10 seconds
ROOMS: 91100 91101 91102 91103 91104 91105
DIRS: 2 2 2 2 1
DONE<

Examples - Paths

The following is an example of a one-way path that is intended for use with a trigger or periodic. When activated, the mob will move from to the last room in the path (91105) and stop.

MOB: 91105 PATH
ID: 1 ;; ID #1
TYPE: 1 ;; One-way Path
DELAY: 5 ;; Move every 5 seconds
ROOMS: 91100 91101 91102 91103 91104 91105
DIRS: 2 2 2 2 1
DONE

Examples - Paths

Finally, here is an example of calling a path from a trigger. In this instance, we will call the defined PATH by triggering on the 'salute' command. After the path is complete, we will follow it up by having the mob take a bow. For more information on triggers, see the appropriate section of this documentation.

MOB: 91105 PATH
ID: 1 ;; ID #1
TYPE: 1 ;; One-way Path
DELAY: 5 ;; Move every 5 seconds
ROOMS: 91100 91101 91102 91103 91104 91105
DIRS: 2 2 2 2 1
DONE

MOB: 91105 TRIGGER
FLAG: 32 ;; DIRECTED
CHANCE: 0 ;; 100%
DELAY: 40 ;; 10 seconds
TRIGGER: 185 ;; salute
ACTION: 1004 ;; PATH
1
~
FLAG: 0 ;; None
CHANCE: 0 ;; 100%
DELAY: 60 ;; 10 seconds (after path)
ACTION: 389 ;; bow
~
DONE

In the above example, first we defined a path, with an ID of 1. Because the path has a non-zero ID, it will not activate until triggered. In the trigger command, we activate the path by using the special path initator command (#1004), and put the ID# we want to activate for that MOB in the arguments. After the path is complete, the final bow command will be processed. Note that it does not matter where you specify the PATH to be called - it does not have to be right above the trigger that uses it. Also, remember that the ID you call relates to the MOB with the trigger only - if the trigger mob does not have a path defined for it, nothing will happen.

Path Notes & Tips

  1. You can have as many paths per mob as you desire.
  2. The path definitions can go anywhere within the social file, the order is not important. I would suggest putting all of your paths in one place within the file, to make it easier to view.
  3. The mob must be loaded somewhere within the path for it to work. Also, it does NOT need to be loaded in the first room of the path - you can load mobs anywhere on the path and they will automatically move along it in the correct order. This is useful for staggering patrolling mobs in an area. This does not apply to SEEK paths however - those will activate regardless of location.
  4. You do not need to flag pathing mobs as SENTINEL, though it is reccommended, just to be safe.
  5. Path mobs are extremely resourceful. If they come into combat along their path, they will stop, and then resume the path where they left off when the combat is over. If the mob gets lost - from tracking a player, for instance - it will return to it's last place on the path and continue along it. If for some reason the mob can't get back, it will keep trying several times before eventually giving up. A path mob should only give up on it's path if it becomes isolated from it and cannot get back, or dies.
  6. Path mobs will open doors along their way, and close them behind them. They will also unlock and re-lock doors for which they have the proper key.
  7. Use the SEEK paths wisely - they are very efficient, but difficult to control. These should be used only when you quickly need to move a mob from one room to the other (to call for help, flee to safety, etc).