Re: Agility, Power, & if (!str_cmp("argument", buf))

From: Welcor (
Date: 11/23/01

----- Original Message -----
From: "David Cole" <tiznor@HOTMAIL.COM>
> I've added two new stats to the mud agility and power, power is for
> summoning, eg: conjurers, how well they can summon elementals and pets etc..
> and agility is a rogue, and handler related stat.
This part has been well covered by DAK in the previous response.

> Well, I've managed to make the stat roller roll the new stats with the old,
> and I have created the new ASCII pfile defines for the new stats as well as
> added GET_AGI and GET_POW in utils.h, also added sbyte agi; sbyte pow; to
> char_ability_data as well as adding the cases and defines in db.c. So what's
> my problem?
> Stats roll, they show the first time you log in, and they stick. But the
> minute you log off it does not write the new stats to the ASCII pfile and
> does not save them so power and agi are returned to 0 when you do a att in
> the game after relogin.
> I'm having lots of problems like this with ASCII pfiles, anything I try
> adding doesn't save in them, and I add them to all the proper places, I
> think?
The following places need to be updated for a change to be saved and read
in ASCII pfiles:
structs.h - the char_data structure (or one of the embedded structs, like
char_ability_data, as you did.)
pfdefaults.h - one line per change.
db.c - char_to_store and store_to_char
       My guess is that this is where you forget to add lines like:
       if (GET_POW(ch) != PFDEF_POW)
         fprintf(fl, "Powe: %d\n", GET_POW(ch));
         else if(!strcmp(tag, "Powe"))
           GET_POW(ch) = num;

utils.h - define the accessor macro GET_x, etc.
<snip of prompt & str_cmp issues>

I hope my guess is correct. Otherwise you'll have to give us some more


   | FAQ: |
   | Archives: |

This archive was generated by hypermail 2b30 : 12/06/01 PST