Ok I'm trying to change the affect flags to an extended bitvector, the source is a bebop source from cbsc.com its a drop off from swrsmaug I think. I tried to change it once, and got nothing but errors. Was wondering if someone would be interested in maybe telling me how to change it to the extended bit vector and all that...
Bits to extended bitvectors
Posted by Metsuro on Wed 18 Jan 2006 08:16 PM — 15 posts, 48,737 views.
It helps to post the code and the errors you got.
I have a forum for the CB:SC source, and this same question was asked.
http://rebirthseph.noobify.com/forum/index.php?a=topic&t=25
You can follow the general idea of this:
http://www.auricmud.com/snippets/roomflags.html
http://rebirthseph.noobify.com/forum/index.php?a=topic&t=25
You can follow the general idea of this:
http://www.auricmud.com/snippets/roomflags.html
Yea zeno, I posted it there and was hoping for more help cause it ended with me giving the errors and just asking why their were underscores, which there werent heh. These are the only changes I made.
mud.h
then added xIS_SET and such to the parts where each of the flags was called and all that. but thats all I did and get this...
mud.h
typedef enum
{
ACT_IS_NPC, ACT_SENTINEL, ACT_SCAVENGER, ACT_DAY, ACT_NIGHT, ACT_AGGRESSIVE,
ACT_STAY_AREA, ACT_WIMPY, ACT_PET, ACT_TRAIN, ACT_PRACTICE, ACT_IMMORTAL,
ACT_DEADLY, ACT_POLYSELF, ACT_PACIFIST, ACT_GUARDIAN, ACT_RUNNING, ACT_NOWANDER,
ACT_MOUNTABLE, ACT_MOUNTED, ACT_SCHOLAR, ACT_SECRETIVE, ACT_POLYMORPHED, ACT_MOBINVIS,
ACT_NOASSIST, ACT_NOKILL, ACT_DROID, ACT_NOCORPSE, ACT_CITIZEN, ACT_SUPPORTER,
ACT_PROTOTYPE, ACT_EXEMPT, ACT_NOSTEAL, ACT_DRUG_FIEND
} actflags;then added xIS_SET and such to the parts where each of the flags was called and all that. but thats all I did and get this...
act_comm.o: In function `do_tell':
/home/Kathi/bebop/src/act_comm.c:1349: undefined reference to `_xIS_SET'
/home/Kathi/bebop/src/act_comm.c:1358: undefined reference to `_xIS_SET'
act_comm.o: In function `do_otell':
/home/Kathi/bebop/src/act_comm.c:2843: undefined reference to `_xIS_SET'
/home/Kathi/bebop/src/act_comm.c:2852: undefined reference to `_xIS_SET'
build.o: In function `fold_area':
/home/Kathi/bebop/src/build.c:5806: undefined reference to `_xREMOVE_BIT'
clans.o: In function `support_update':
/home/Kathi/bebop/src/clans.c:3510: undefined reference to `_xREMOVE_BIT'
/home/Kathi/bebop/src/clans.c:3511: undefined reference to `_xSET_BIT'
/home/Kathi/bebop/src/clans.c:3512: undefined reference to `_xSET_BIT'
/home/Kathi/bebop/src/clans.c:3561: undefined reference to `_xREMOVE_BIT'
/home/Kathi/bebop/src/clans.c:3562: undefined reference to `_xSET_BIT'
/home/Kathi/bebop/src/clans.c:3563: undefined reference to `_xSET_BIT'
clans.o: In function `citizen_generate':
/home/Kathi/bebop/src/clans.c:3717: undefined reference to `_xREMOVE_BIT'
/home/Kathi/bebop/src/clans.c:3718: undefined reference to `_xSET_BIT'
clans.o: In function `generate_police':
/home/Kathi/bebop/src/clans.c:4182: undefined reference to `_xTOGGLE_BIT'
/home/Kathi/bebop/src/clans.c:4183: undefined reference to `_xREMOVE_BIT'
/home/Kathi/bebop/src/clans.c:4184: undefined reference to `_xIS_SET'
fight.o: In function `damage':
/home/Kathi/bebop/src/fight.c:1186: undefined reference to `_xIS_SET'
/home/Kathi/bebop/src/fight.c:1698: undefined reference to `_xIS_SET'
fight.o: In function `update_pos':
/home/Kathi/bebop/src/fight.c:1878: undefined reference to `_xREMOVE_BIT'
/home/Kathi/bebop/src/fight.c:1895: undefined reference to `_xREMOVE_BIT'
fight.o: In function `raw_kill':
/home/Kathi/bebop/src/fight.c:2126: undefined reference to `_xIS_SET'
/home/Kathi/bebop/src/fight.c:2131: undefined reference to `_xIS_SET'
/home/Kathi/bebop/src/fight.c:2141: undefined reference to `_xIS_SET'
/home/Kathi/bebop/src/fight.c:2141: undefined reference to `_xIS_SET'
handler.o: In function `extract_char':
/home/Kathi/bebop/src/handler.c:1827: undefined reference to `_xREMOVE_BIT'
handler.o: In function `extract_char2':
/home/Kathi/bebop/src/handler.c:2017: undefined reference to `_xIS_SET'
/home/Kathi/bebop/src/handler.c:2024: undefined reference to `_xREMOVE_BIT'
/home/Kathi/bebop/src/handler.c:2037: undefined reference to `_xREMOVE_BIT'
/home/Kathi/bebop/src/handler.c:2067: undefined reference to `_xIS_SET'
magic.o: In function `make_poly_mob':
/home/Kathi/bebop/src/magic.c:4037: undefined reference to `_xSET_BIT'
mud_comm.o: In function `simple_damage':
/home/Kathi/bebop/src/mud_comm.c:1963: undefined reference to `_xIS_SET'
player.o: In function `do_oldscore':
/home/Kathi/bebop/src/player.c:552: undefined reference to `_xIS_SET'
reset.o: In function `reset_area':
/home/Kathi/bebop/src/reset.c:1314: undefined reference to `_xIS_SET'
/home/Kathi/bebop/src/reset.c:1322: undefined reference to `_xIS_SET'
/home/Kathi/bebop/src/reset.c:1334: undefined reference to `_xSET_BIT'
shops.o: In function `do_list':
/home/Kathi/bebop/src/shops.c:642: undefined reference to `_xIS_SET'
skills.o: In function `trip':
/home/Kathi/bebop/src/skills.c:2512: undefined reference to `_xREMOVE_BIT'
skills.o: In function `do_dismount':
/home/Kathi/bebop/src/skills.c:3032: undefined reference to `_xREMOVE_BIT'
/home/Kathi/bebop/src/skills.c:3043: undefined reference to `_xREMOVE_BIT'
update.o: In function `char_check':
/home/Kathi/bebop/src/update.c:3124: undefined reference to `_xREMOVE_BIT'
space.o: In function `do_board':
/home/Kathi/bebop/src/space.c:4710: undefined reference to `_xIS_SET'
swskills.o: In function `do_rumors':
/home/Kathi/bebop/src/swskills.c:6164: undefined reference to `_xIS_SET'
quest.o: In function `generate_quest':
/home/Kathi/bebop/src/quest.c:623: undefined reference to `_xIS_SET'
/home/Kathi/bebop/src/quest.c:623: undefined reference to `_xIS_SET'
/home/Kathi/bebop/src/quest.c:623: undefined reference to `_xIS_SET'
collect2: ld returned 1 exit status
Hm. Do you even have xIS_SET or xREMOVE_BIT?
What do you mean, do I even have it?
CB:SC is based off an old Smaug right? Does the code have the xIS_SET macro? (I assume it's a macro)
In my mud.h file I have this:
This defines what xIS_SET does. If you don't have that then you will get the errors you got (undefined reference to `_xIS_SET').
The extra underscore is added by the compiler to the variable name in the object file (for some reason).
/*
* Here are the extended bitvector macros:
*/
#define xIS_SET(var, bit) ((var).bits[(bit) >> RSV] & 1 << ((bit) & XBM))
#define xSET_BIT(var, bit) ((var).bits[(bit) >> RSV] |= 1 << ((bit) & XBM))
#define xSET_BITS(var, bit) (ext_set_bits(&(var), &(bit)))
#define xREMOVE_BIT(var, bit) ((var).bits[(bit) >> RSV] &= ~(1 << ((bit) & XBM)))
This defines what xIS_SET does. If you don't have that then you will get the errors you got (undefined reference to `_xIS_SET').
The extra underscore is added by the compiler to the variable name in the object file (for some reason).
Alright that was interesting, might as well mention I know nothing about this or what I'm doing just guessing here... so I toyed around and put that in and hey...
act_comm.c: In function `do_say':
act_comm.c:1142: error: request for member `bits' in something not a structure o
r union
act_comm.c:1142: error: `RSV' undeclared (first use in this function)
act_comm.c:1142: error: (Each undeclared identifier is reported only once
act_comm.c:1142: error: for each function it appears in.)
act_comm.c:1142: error: `XBM' undeclared (first use in this function)
act_comm.c: In function `do_osay':
act_comm.c:1203: error: request for member `bits' in something not a structure o
r union
act_comm.c:1203: error: `RSV' undeclared (first use in this function)
act_comm.c:1203: error: `XBM' undeclared (first use in this function)
act_comm.c: In function `do_tell':
act_comm.c:1351: error: request for member `bits' in something not a structure o
r union
act_comm.c:1351: error: `RSV' undeclared (first use in this function)
act_comm.c:1351: error: `XBM' undeclared (first use in this function)
act_comm.c:1359: error: request for member `bits' in something not a structure o
r union
act_comm.c: In function `do_emote':
act_comm.c:1555: error: request for member `bits' in something not a structure o
r union
act_comm.c:1555: error: `RSV' undeclared (first use in this function)
act_comm.c:1555: error: `XBM' undeclared (first use in this function)
act_comm.c: In function `do_quit':
act_comm.c:1649: error: request for member `bits' in something not a structure o
r union
act_comm.c:1649: error: `RSV' undeclared (first use in this function)
act_comm.c:1649: error: `XBM' undeclared (first use in this function)
act_comm.c: In function `do_save':
act_comm.c:1887: error: request for member `bits' in something not a structure o
r union
act_comm.c:1887: error: `RSV' undeclared (first use in this function)
act_comm.c:1887: error: `XBM' undeclared (first use in this function)
act_comm.c: In function `do_languages':
act_comm.c:2667: error: request for member `bits' in something not a structure o
r union
act_comm.c:2667: error: `RSV' undeclared (first use in this function)
act_comm.c:2667: error: `XBM' undeclared (first use in this function)
act_comm.c: In function `do_otell':
act_comm.c:2845: error: request for member `bits' in something not a structure o
r union
act_comm.c:2845: error: `RSV' undeclared (first use in this function)
act_comm.c:2845: error: `XBM' undeclared (first use in this function)
act_comm.c:2853: error: request for member `bits' in something not a structure o
r union
make[1]: *** [act_comm.o] Error 1
Well ok... seeing as the cbsc doesn't have anything needed for bitvectors I found out why i got the rsv and all that... hah...
I was wondering if someone would mind helping me find the parts needed to define the extended bitvectors and such so I may try and place it in the thing?
I was wondering if someone would mind helping me find the parts needed to define the extended bitvectors and such so I may try and place it in the thing?
Extended bitvectors are not a 5-minute job.
First you need the macros.
Then you need to change the structures to use them (eg. room definitions).
Then you need to change the way the areas are read/written.
Then you need to change the tests for bits.
I would look at the SMAUG code to see how they have done it.
First you need the macros.
Then you need to change the structures to use them (eg. room definitions).
Then you need to change the way the areas are read/written.
Then you need to change the tests for bits.
I would look at the SMAUG code to see how they have done it.
As someone who has converted more than one set of bitvectors in my day, I can attest to it being a huge amount of work. Unless you absolutely need it, it's not something you should take lightly or do "just because".
Well i'm trying to to have more act flags, and only remember having the option of extended bitvectors to add more.
You could just make another struct for another set of bitvectors. Name it something like act2.
theres already an act two, and i'm not even sure how that works...