Wear locations...

Posted by Ithildin on Thu 17 Jun 2004 06:07 AM — 18 posts, 72,424 views.

USA #0
ok, i've searched for any information on wear locations, there was a few, but not waht i needed. i've come across something strange. or so i think? I added new wear locs in my mud. they all work fine and dandy. i ordered them head to toe. fine and dandy. works great. but now, i forgot to add two wear locs taht i am going to put in. so i put them in. and now, nothing will set right. i put those other wear locs in a couple months ago, and now i just tried the two new ones. and i can't get them to work properly, everything gets misaligned from the new wear loc down and i don't know how to fix it. so here's what i've got. see if you can all find anything:
***amended*****
I put in bicep
***************

build.c

char *	const	w_flags	[] =
{
"take", "over", "head", "ears", "face", "eyes", "neck", "r1", "shoulder", 
"body", "about", "waist", "r2", "r3", "shield", "bicep", "arms", 
"wrist", "hands", "finger", "wield", "_dual_", "missile", "hold", "legs", 
"ankle", "feet", "r4","r5","r6", "lodge_rib", "lodge_arm", "lodge_leg",
"r10","r11","r12","r13"
};

char *	const	item_w_flags	[] =
{
"take", "light", "over", "over", "over", "head", "ears", "face", "eyes",  "neck", 
"neck", "strap", "strap", "shoulder", "body", "about", "waist", "attach", 
"sheath", "sheath", "sheath", "sheath", "sheath",						
"shield", "bicep", "arms", "wrist", "wrist", "hands", "finger",					
"finger", "wield", "dual", "missile" "hold", "legs", "ankle", "ankle", "feet", 
"lodge_rib", "lodge_arm", "lodge_leg","r7","r8","r9","r10","r11","r12","r13"
};

further down...

char *	const	wear_locs [] =
{
"light", "finger1", "finger2", "neck1", "neck2", "body", "head", "legs",
"feet", "hands", "arms", "shield", "about", "waist", "wrist1", "wrist2",
"wield", "hold", "dual_wield", "ears", "eyes", "missile_wield", "back",
"face", "ankle1", "ankle2", "strap1", "strap2", "attach", "sheath1",
 "sheath2", "sheath3", "sheath4", "sheath5", "over1", "over2", "over3", "shoulder",
 "bicep"
};

mud.h

#define ITEM_WEAR_WAIST		BV11
#define ITEM_WEAR_ATTACH	BV12
#define ITEM_WEAR_SHEATH	BV13
#define ITEM_WEAR_SHIELD	BV14
#define ITEM_WEAR_BICEP		BV15
#define ITEM_WEAR_ARMS		BV16
#define ITEM_WEAR_WRIST		BV17
#define ITEM_WEAR_HANDS		BV18
#define ITEM_WEAR_FINGER	BV19
#define ITEM_WIELD			BV20

further down...

...
  WEAR_SHOULDER, 
  WEAR_BODY, 
  WEAR_ABOUT, 
  WEAR_WAIST,
  WEAR_ATTACH,
  WEAR_SHEATH_1,
  WEAR_SHEATH_2,
  WEAR_SHEATH_3,
  WEAR_SHEATH_4,
  WEAR_SHEATH_5,
  WEAR_SHIELD, 
  WEAR_BICEP, 
  WEAR_ARMS, 
  WEAR_WRIST_L, 
  WEAR_WRIST_R,
  WEAR_HANDS,
  WEAR_FINGER_L, 
...


act_obj.c

	case ITEM_WEAR_BICEP:
	    if ( !remove_obj( ch, WEAR_BICEP, fReplace ) )
		return;
            if ( !oprog_use_trigger( ch, obj, NULL, NULL, NULL ) )
            {
		act( AT_ACTION, "&w$n wear $p &won $s bicep.",   ch, obj, NULL, TO_ROOM );
		act( AT_ACTION, "&wYou wear $p &won your bicep.", ch, obj, NULL, TO_CHAR );
            }
	    equip_char( ch, obj, WEAR_BICEP );
	    oprog_wear_trigger( ch, obj );
	    return;

act_info.c

