Re: re-stringing objs

From: Patrick Dughi (dughi@imaxx.net)
Date: 01/12/99


> I have obuild in as my OLC, and some home made ascii rent files.  I am
> looking into allowing restrung objects.  Has anyone modified obuild to
> allow this?  Before I jump in can anyone offer any pointers or ideas?

        I dislike the term 'restring', since frankly, changing the
strings is only one thing you can do, and changing the stats is as simple,
if not moreso. I like 'unique objects' :).  Semantics really.

        The xapobj patches which are floating around at the particular
sites (are not quite 100% working.. they're just evaluation patches)
include the ability to make unique items by simply setting the flag
'unique item'.  As an example, mail is set ITEM_UNIQUE_SAVE and thus, we
have mail saving.  Though my patch doesn't optimize space (ie,
save-only-name list or save-only-obj-values), it turns out that its doing
pretty good anyway - since very few objects are unique (mail, enchanted
objects, and thats about it in stock), the size of rent files is usually
at the least, quartered (all it needs to save is 6 integers for rent,
number of item, and a few others like that for rent cost, etc).

        The rest references my code;

> to your obcircle:  I think the hardest part would be altering the obj
> saving code to only save the string when it is different.

        SET_BIT(OBJ_EXTRA(obj),ITEM_UNIQUE_SAVE); or something like that.
        Takes a fifth of a second. ;)

>  Then change
> the obj load code to override the obj strings if the tag is present for
> a different string.  I don't think obuild is where you want to look for
> restringing objs.  I would have sworn there was a stub that does the
> restringing in the code that is there but not impd... just cant find it
> right now.  All you need is a command that has the following syntax:
> restring <obj> <field> <string>
> ex: restring hammer ldesc The glowing hammer.
> (can you tell I don't build?)
> have the function do this:

        Didn't write these functions.  I assume anyone can make a command
that alters the stats of any original object and then you set the unique
bit, and forget about it. If you're stuck, just use the settings in db.c
Why not just copy oasis's oedit so it targets a specific object, and
you're okay..

  This is actually what the original oasis did, if I remember right.

>
> I have a flag that will not update things upon reentry into the mud,
> but I haven't figured out exactly where ALL of the objects get updated in
> obuild, and haven't finished digging through the code.

        I didn't realize things got updated upon reentry.  Doesn't happen
to me.  I'd guess that if you were to have oasis or whatever, which alters
all existing copys of the prototype each time you alter the prototype, you
could just throw in a check for 'if(IS_SET(OBJ_EXTRA(obj),ITEM_UNIQUE_SAVE))...
and if so, disregard it...

                                                PjD

* Boy, I love tooting my own horn :) *



     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html  |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/15/00 PST