[Home] [Groups] - Message: [Prev in Group] [Next in Group]

nu.kanga.list.mud-dev

12818: Re: [MUD-Dev] [CODE] unique items

[Full Header] [Plain Text]
From: Ben Greear <greearb@candelatech.com>
Newsgroups: nu.kanga.list.mud-dev
Date: Sun, 19 Mar 2000 12:45:36 -0700
References: [1] [2] [3] <-newest
Organization: Kanga.Nu
"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@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@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@kanga.nu
http://www.kanga.nu/lists/listinfo/mud-dev