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


This is a discussion on "Languages and Races and Extending Bitvectors" in the Top Mud Sites MUD Coding forum :

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



You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our MUD community today!

If you have any problems with the registration process or your account login, please contact us.

If you are a registered member of the old TMS forums, please click here
Reply
 
LinkBack Thread Tools
Old 03-02-2008, 01:02 AM   #1
Shoie13
New Member
 
Join Date: Feb 2008
Posts: 10
Shoie13 is on a distinguished road
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  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 04-11-2008, 09:40 PM   #2
Samson
Member
 
Samson's Avatar
 
Join Date: Apr 2002
Location: California, USA
Home MUD: Alsherok
Posts: 169
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  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
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
Trackbacks are On
Pingbacks are On
Refbacks are On

All times are GMT -4. The time now is 11:28 PM.


Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.0.0
Style based on a design by Essilor
Copyright Top Mud Sites.com 2007