[MUD-Dev] [CODE] unique items
J C Lawrence
claw at cp.net
Tue Mar 21 12:24:53 CET 2000
On Sun, 19 Mar 2000 12:45:41 -0500
J Coleman <stormknight at alltel.net> wrote:
> 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?
The details here are going to be very dependent on your server
architecture and its data model. For any of the servers based on
DB's ala MOO/Tiny/Cold, this gets very easy as its just another
object, just like every other object except for its inheritance tree
or data contents.
If you are useing a template file derived system the DIKU
descendents, things get a little more complex if you don't constrain
your "unique" objects to being flavours of your already existent
object types (in terms of the structure and tag definitions). If
you do make that constraint, its just a matter of defining (if
needed) a new text file record format, and then reading/writing that
with the appropriate offsets (IIRC DIKU uses VNUMs are offset based
record ID's no?). If you don't make that constraint its probably
easiest to use something like XML for the storage format for your
objects, and then do all you IO via an XML parser etc. A little
messier, but not horrible, and you can use the same/similar indexing
methods as before.
--
J C Lawrence Internet: claw at kanga.nu
----------(*) Internet: coder at kanga.nu
...Honorary Member of Clan McFud -- Teamer's Avenging Monolith...
_______________________________________________
MUD-Dev mailing list
MUD-Dev at kanga.nu
http://www.kanga.nu/lists/listinfo/mud-dev
More information about the mud-dev-archive
mailing list