Mysterious Wearloc issues

Posted by Dralnu on Wed 04 May 2005 08:59 PM — 8 posts, 33,352 views.

USA #0
I added three wearlocs (sheath, float, and over shoulder), changed the names of some of the previous wearlocs (fingers, ankles, wrist) to add in left and right. I modified everything I should have, I'm sure, but in the game I still get
<worn on finger>
<worn on finger>
<worn on wrist>
<worn on wrist>
I modified act_info and the list there, the race files have no wearlocs, nor do classes. Help?
Amended on Wed 04 May 2005 09:00 PM by Dralnu
USA #1
Also, I added the flags to build.c, and you cann't add the new wearlocs to anything, either...
USA #2
For future refrence, anyone using Windows with Cygwin to compile, don't copy the smaug.exe. Instead, as Nick's FAQ says, from Smaug/area

../src/smaug &

That will help because the whole thing won't change on remake.
#3
the where_location array that contains wear_loc strings for show_char_to_char and do_eq is connected to the wear_loc enumeration in mud.h

IE: typedef enum {..., wear_holster=25, ...};

is connected to the where_location array.
so where_location[25] should hopefully be "<holster>"

As for the wear_flag, in build.c...

w_flag[x] is used as 1 << x...
so if w_flag[8] = "holster", then 1 << 8 is my holster BV, and in mud.h I need to have my ITEM_HOLSTER wear flag set as BV08

#define ITEM_HOLSTER BV08

I assume you're not using extended bitvectors...

Once you have this, you need to modify wear_obj to know how to handle your ITEM_HOLSTER wear flag, and depending on how different this piece of equipment is, you might just be able to copy an already existant segment from wear_obj and modify it to your desire.

I hope this was helpful.
USA #4
Not really, and it was really late. Only thing with wearlocs I might deal with now is an actual use for sheaths, and I think I know where to get that kind of thing
USA #5
Quote:

Not really, and it was really late.


Heh. And people wonder how they earn the moniker of "ingrate".
USA #6
Sorry to dredge this up, but I have questions on this.

Quote:

the where_location array that contains wear_loc strings for show_char_to_char and do_eq is connected to the wear_loc enumeration in mud.h

IE: typedef enum {..., wear_holster=25, ...};

is connected to the where_location array.
so where_location[25] should hopefully be "<holster>"

As for the wear_flag, in build.c...

w_flag[x] is used as 1 << x...
so if w_flag[8] = "holster", then 1 << 8 is my holster BV, and in mud.h I need to have my ITEM_HOLSTER wear flag set as BV08

#define ITEM_HOLSTER BV08

I assume you're not using extended bitvectors...

Once you have this, you need to modify wear_obj to know how to handle your ITEM_HOLSTER wear flag, and depending on how different this piece of equipment is, you might just be able to copy an already existant segment from wear_obj and modify it to your desire.

I hope this was helpful.


What's the difference between w_flags and item_w_flags?

w_flags correspond to ITEM_WEAR_loc and item_w_flags correspond to wear_locations in mud.h? Then you have to have your where_name in act_info to match up exactly to wear_locations in mud.h correct?
USA #7
Ok, so i believe I've figured it all out. But now the only problem is in the writing of the race file. Whenever a new wear location or if I switch the locations around for a better top down list, it doesn't change in the race files. Whenever I load the game, it doesn't delete the old wherenames in the race file and rewrite the new list.


            if( !str_cmp( word, "WhereName" ) )
            {
               if( ra < 0 || ra >= MAX_RACE )
               {
                  char *tmp;

                  bug( "%s: Title -- race bad/not found (%d)", __FUNCTION__, ra );
                  tmp = fread_string_nohash( fp );
                  DISPOSE( tmp );
                  tmp = fread_string_nohash( fp );
                  DISPOSE( tmp );
               }
               else if( wear < MAX_WHERE_NAME )
               {
                  DISPOSE( race->where_name[wear] );
                  race->where_name[wear] = fread_string_nohash( fp );
                  ++wear;
               }
               else
                  bug( "load_race_file: Too many where_names" );
               fMatch = TRUE;
               break;
            }
 


So I open up one of my race files and it has the old where locations in it. I load up the game and then open up the race file and the wear locations are the same. The only time I can make the changes is when I go into the race file and manually delete the wherenames before I load the game up. Anyone else have this problem? Is there a fix to it? I believe this has been a problem since 1.4 FUSS, I believe. I know I've had the problem in the past with the update wherenames not showing up.