[CODE] Stat Editor Errors

From: Matthew Kuebbeler (flawed@southwind.net)
Date: 11/16/00

Hello, Im currently attempting to add in a stat editor I found on
the ceramic mouse site. I've included the code where the error takes
place. If additional information is needed, you find this on the ceramic

This requires that you have OasisOLC (which I do have)
Im also using bpl17
First my errors

interpreter.c 1625 sizeof applied to an incomplete type
interpreter.c 1625 sizeof applied to an incomplete type
interpreter.c 1628 warning implicit declaration of function 'init_stats'
interpreter.c 1632 warning implicit declaration of function 'parse_stats

Now you need to edit the nanny function in interpreter.c so that this code
will get called when a new player logs in.  I have installed Race support on
Urath, so this code may be a little different from stock Circle, but the end
of the code here is really what's important.  You should modify the code under
CON_QCLASS to look something like this:

    load_result = parse_class(*arg);
    if (load_result == CLASS_UNDEFINED) {
      SEND_TO_Q("\r\nThat's not a class.\r\nClass: ", d);
    } else
      GET_CLASS(d->character) = load_result;

    if (GET_PFILEPOS(d->character) < 0)
      GET_PFILEPOS(d->character) = create_entry(GET_NAME(d->character));


    /* --relistan for statedit -- Some code moved into CON_QSTATS
         See below for details */
    if (!d->olc)
      CREATE(d->olc, struct olc_data, 1);


Now, right after that code, you should add the new connectedness entry for the
stats editor.  It should look like this:

  /* --relistan 2/22/99 for configurable stats */
  case CON_QSTATS:
    if (parse_stats(d, arg)) {

      if(d->olc) free(d->olc);
      save_char(d->character, NOWHERE);

      SEND_TO_Q(motd, d);
      SEND_TO_Q("\r\n\n*** PRESS RETURN: ", d);

      STATE(d) = CON_RMOTD;

      sprintf(buf, "%s [%s] new player.", GET_NAME(d->character), d->host);
      mudlog(buf, NRM, LVL_IMMORT, TRUE);

Notice that I've moved some of the code from CON_QCLASS down into CON_QSTATS.
That's so that you enter your stats before getting the motd/imotd.  You can
change this if you want, but then you need to modify CON_RMOTD.

One last file needs to be modified.  You need to keep it from re-rolling your
stats when you log in.  Edit class.c and goto the roll_real_abils() function.
It looks something like this:

void roll_real_abils(struct char_data * ch)

It begins with a switch() statement.  What you need to do is comment out or
delete this entire switch statement.  On Urath I didn't get rid of the entire
function because Race support uses it to assign special stats to races.  If you
aren't using race support and you want to stop this from being called at all,
you can remove it from do_start() in class.c.  It follows the set_title() call.

     | 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 : 04/11/01 PDT