Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
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
Bug in do_drag( )
Oct 8, 2017, 12:40 am
By GatewaySysop
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
Beastmaster 6D sound files
Author: Vladaar
Submitted by: Vladaar
Users Online
CommonCrawl, Google, Bing, Yahoo!

Members: 0
Guests: 11
Stats
Files
Topics
Posts
Members
Newest Member
476
3,704
19,231
608
LAntorcha
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » Codebases » SmaugFUSS » adding slots for wearing armo...
Forum Rules | Mark all | Recent Posts

adding slots for wearing armor/objects?
< Newer Topic :: Older Topic >

Pages:<< prev 1 next >>
Post is unread #1 Feb 25, 2010, 4:13 pm
Go to the top of the page
Go to the bottom of the page

jenni
Fledgling
GroupMembers
Posts9
JoinedFeb 6, 2010

i'm trying to add a few new slots and the only references to his that i've found in the code have been in the race files for each race; can i simply add a new slot to the list in the applicable race files or does it need to be referenced elsewhere? thanks in advance for any tips!
       
Post is unread #2 Feb 25, 2010, 4:26 pm
Go to the top of the page
Go to the bottom of the page

Kayle
Off the Edge of the Map
GroupAdministrators
Posts1,195
JoinedMar 21, 2006

Not exactly. You'll need to look in act_info.c near the top of the file is the list of how things display on the equipment command.

You'll need to then find the defines used for the wear_flags. You'll then need to... You know.. an example would probably be easier.

Do you have a specific type of wear location you wanted to add that I could use in my example or would you rather I just used some random wear location?
       
Post is unread #3 Feb 25, 2010, 4:47 pm
Go to the top of the page
Go to the bottom of the page

jenni
Fledgling
GroupMembers
Posts9
JoinedFeb 6, 2010

well if the method would essentially be the same for them all then a general would work, but if it varies, i suppose i'm most interested in ornamental objects (as opposed to say, a weapon).
       
Post is unread #4 Feb 25, 2010, 5:00 pm
Go to the top of the page
Go to the bottom of the page

Kayle
Off the Edge of the Map
GroupAdministrators
Posts1,195
JoinedMar 21, 2006

It would in fact be the same, and I actually need to add a wear location to one of my own muds, so I'll do so to make sure I don't give you bad advice, and then post a detailed little guide on how to do so.

*goes off to work*
       
Post is unread #5 Feb 25, 2010, 10:48 pm
Go to the top of the page
Go to the bottom of the page

Kayle
Off the Edge of the Map
GroupAdministrators
Posts1,195
JoinedMar 21, 2006

Alright.

So to add a wear location you'll need to modify quite a few places.

First off, in mud.h You'll need to find two sets of flags. The first set begins with WEAR_ the second set begins with ITEM_WEAR_:
I.E.:
/*
 * Wear flags.
 * Used in #OBJECTS.
 */
#define ITEM_TAKE		BV00
#define ITEM_WEAR_FINGER	BV01
#define ITEM_WEAR_NECK		BV02

Remember not to go over BV31 for these. If you have to go past that, you're going to need some major changes.
and then like:
/*
 * Equpiment wear locations.
 * Used in #RESETS.
 */
typedef enum
{
   WEAR_NONE = -1, WEAR_LIGHT = 0, WEAR_FINGER_L, WEAR_FINGER_R, WEAR_NECK_1,

You'll need to add your new flag to each of those. Once you've done that, You'll need to add them to the appropriate arrays in build.c:
const char *const w_flags[] = { //This matches up with the BV List

and
const char *const wear_locs[] = { //This matches up with the enum


Then you want to open up act_info.c and find:
const char *const where_name[] = {

Now, when you add your wear location to this list, you're going to need to make sure it matches the SAME SLOT as in the enum and the wear_locs array.

So if you're enum looks like:
Disclaimer: These are taken from one of my bases and are not stock.
/*
 * Equpiment wear locations.
 * Used in #RESETS.
 */
typedef enum
{
   WEAR_NONE = -1, WEAR_LIGHT = 0, WEAR_HEAD, WEAR_EYES, WEAR_FACE,
   WEAR_EARS, WEAR_NECK_1, WEAR_NECK_2, WEAR_BACK, WEAR_ABOUT, WEAR_BODY, 
   WEAR_SHOULDER_L, WEAR_SHOULDER_R, WEAR_ARMS, WEAR_WRIST_L, WEAR_WRIST_R, 
   WEAR_BOTH_WRISTS, WEAR_HANDS, WEAR_FINGER_L, WEAR_FINGER_R, WEAR_WIELD, 
   WEAR_DUAL_WIELD, WEAR_TWOHAND, WEAR_HOLD, WEAR_SHIELD, WEAR_WAIST, 
   WEAR_LEGS, WEAR_ANKLE_L, WEAR_ANKLE_R, WEAR_FEET,

   MAX_WEAR
} wear_locations;

Then the array should look like:
const char *const wear_locs[] = {
   "light", "head", "eyes", "face", "ears", "neck1", "neck2", "back", "about", 
   "body", "shoulder1", "shoulder2", "arms", "wrist1", "wrist2", "_bothwrists_", 
   "hands", "finger1", "finger2", "wield", "dual_wield", "twohand", "hold", 
   "shield", "waist", "legs", "ankle1", "ankle2", "feet"
};

Then the list in act_info.c should look like:
const char *const where_name[] = {
   "&w<used as light>        ",
   "&w<worn on head>         ",
   "&w<worn on eyes>         ",
   "&w<worn over face>       ",
   "&w<worn on ears>         ",
   "&w<worn around neck>     ",
   "&w<worn around neck>     ",
   "&w<worn on back>         ",
   "&w<worn about body>      ",
   "&w<worn on body>         ",
   "&w<worn on shoulder>     ",
   "&w<worn on shoulder>     ",
   "&w<worn on arms>         ",
   "&w<worn around wrist>    ",
   "&w<worn around wrist>    ",
   "&w<worn on both wrists>  ",
   "&w<worn on hands>        ",
   "&w<worn on finger>       ",
   "&w<worn on finger>       ",
   "&w<main hand weapon>     ",
   "&w<off hand weapon>      ",
   "&w<two-handed weapon>    ",
   "&w<held>                 ",
   "&w<used as enrgy shield> ",
   "&w<worn about waist>     ",
   "&w<worn on legs>         ",
   "&w<worn around ankle>    ",
   "&w<worn around ankle>    ",
   "&w<worn on feet>         "
};


Make sense?

Alright. In act_obj.c you'll want to find the wear_obj function and copy on of the case statements for the other wear locations and modify the messages to be appropriate to your added wear location.

And then in handler.c you'll need to find apply_ac and add it in there using the rest as a guide if you feel that the location should apply to a characters AC. If not, leave it out.

And that's all there is to it.

If you want a more detailed explanation with more examples I'd be more than happy to oblige, but it'd have to wait until after my NyQuil wears off. :P
       
Pages:<< prev 1 next >>