Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
 Couple bugs
Today, 5:42 pm
By Remcon
Bug in disarm( )
Nov 12, 2017, 6:54 pm
By GatewaySysop
Bug in will_fall( )
Oct 23, 2017, 1:35 am
By GatewaySysop
Bug in do_zap( ), do_brandish( )
Oct 18, 2017, 1:52 pm
By GatewaySysop
Bug in get_exp_worth( )
Oct 10, 2017, 1:26 am
By GatewaySysop
LOP 1.45
Author: Remcon
Submitted by: Remcon
LOP Heroes Edition
Author: Vladaar
Submitted by: Vladaar
Heroes sound extras
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.3
Author: Vladaar
Submitted by: Vladaar
Memwatch
Author: Johan Lindh
Submitted by: Vladaar
Users Online
CommonCrawl, Sogou, Yahoo!, Yandex

Members: 0
Guests: 15
Stats
Files
Topics
Posts
Members
Newest Member
477
3,705
19,232
608
LAntorcha
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » Codebases » SmaugFUSS » WEAR locations in smaugfuss b...
Forum Rules | Mark all | Recent Posts

WEAR locations in smaugfuss based codebases
< Newer Topic :: Older Topic >

Pages:<< prev 1 next >>
Post is unread #1 Sep 29, 2013, 10:20 pm
Go to the top of the page
Go to the bottom of the page

antram
Apprentice
GroupMembers
Posts58
JoinedNov 22, 2010

Hi guys,

I would like to ask you something about smaugfuss codebases. If someone knows the answer and can explain me, I appreciate it.

I am trying to add new wear locations in a smaugfuss based codebase but I am having some troubles. I founded a snippet wich explains how to do it and I followed all the instructions on it but when I show the items with equip command, it doesn't show well. for example, when i put a head wear flag, it shows me on finger, and something like that.

I don't understand why happend it. then, I am trying to add more ITEM_WEAR defines, but it only can do until a maximum of 31 items. I know that it seems too difficult to complete these, but I want to use each item separately from other items.

I forgot to tell you that I am trying to show the equipment from the top of the body to the bottom. for example, first head, then face, then eyes, etc, until the last thing I want to show is back.

Thanks so much if someone can help me.

Antram
       
Post is unread #2 Sep 30, 2013, 6:39 am   Last edited Sep 30, 2013, 6:42 am by Patriot
Go to the top of the page
Go to the bottom of the page

Guest - (Unregistered)

Make sure everything stays on same order in all files.
       
Post is unread #3 Sep 30, 2013, 10:57 am
Go to the top of the page
Go to the bottom of the page

antram
Apprentice
GroupMembers
Posts58
JoinedNov 22, 2010

Hi,

Thanks for answering but I made sure good. Has any other suggestions?

thanks again. I founded a snippet wich explains how to convert bitvectors in extended bitvectors, but is for channels. I'm not sure if I have to follow the same instructions with ITEM_WEAR_HEAD and the other items in mud.h. I had seen that extended bitvectors are better than bitvectors because it allows you to enlarge the list of an item like I want. also I see that most things uses this system. why nobody has changed the other things wich are with bitvectors?

thanks again and sorry but I'm not sure if my english is good enough. I am trying to improbe it.
       
Post is unread #4 Sep 30, 2013, 11:26 am
Go to the top of the page
Go to the bottom of the page

Quixadhal
Conjurer
GroupMembers
Posts398
JoinedMar 8, 2005

The problem with bitvectors, is that they were designed to solve a problem that no longer exists. Back in 1988, the typical MUD would be lucky to have access to a machine with 8M of RAM, and so trying to compress everything as tightly as possible was important.

Thus, you'll find lots of code that does stuff like:

if( x->bitthing & BIT_FOO | BIT_BAR | BIT_ACK ) do_stuff();

Now, you can easily change your structures to use extended bit vectors, or better yet, just stop using those antiquated things and "waste" the extra memory to make each "bit" a full boolean field. Oh no, your MUD will now take 64M of RAM instead of 8M... what will you do with the extra 3.9G ?

But, in either case, that will break the aforementioned style of coding, since you'd now do something like.

if( x->foo || x->bar || x->ack ) do_stuff();

Basically, nobody wants to go through all that legacy code and change it.
       
Post is unread #5 Oct 2, 2013, 6:24 pm
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,858
JoinedJul 26, 2005

Haha I've done it before. I even once did them all as their own bool but later decided doing the EXT_BV was the best choice lol. It can be a bit of a pain depending on what you are changing from an int to an EXT_BV or even to a bool list.
       
Post is unread #6 Oct 2, 2013, 9:09 pm
Go to the top of the page
Go to the bottom of the page

Quixadhal
Conjurer
GroupMembers
Posts398
JoinedMar 8, 2005

If you're willing to do the work, it's best to make every field its own value (boolean or not). Not only does that make the code easier to read, it also makes it trivial to export your data to a serializer like JSON, or to an SQL database schema where the schema is actually useful.

Consider, if you have a database schema where ROOM_DARK is a boolean, and SECT_TYPE is an integer that's a foreign key to a table that holds all the sector types (an enum, in code), you can do a query like SELECT vnum FROM rooms JOIN sector_types ON (sector_type_id) WHERE dark AND sector_type_name NOT IN ('indoors', 'underground'); to find all the dark rooms that are not indoor or underground rooms.

Doing that with bit vectors requires obnoxious math on the query side to filter out the bit values.
       
Post is unread #7 Oct 4, 2013, 6:47 pm
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,858
JoinedJul 26, 2005

well looks like in lop i switched most from using an int to EXT_BV only the object values still use IS_SET etc... and area status. I might consider it one of these days though just for the ease of things lol. Well I guess it all uses the bits though since EXT_BV does the same just with more ints haha. Might see just how hard it is to switch all the EXT_BV over to bools now though haha
       
Post is unread #8 Oct 10, 2013, 4:40 am
Go to the top of the page
Go to the bottom of the page

antram
Apprentice
GroupMembers
Posts58
JoinedNov 22, 2010

Hi,

Since I asked here how to add new wear locations in smaugfuss, I've managed to expand the list of locations, but I have a problem. There is only a location wich I'm not able to use well.

Is te wear_hold location. I tried to use like others, without the argument "hold" when I write wear <object> but It always tells me that I can't wear, wield or hold it. I've tried everything that I thing that not allows to holding items without results.

Anybody can help me?

Thanks so much.
       
Pages:<< prev 1 next >>