char * const    where_name [] =
{
	"&w<used as light>        ",
    "&w<worn over head>       ",
    "&w<worn over head>       ",
    "&w<worn over head>       ",
    "&w<worn on head>         ",
    "&w<worn on ears>         ",
    "&w<worn over face>       ",
    "&w<worn on eyes>         ",
    "&w<worn around neck>     ",
    "&w<worn around neck>     ",
    "&w<strapped>             ",
    "&w<strapped>             ",
    "&w<worn over shoulders>  ",
    "&w<worn on body>         ",
    "&w<worn about body>      ",
    "&w<worn on waist>        ",
    "&w<attached to belt>     ",
    "&w<sheathed>             ",
    "&w<sheathed>             ",
    "&w<sheathed>             ",
    "&w<sheathed>             ",
    "&w<sheathed>             ",
    "&w<worn as shield>       ",
    "&w<worn on bicep>        ",
    "&w<worn on arms>         ",
    "&w<worn around wrist>    ",
    "&w<worn around wrist>    ",
    "&w<worn on hands>        ",
    "&w<worn on finger>       ",
    "&w<worn on finger>       ",
    "&w<wielded, Primary>     ",
    "&w<wielded, Secondary>   ",
    "&w<missile wielded>      ",
    "&w<held>                 ",
    "&w<worn on legs>         ",
    "&w<worn around ankle>    ",
    "&w<worn around ankle>    ",
    "&w<worn on feet>         ",
    "&w<lodged in a rib>      ",
    "&w<lodged in an arm>     ",
    "&w<lodged in a leg>      ",
    "&r<BUG Inform Nivek>     ",
    "&r<BUG Inform Nivek>     ",
    "&r<BUG Inform Nivek>     "

};



i'll put in what it's doing.
Amended on Thu 17 Jun 2004 06:11 AM by Ithildin
USA #1
here's what it's doing:


vnum 21088  
|    |ostat gauntlets
Name: iron gauntlets
Vnum: 21063  Type: armor  Count:  1  Gcount: 1
Serial#: 1274  TopIdxSerial#: 1274  TopSerial#: 1306
Short description: iron gauntlets
Long description : Some iron gauntlets have fallen here.
Wear flags : take bicep
Extra flags: 
Magic flags: none
Number: 1/1   Weight: 4/4   Layers: 0   Wear_loc: -1
Cost:  4 Gold,  0 Silver,  0 Copper
, 0, Platinum
Rent: 40  Timer: 0  Level: 14
In room: 0  In object: (none)  Carried by: Ithildin
Index Values : 5 5 0 0 0 0.
Object Values: 5 5 0 0 0 0.

vnum 21088  
|    |wear gauntlets
You wear iron gauntlets on your bicep.

vnum 21088  
|    |eq
You are using:
<used as light>        a torch
<worn on head>         an iron helm
<worn over face>       an iron visor
<worn around neck>     an iron guard
<worn over shoulders>  chain sleeves
<worn on body>         a crested breastplate
<worn on arms>         iron gauntlets



all the above is fine. but everything below gauntlets gets thrown off. i've tried so many different things. i just don't know what is going on since i put in those other locations no problem. max_where_name is also +1 as well. so that's no problem t here.

any one see anything?
USA #2
ok, so i tried something different and tried to add a floating object for the player to set floating about the body. i was going to put this at the end to just see if i could get it to work right. as it turns out, i don't think i'm compiling my act_info right. here's how i tested it.

i took out "lodged in a rib" where name and put two floating in there like this.


before...

   "&w<worn around ankle>    ",
    "&w<worn on feet>         ",
    "&w<floating about body>  ",
    "&w<lodged in a rib>      ",
    "&w<lodged in an arm>     ",
    "&w<lodged in a leg>      ",
    "&r<BUG Inform Nivek>     ",
    "&r<BUG Inform Nivek>     ",
    "&r<BUG Inform Nivek>     "

after...

   "&w<worn around ankle>    ",
    "&w<worn on feet>         ",
    "&w<floating about body>  ",
    "&w<floating about body>  ",
    "&w<lodged in an arm>     ",
    "&w<lodged in a leg>      ",
    "&r<BUG Inform Nivek>     ",
    "&r<BUG Inform Nivek>     ",
    "&r<BUG Inform Nivek>     "


and when i compile and restart the mud, here's what i have still:



<worn on legs>         mail leggings
<worn on feet>         black boots
<lodged in a rib>      chain sleeves


so for some reason it's not compiling right and i don't know what's goin on. but when i changed something else in act info and recompiled it showed the changes in the mud. it just never shows the changed in the char const where name. i don't understand why it's doing this.

Canada #3
You have to keep the order in all the tables the same, and you should align them to the bitvectors in mud.h =P.

..and you *really* don't need to keep those reserved locs in there, they're just confusing things.

