[MUD-Dev] [CODE] unique items

Ben Greear greearb at candelatech.com
Sun Mar 19 12:45:36 New Zealand Daylight Time 2000


"J. Coleman" wrote:
> 
> Didn't see this in the faq anywhere, and I can't seem to find any good
> implementations of it anywhere, so here goes:
> 
> Does anyone know a good way to handle unique items? I want to have
> players able to make magic items themselves, that are completely custom.
> Magic items in my game will be fairly powerful because of their rarity,
> and the fact that they must be created, and not found. Is there a good
> clean way to keep an "index" file of all magic items that have been
> created this way, and to reference player files to it perhaps? How does
> everyone else do this?
> 
>         -Justin
> 
> _______________________________________________
> MUD-Dev mailing list
> MUD-Dev at kanga.nu
> http://www.kanga.nu/lists/listinfo/mud-dev

I reference the base object (though this object may not be found 'in the game').
I then copy it in memory, so that it is a unique instance, and make whatever
changes are needed.  To save it, I write it into the pfile (player's file).
This is different from non-modified objects, which I just write as a number
(ie kind of a database ID).

At the time that I load the player into the game, I instantiate new objects
for all of the modified ones that were written out fully, and add a simple
pointer to the base object for those that are written out as numbers only
(non modified.)

That help any?

Ben

--
Ben Greear (greearb at candelatech.com)  http://scry.wanfear.com/~greear 
Author of ScryMUD:  scry.wanfear.com 4444        (Released under GPL)
http://scry.wanfear.com



_______________________________________________
MUD-Dev mailing list
MUD-Dev at kanga.nu
http://www.kanga.nu/lists/listinfo/mud-dev



More information about the MUD-Dev mailing list