adding slots for wearing armor/objects?
< Newer Topic
:: Older Topic >
Pages:<< prev 1 next >>
#1 Feb 25, 2010 6:13 pm
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!
#2 Feb 25, 2010 6:26 pm
Off the Edge of the Map
GroupAdministrators
Posts1,200
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?
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?
#3 Feb 25, 2010 6:47 pm
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).
#4 Feb 25, 2010 7:00 pm
Off the Edge of the Map
GroupAdministrators
Posts1,200
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*
*goes off to work*
#5 Feb 26, 2010 12:48 am
Off the Edge of the Map
GroupAdministrators
Posts1,200
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.:
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:
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:
and
Then you want to open up act_info.c and find:
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.
Then the array should look like:
Then the list in act_info.c should look like:
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.
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", "&w ", "&w ", "&w ", "&w ", "&w ", "&w ", "&w ", "&w ", "&w ", "&w ", "&w ", "&w ", "&w ", "&w ", "&w ", "&w ", "&w ", "&w ", "&w ", "&w ", "&w ", "&w ", "&w ", "&w ", "&w ", "&w ", "&w ", "&w " };
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.
Pages:<< prev 1 next >>