
01-15-2007, 04:07 PM
|
|
Graal Administration
|
Join Date: Jan 2000
Location: Admins
Posts: 11,693
|
|
|
The way it is done on Kingdoms is to separate each part of the mudlib and use the best way to implement it:
- The items are some kind of TStaticVar, real objects, using normal variable names
- When saving or loading you can write your own function to make the file look good (separate file for each player)
- For displaying the items on clientside you write a function which takes the visible items and useful item attributes (e.g. name, icon) and set some client. strings; this function is called each time an item is changed or modiified
- For being able to communicate between server and client you assign each object you create an unique id which only works as long as the server is up (should not be saved) (client.mud_item123 on clientside, player.items[0].id==123 on serverside)
- The available item types are stored in archetypes; when saving an item of the player then you only save the differences between the current item and the original archetype to minimize the file size and to make it possible to change the archetype without changing each player item file (changing the icon of the archetype will change the icon for all item instances in players inventories except for items that got an unique icon (icon has been changed))
It would probably be good if there would be some item system which can be used on each server, I have not checked yet the zip that has been attached though. |
|
|
|