See what I mean?
USA #4
they were all aligned correctly. it's just my where_name const in act info just isn't compiling correclty. i have no idea what's wrong. everything compiles ok. like i said earlier, i changed something in actinfo and it showed up when i restarted the mud. then i changed the wear location lodged in rib to floating and then after compiling i still get lodged in rib. there's no other place where that is. but everything is in correct order. the bv's the w-flags and so forth. all in the same order, just my char *const where_name is the only problem.
USA #5
This is frustrating me to know end. has this ever happened to anyone? i just don't know why it would do that?
USA #6
ok to give you more examples:

i changed this:

	  act( AT_PLAIN, "You're not much to look at...", ch, NULL, NULL, TO_CHAR );


to this:


	  act( AT_PLAIN, "&rYou're not much to look at...", ch, NULL, NULL, TO_CHAR );


in act_info.c. same place as where_name stuff. i made clean and recompiled. all the while my where_name was this:


    "&w<worn around ankle>    ",
    "&w<worn around ankle>    ",
    "&w<worn on feet>         ",
    "&w<floating about body>  ",
    "&w<floating about body>  ",
    "&w<lodged in an arm>     ",
    "&w<lodged in a leg>      ",


notice there is no lodged in rib.

after i had made clean and recompiled i logged back on and when i "l self" it's in red text, just as it should be, yet my eq still says


<worn on feet>         black boots
<lodged in a rib>      chain sleeves


does anyone have any idea why it would do that? or has anyoen seen that?
USA #7
Did you do a make clean first, as in, did you recompile every source file?
USA #8
yep. did it about 10 times
USA #9
Very strange. I'm not quite sure why its still there then. Sorry :(
Canada #10
K, lemme see if I understand this: You added another wear loc. Did you replace one of the reserve ones, or add it in place of others? If you look at all the lists of names for the locations, do they all synch up ( ie. Spot 5 is wrist in defines, flag names, wearloc names, etc )? Is this the same for all players, or is there criteria for this to happen? Are other pieces changing places after the items are being worn?

There are a couple possibilities: a memory leak would make sense here, if numbers are changing by them selves, but are you getting crashes? You could have flags/wearlocs/wearloc names mixed up. There might even be something inheirently wrong with older changes that haven't surfaced until this time.

You might want to step through the wearing process in GDB and see where the numbers are getting screwed up.

Hope that helps.
Australia #11
I have just added some wear locs too, then re-ordered them all into the way i want to see them listed, making sure all the spots were in the same place in each table, made clean and rebooted, looked at self eq everything was not lined up, remove and re-wear eq and all was dandy, for you i hope its as simple as removeing and rewearing the eq as i did.
USA #12
i already know how to change wear loc's i've done it before. i know what i'm doing with that. it's just that my where name is not changing when i recompile. yes. i've made clean, and recompiled. nothing is working. once again. i changed something in actinfo and it showed up in the mud with the changes. everything except tkaing out the lodged in rib which should have been taken out. for some reason that isn't compiling right. i don't know what i'm doing wrong with that.
USA #13
this is to Greven, i must have skipped over his post.

Yea, i made sure everything was aligned correctly. everything works fine when i haven't changed wear_loc's. but once i change them, put it in exactly the same place, everything compiles correctly EXCEPT the where_name in act_info.c i had never seen a compile to get part of a file but not all of it? can it even do that?

would a memory leak or something cause my char *const where_name to be overlooked when recompiling?

i had already added many new locations before and it worked just fine. i haven't went over my BV's either. so i don't know what's up still...i can't figure it out.
USA #14
Ok, here check this out:

http://www.geocities.com/ty39etc/page1.html

it shows my problem. i'm probably just not being clear on what's going on.
USA #15
Did that help my question any? Do I need to be more specific about it? I don't really know how else to go about it. Has anyone ever experienced something like this before? Could it possible be a memory leak or something?

hmm...i'm just lost.
USA #16
Make sure everything is in align with the where_name stuff and every other aspect i'm sure you don't want to hear that again but it is highly important. Also as silly as it my sound make sure you're saving your changes before compiling. Sometimes I think i saved a file then end up wondering why the hell nothing changed (I do my file editing offline). Just make sure and check over it all. I just recently added some in and had a few issues but it was all because i failed at what i was doing..


-Mirrodan
#17
Well the reason your wear flag is not showing up as the color you placed in act_info.c is probably because your racial files already have it set up in them, you should check that over. ../races from your src directory. If it does delete those lines and it will use the code instead of override it with the racial ones. Hope that helps.