Re: Help on ways to implement idea

From: Neal Lahndorff (stulahnd@ACS.EKU.EDU)
Date: 09/28/98


On Mon, 28 Sep 1998, The Gortemakers wrote:

> catapult the pfile size to some unimaginable size.  I was thinking that
> there might be a way to do this using bitvectors such as:
>
> #define HAS_SPELL_SANCTUARY    (1 << 0)
> #define HAS_SPELL_ARMOR             (1 << 1)
> #define YADA_YADA_YADA              (1 << n)
>
> and then just storing the bit in the playerfile.  One thing I'm not sure
> about is how high bitvectors can be shifted till they reach a maximal
> limit.  But perhaps you have better ways of coding this.  Your input
> would be greatly appreciated.
>
I didn't get rid of practices or anything like that, however, i didnt like
the way that either your class gets it or it doesn't that is built into
circle.  So what i did, is change the initial % a character gets in a
skill to -1, and then when they get the spell, set it to 0, and then it
shows up on their practice list, since a characters skill % are already
stored in the pfile, there is no size increase at all, more or less what
you have to do to implement something like this is to initialize all the
skill %'s to -1 and alter list_skills and the guild code to check for a
value > 0 if you still want to keep the gms around, which btw can make for
interesting quests just finding a certian mob that CAN teach you a certian
skill or spell.  One thing to watch out for, on some compilers (cc on IRIX
i know for fact) default characters to unsigned, in which case setting
their % to -1 really sets it to 255, but thats the general idea, and a
fairly simple solution.

Neal


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



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