A couple of things you may have overlooked:

Your object is set to have the wear_new bit, yes?  I will assume it is, you 
don't seem to be
that daft. :)

There's a big function in act_obj.c called wear_obj.  Let's look at an example 
of a block of
code inside of it:

    if (CAN_WEAR (obj, ITEM_WEAR_BODY))
    {
        if (!remove_obj (ch, WEAR_BODY, fReplace))
            return;
        act ("$n wears $p on $s torso.", ch, obj, NULL, TO_ROOM);
        act ("You wear $p on your torso.", ch, obj, NULL, TO_CHAR);
        equip_char (ch, obj, WEAR_BODY);
        return;
    }

Each item type has its own block like this--every-single-one.  If this is what 
you are seeing:
"You can't wear, wield, or hold that."

Then this is probably where you are running into issues.  The aforementioned 
line is sprung with
this condition:
    if (fReplace)
        send_to_char ("You can't wear, wield, or hold that.\n\r", ch);

And then the function terminates.

You'll need to add a block before fReplace, something like this:

    if (CAN_WEAR (obj, ITEM_WEAR_NEW))
    {
        if (!remove_obj (ch, WEAR_NEW, fReplace))
            return;
        act ("$n starts using $p.", ch, obj, NULL, TO_ROOM);
        act ("You heft $p for use.", ch, obj, NULL,
             TO_CHAR);
        equip_char (ch, obj, WEAR_NEW);
        return;
    }

Hopefully that should resolve your issue.

-- Jeremy

P.S. It is oftentimes easier to resolve an issue--much less time intensive, for 
one--to look
through the code and trace what is happening.  For example, in your case, 'wear 
<object>' is not
working properly.  Hmm.  Start at do_wear.  There you'll notice a function call 
wear_obj (ch,
obj, FALSE);.  Okay, let's trace it into wear_obj.  Hmm, each item type has its 
own bundle of
code, and each has a couple different functions/macros in them--CAN_WEAR(), 
remove_obj(),
get_eq_char, etc.  So if the above--adding a new block of code for the new item 
type--doesn't
work, you may have to further trace through these macros and functions to see 
how they in turn
work to find the error.

I heartily recommend an editor called "UltraEdit-32"-- you can search through 
the entire \src\
directory (it is called 'Find In Files') and find all instances of 'wear_obj' 
(etc) and simply
double click on an entry to pull up the file to that position.  Very handy, 
especially for
tracing function calls.  In addition, you can search through the code based on 
feedback the MUD
is giving you--'You can't wear, wield.." and find what function that statement 
is in and work
backwards from there.


----- Original Message ----- 
From: "Jesse Boulianne" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Monday, October 20, 2003 11:36 PM
Subject: Adding Wear Locations


> Hrm...
>
> I've looked all over the place for a how-to for adding new ear locations,
> but have come up empty-handed everywhere.  Even at Russ' site, where the
> "official FAQ" resides, there's no answer.
>
> I think I've done everything that I had to do for adding in the new
> location, but even after a clean compile I end up with the location not
> existing.
>
> This is what I've done so far:
>
> In merc.h in the section used by #OBJECTS.
> #define ITEM_WEAR_NEW    (R)
>
> in the section used by #RESETS:
> #define WEAR_NEW                19
> #define MAX_WEAR                20
>
>
> In act_info.c in const where_name:
> "<floating nearby>    ",
> "<new location>        ",
> };
>
> In handler.c in *wear_bit_name:
>
> if (wear_flags & ITEM_WEAR_NEW ) strcat(buf, " new");
>
> In apply_ac:
>
> case WEAR_NEW:    return    obj->value[type];
>
> IN olc_act.c in struct wear_type wear_table[]
>
> {    WEAR_NEW,    ITEM_WEAR_NEW    },
>
> IN tables.c in struct flag_type wear_flags[]:
>
> {    "new",        ITEM_WEAR_NEW,        TRUE },
>
> in flag_type wear_loc_strings[]:
>
> { "as a new spot",    WEAR_NEW,    TRUE    },
> { NULL,    0,    0    }
> };
>
> in struct flag_type wear_loc_flags[]:
>
> { "new",    WEAR_NEW,    TRUE    },
> { NULL,    0,    0    }
> };
>
>
>
> I've made sure that in every table, the new wear location has been inserted
> in accordance to it's position in the defines of merc.h.  The new position
> comes after floating, and so it was placed into each struct, after floating.
>
> I must have missed something here.  Can someone help me out please?  I've
> tried everything I can think of to get it to work.  Heck, I even thought I'd
> forgotten to increase MAX_WEAR (which I hadn't).
>
> Thanks in advance.
>
> Jesse
>
> PS.  Is there a reason why the offical FAQ no longer contains instructions
> on how to do this?
>
>
> -- 
> ROM mailing list
> [email protected]
> http://www.rom.org/cgi-bin/mailman/listinfo/rom
>


Reply via email to