Re: Adding Character Attributes

From: Java Hunter (java_hunter@hotmail.com)
Date: 08/19/99


Wow... thats the type of help I like to read (you can tell I'm "catching"
up)

That helps out soo much... I'm betting I can use this "walkthrough" to add
"lives" to characters...

>
>Changing someone elses existing code, which is the case with CircleMud, is
>all about
>using the 'grep' command and studying the code. Over time as you work with
>the files you'll
>know where everything is.
>
>You know you want to do something to thaco, so first off you want to locate
>all references to thaco
>   grep -in thaco *.[ch]
>Will search for the word thaco in all .c and .h files in the current
>directory. Case doesn't matter and the line number of matches will be
>displayed.
>
>class.c and fight.c are the only .c files that use it. Obviously you plan
>to
>remove the calc_thaco calls and replace it with something like
>   calc_thaco = GET_THACO(ch);
>
>Thaco is something you plan to store on the character. So you think, what
>else is stored on the character and how is it accessed. GET_EXP(ch) is one
>you see everywhere and common Circle practice.
>   grep GET_EXP *.h
>Just look for its actual definition on .h files, not everywhere its
>actually
>used.
>   utils.h:322:#define GET_EXP(ch)   ((ch)->points.exp)
>So we want to add something in utils.h like
>   #define GET_THACO(ch)  ((ch)->points.thaco)
>
>After some digging with grep for points, youll find it in structs.h
>   /* Char's points.  Used in char_file_u *DO*NOT*CHANGE* */
>struct char_point_data {
>So you add your thaco variable to the points structure, noting the warning
>that
>it will change the player file and you'll either have to start a new player
>file, or re-write the player file loading/saving to account for the new
>variable and convert your present player file to the new format.
>
>Coding circle is all about searching for things. Just about anything you
>can
>imagine is already in there, or at least the building blocks are. New
>spell,
>look at everything related to an existing spell. New variable, look at
>everything about some variable just like the one you want to add. etc.
>
>Dont forget to locate wherever things like exp get initilized for new
>players and add a bit to initialize your thaco.
>
>--------------------------------------------------------------------------
>Ron Hensley  (ronh@intercom.net)
>Network Administrator - ICNet Internet Services
>--------------------------------------------------------------------------
>

  "I can see through time!" - Lisa Simpson

   http://www.animeart.com/moltres

Java_Hunter


_______________________________________________________________
Get Free Email and Do More On The Web. Visit http://www.msn.com


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html  |
     +------------------------------------------------------------+



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