Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ SMAUG ➜ SMAUG coding ➜ Bits to extended bitvectors

Bits to extended bitvectors

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Metsuro   USA  (389 posts)  Bio
Date Wed 18 Jan 2006 08:16 PM (UTC)
Message
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...

Everything turns around in the end
Top

Posted by Nick Gammon   Australia  (23,162 posts)  Bio   Forum Administrator
Date Reply #1 on Wed 18 Jan 2006 11:06 PM (UTC)
Message
It helps to post the code and the errors you got.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #2 on Thu 19 Jan 2006 12:58 AM (UTC)
Message
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

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by Metsuro   USA  (389 posts)  Bio
Date Reply #3 on Thu 19 Jan 2006 02:13 AM (UTC)
Message
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

 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

Everything turns around in the end
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #4 on Thu 19 Jan 2006 02:51 AM (UTC)
Message
Hm. Do you even have xIS_SET or xREMOVE_BIT?

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by Metsuro   USA  (389 posts)  Bio
Date Reply #5 on Thu 19 Jan 2006 03:17 AM (UTC)
Message
What do you mean, do I even have it?

Everything turns around in the end
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #6 on Thu 19 Jan 2006 03:27 AM (UTC)
Message
CB:SC is based off an old Smaug right? Does the code have the xIS_SET macro? (I assume it's a macro)

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by Nick Gammon   Australia  (23,162 posts)  Bio   Forum Administrator
Date Reply #7 on Thu 19 Jan 2006 03:43 AM (UTC)
Message
In my mud.h file I have this:


/*
 * 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).

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Metsuro   USA  (389 posts)  Bio
Date Reply #8 on Thu 19 Jan 2006 03:50 AM (UTC)
Message
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

Everything turns around in the end
Top

Posted by Metsuro   USA  (389 posts)  Bio
Date Reply #9 on Thu 19 Jan 2006 04:08 AM (UTC)
Message
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?

Everything turns around in the end
Top

Posted by Nick Gammon   Australia  (23,162 posts)  Bio   Forum Administrator
Date Reply #10 on Thu 19 Jan 2006 04:31 AM (UTC)
Message
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.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Samson   USA  (683 posts)  Bio
Date Reply #11 on Thu 19 Jan 2006 11:27 AM (UTC)
Message
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".
Top

Posted by Metsuro   USA  (389 posts)  Bio
Date Reply #12 on Thu 19 Jan 2006 01:52 PM (UTC)
Message
Well i'm trying to to have more act flags, and only remember having the option of extended bitvectors to add more.

Everything turns around in the end
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #13 on Thu 19 Jan 2006 03:45 PM (UTC)
Message
You could just make another struct for another set of bitvectors. Name it something like act2.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by Metsuro   USA  (389 posts)  Bio
Date Reply #14 on Thu 19 Jan 2006 03:47 PM (UTC)
Message
theres already an act two, and i'm not even sure how that works...

Everything turns around in the end
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


40,115 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.