Top Mud Sites Forum Return to TopMudSites.com
Go Back   Top Mud Sites Forum > Mud Development and Administration > MUD Coding
Click here to Register

Reply
 
Thread Tools
Old 03-02-2008, 01:02 AM   #1
Shoie13
Member
 
Join Date: Feb 2008
Location: The Shell
Home MUD: Star Wars: Galactic Insights
Posts: 46
Shoie13 is an unknown quantity at this point
Send a message via AIM to Shoie13 Send a message via MSN to Shoie13 Send a message via Yahoo to Shoie13
Languages and Races and Extending Bitvectors

This topic involves races and languages and bitvectors, and how to extend them. I'm using a modified version of SWRFUSS.

Anyway, I wanted to extend races and languages so I could have more than 32, since bitvectors stop at 32. I tried putting them in a typedef enum table, and while it seemed to work for races, languages had several problems, such as not showing up on the LANGUAGES command, and mobs reporting that they were trying to speak a null language.

I think the problem originated somewhere around LANG_UNKNOWN.


Here's how it originally looks:
Code:
#define LANG_COMMON      BV00                          
#define LANG_SHYRIIWOOK  BV01
#define LANG_TWI_LEK     BV02
#define LANG_RODIAN      BV03
#define LANG_HUTT        BV04
#define LANG_MON_CALAMARI   BV05      
#define LANG_NOGHRI      BV06
#define LANG_EWOK        BV07
#define LANG_ITHORIAN    BV08
#define LANG_GOTAL       BV09              
#define LANG_DEVARONIAN  BV10
#define LANG_BINARY      BV11
#define LANG_SPIRITUAL   BV12
#define LANG_MAGICAL     BV13
#define LANG_GAMORREAN   BV14               
#define LANG_GOD         BV15
#define LANG_ANCIENT     BV16
#define LANG_JAWA        BV17
#define LANG_CLAN        BV18
#define LANG_ADARIAN     BV19
#define LANG_VERPINE     BV20
#define LANG_DEFEL       BV21
#define LANG_TRANDOSHAN  BV22
#define LANG_CHADRA_FAN  BV23
#define LANG_QUARREN     BV24
#define LANG_BOTHESE     BV25
#define LANG_UNKNOWN        0 /* Anything that doesnt fit a category */
#define VALID_LANGS    ( LANG_COMMON | LANG_SHYRIIWOOK  | LANG_TWI_LEK | LANG_RODIAN  \
                       | LANG_HUTT | LANG_MON_CALAMARI | LANG_NOGHRI | LANG_GAMORREAN \
                       | LANG_JAWA | LANG_ADARIAN | LANG_EWOK | LANG_BINARY | LANG_VERPINE | LANG_DEFEL \
                       | LANG_TRANDOSHAN | LANG_CHADRA_FAN | LANG_QUARREN | LANG_BOTHESE )
Here is how I had it:
Code:
/*
 * Languages -- Altraag
 */
#define LANG_UNKNOWN        0 /* Anything that doesnt fit a category */
typedef enum
{
   LANG_COMMON, LANG_SHYRIIWOOK, LANG_TWI_LEK, LANG_RODIAN, LANG_HUTT, LANG_MON_CALAMARI,
   LANG_NOGHRI, LANG_EWOK, LANG_ITHORIAN, LANG_GOTAL, LANG_DEVARONIAN, LANG_BINARY,
   LANG_SPIRTUAL, LANG_MAGICAL, LANG_GAMORREAN, LANG_GOD, LANG_ANCIENT, LANG_JAWA,
   LANG_CLAN, LANG_ADARIAN, LANG_VERPINE, LANG_DEFEL, LANG_TRANDOSHAN, LANG_CHADRA_FAN,
   LANG_QUARREN, LANG_BOTHESE
} lang_types;
#define VALID_LANGS    ( LANG_COMMON | LANG_SHYRIIWOOK  | LANG_TWI_LEK | LANG_RODIAN  \
                       | LANG_HUTT | LANG_MON_CALAMARI | LANG_NOGHRI | LANG_GAMORREAN \
                       | LANG_JAWA | LANG_ADARIAN | LANG_EWOK | LANG_BINARY | LANG_VERPINE | LANG_DEFEL \
                       | LANG_TRANDOSHAN | LANG_CHADRA_FAN | LANG_QUARREN | LANG_BOTHESE )
[FONT=verdana,geneva,lucida,'lucida grande',arial,helvetica,sans-serif]
[/font]

I also tried commenting out the define for LANG_UNKNOWN and tried putting it in the table:
Code:
typedef enum
{
   LANG_COMMON, LANG_SHYRIIWOOK, LANG_TWI_LEK, LANG_RODIAN, LANG_HUTT, LANG_MON_CALAMARI,
   LANG_NOGHRI, LANG_EWOK, LANG_ITHORIAN, LANG_GOTAL, LANG_DEVARONIAN, LANG_BINARY,
   LANG_SPIRTUAL, LANG_MAGICAL, LANG_GAMORREAN, LANG_GOD, LANG_ANCIENT, LANG_JAWA,
   LANG_CLAN, LANG_ADARIAN, LANG_VERPINE, LANG_DEFEL, LANG_TRANDOSHAN, LANG_CHADRA_FAN,
   LANG_QUARREN, LANG_BOTHESE, LANG_UNKOWN
} lang_types;
That stopped most of the bug spam about null languages, although most mobs then spoke several languages, and one mob was still reporting a null language, and my ch->speaking and ch->speaks was negative. Anyway, my question is, is there any other way to easily extend the bitvectors so I can have virtually unlimited race and language creation abilitites, or a way to fix the languages to work in a typedef enum table? Thanks in advance.
Shoie13 is offline   Reply With Quote
Old 04-11-2008, 09:40 PM   #2
Samson
Member
 
Samson's Avatar
 
Join Date: Apr 2002
Location: United Socialist States of America
Home MUD: SmaugMuds.org
Home MUD: Arthmoor MUD Hosting
Posts: 249
Samson is on a distinguished road
Re: Languages and Races and Extending Bitvectors

The enum you have defined will work for the flags, but you need to keep that VALID_LANGS listing as well. In the code where languages are actually set on the player, they need to be switched from SET_BIT to xSET_BIT in order to pass 32. But that also means you'll need to get extended bitvector support coded into SWR to begin with since it doesn't usually have it.
Samson is offline   Reply With Quote
Reply


Thread Tools


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

All times are GMT -4. The time now is 09:31 PM.


Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Style based on a design by Essilor
Copyright Top Mud Sites.com 2014