Re: Ideas for Autotrack

From: ShadowLord (dkoepke@california.com)
Date: 02/16/96


On Sat, 17 Feb 1996, Matthew W. Dinger wrote:

> 	I have a quick question fo you guys.  I am an implementor on a 
> Gothic adventure type mud and I need some ideas for "track".  I'd like to 
> be able to set it up so that if I wanted to track a mob, it would keep 
> reporting where the mob is until I come across it.  Any ideas as to where 
> I should start or where the functions for "track" are?  Thanks  in advance!

   There's several ways I can think of off the top of my head to do this.
Which one you use is up to you and your preferences, though.

   Probably the easiest (and most common) way of implementing automatic
TRACK updates is to add a new variable near the "fighting" and "hunting"
ones in <char_special_data>...

struct char_special_data {
   struct char_data *fighting;
   struct char_data *hunting;
   struct char_data *tracking; /* add this */

   .
   .
   .
};

Then, when the person uses TRACK, set <tracking> (you'll probably want
to create a macro in <utils.h> like the HUNTING(ch) and FIGHTING(ch)
ones) and upon movement of the character, check if they're tracking a
person and if so, just call <do_track>.

   This method certainly isn't fool-proof, since if the tracked character
leaves then you'll get a crash unless you set <tracking> to NULL, this
is simple to fix by having <do_track> set it to NULL when it cannot find
the (same) person in the world.

   Another way to do it is to have it to occassionally print updates using
the pulsing, the basic setup is the same, except you need to do most of
the changes in <comm.c> instead of <do_track>, and it's probably highly
annoying to get the messages every so often.

   Anyway, the basic underlying code for having TRACK do automatic updates
is the same no matter how you have it report it, so I think this should be
of some help...

--
Daniel Koepke <dkoepke@california.com>
Implementor of LEGENDS AND LORE 2



This archive was generated by hypermail 2b30 : 12/07/00 PST