|
|||||||
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
|
![]() |
|
|
LinkBack | Thread Tools |
|
|
#1 |
|
New Member
Join Date: Feb 2008
Posts: 10
![]() |
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 )
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]
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;
|
|
|
|
|
|
#2 |
|
Member
Join Date: Apr 2002
Location: California, USA
Home MUD: Alsherok
Posts: 169
![]() |
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.
|
|
|
|