Re: CODE Question -> Race war, changes....

From: Tony Robbins (tonyr@pacific101.com)
Date: 07/26/99


----- Original Message -----
From: emil nilimaa <kyos_overlord@hotmail.com>
To: <CIRCLE@post.queensu.ca>
Sent: Monday, July 26, 1999 9:07 AM
Subject:  CODE Question -> Race war, changes....


> Hi coders and stuff....
>
> myself is new to all what it means...
> but still trying.

New to Circle, or new to coding?  I won't start that discussion again.

> ok Im planning on having racewar fashion on the mud..
>
> where all good races see the evil  as  "An Ogre is standing here..." bla
> bla.. etc.
> and also target by "Ogre" instead of the character name...

Gary McNickle wrote nice introduction code for ROM MUDs, which can be
[easily] converted to CircleMUD if you're using ASCII Pfiles.  It's not so
easy for binary pfiles, because it involves a dynamically expanding array
which doesn't work too well with fixed binary (and wouldn't work quite as
well with a strictly limited number).

Anyway, part of the introduction system code sets it up so characters who
the player doesn't know are identified as:
"A human cleric is standing here." -or, in your case-
"An Ogre is standing here."

Anyway, it adds functionality to various functions in handler.c (I think)
that check against the players race, too.

> what i did was adding a "racename" in the pfile,

That's not really necessary, if you think about it.  It's not like the
string's ever going to change, unless their race is somehow changed, so you
can just rely on the race bit.

*snip*

> it worked fine for the player to log in but when loggin off.. the game
> crashed. however.. if he logged on again.. and logged off.. it didnt
crash.
>    only the first time. heh

Probably left out something in char_to_store(), store_to_char(), or
something else in there.  Or in your initializations in nanny().  Notice how
it CREATE()'s space for the character's name?  Are you doing that for
"racename" ?

> i tried to define a race name length for it... made it 80 chars...
> but still game crashed as they logged off for the first time.

See above.

> shorter name like   Human worked fine.

Odd, not really consistent with what I was saying, but odd nonetheless.

> ohh well. if someone have some ideas about coding this stuff...
> maybe you could give some hints..
> eventually i will get it to work...
> but maybe there is a better way.

Ok, say you have these definitions:

#define RACE_UNDEFINED    -1
#define RACE_HUMAN         0
#define RACE_OGRE          1

#define NUM_RACES          2

We'll say that's what you have in structs.h.

Now, in constants.c, you probably have an array like:

const char *pc_race_types[] = {
  "Human",
  "Ogre"
};  (or possibly with a third entry, "\n").

That means that if you put the characters race in there:
pc_race_types[(int) GET_RACE(ch)]
it spits out:
"Human"

So in handler.c, you can go through the get_char_xxx() and is_name()
functions and have it check the argument against their race.

-k.

Yes, that was awfully distorted as I said it, but maybe reading over it a
couple times is good anyway.  :P


     +------------------------------------------------------------+
     | 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