Re: prompts.

From: Christopher J. Dickey (
Date: 05/26/95

On Fri, 26 May 1995, Ricky David Gibson wrote:

> i've been working on trying to make a more comfigureable prompt
> for my mud...and i've got it to show exp, and exp to level and that
> stuff...(tis was easy) i want it to be able to show the "tank's"
> condition (who ever is taking damage in a fight).. how do i go about this?
> rick

The problem I see off the bat with this is what if more than one person 
in a group is taking damage.  You can determine who is tanking in a group 
as pretty easily as long as no one else is taking damage, but walk into a 
group of hostiles, and the process becomes more difficult.  That is 
unless you just want to specify the hps of any other player in the group, 
and in that case, you'd need to perhaps set one of those extra longs in 
the player struct to the id number of the player they chose.  Then you 
could use the id numb to determine who's hps you were trying to find.  
The other way off the top of my head would be to use a pointer, but you'd 
need to make sure the pointer gets set to null after the person logs off 
or whatever or you'll get some nasty results.  The problems I see with 
both ways are this:  the id num method will take a search through the 
player list, just a bit consuming (hey bout making this list a binary 
tree or a dynamic array reallocted if needed);  the pointer method while 
possibly quicker is a little more risky if you don't know what 
precautions you need to take.  Of course, I may be completely over 
looking a much easier way, but I'm sure someone on the list will flame me 
if so ;)  Good luck.


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