[NEWBIEish][CODE][LONG] defining racial size

From: Owen Brodal-Robertson (obr@hisplace.net)
Date: 03/21/02

Hello all,

After a few years of recovery I've started playing with
Circle again... after a few days of sucessfully implementing
features without bugs, I've found something that's stumped me.

I've implemented races in my code (working fine), but wanted
to implement racial sizes i.e. Gnomes are small, elves are
medium, etc etc.

My problem is after mirroring code from class.c and races.c
sizes assigned to mobs seem to be totally random, when I do a
stat on a player the Size value never matches what should be
the assigned size based on the player's race.

Anyway, My code changes were as follows (these are from
memory as I'm posting this from work):


Added SIZE_ defines, from -1 which is SIZE_UNDEFINED, to 7
which is SIZE_GARGANTUAN (using ints, not bitvectors).

Also added "byte size" to the player structures
(char_player_data and char_player_u).

#define GET_SIZE(ch)   ((ch)->player.size)

In roll_real_abils function (under racial attribute modifiers)
I added GET_RACE(ch) = SIZE_whatever;


Added pc_size_types array (same as pc_race and pc_class

added 3 lines to do_stat_character (under the Class and Race

strcpy(buf, "Race: ");
sprinttype(k->player.size, pc_size_types, buf2);
strcat(buf, buf2);

I think that's about it, rather simple really... eventually
skills will do checks based on size of ch & vict to determine
whether they will succeed or fail (i.e. a Giant Treant can't
bash a small gnome etc).

Whenever I roll a character and stat them, I get a random
result from Size: <whatever>

For instance, I rolled a gnome, who when applying real_abils
has "GET_SIZE(ch) = SIZE_SMALL " in the code, I get
"Size: [Microscopic]" which is 2 below SIZE_SMALL.

Codebase is circle30bpl19 with dg_scripts, Oasis & races
patched in (with other minor changes that shouldn't affect
any of the size_code... i.e. extra levels, whatever).

Anyone have any hints?



   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   | Newbie List:  http://groups.yahoo.com/group/circle-newbies/   |

This archive was generated by hypermail 2b30 : 06/25/03 PDT