TWiki Home Tharsis . Design . SaveAbility (r1.1 vs. r1.2) Tharsis webs:
Design | Guilds | Combat | Website
Design . { Home | Changes | Index | Search | Go }
 <<O>>  Difference Topic SaveAbility (r1.2 - 18 Jul 2003 - FantoM)

To address the limitation of being unable to save blueprint objects:

An alternative would be to save inventory objects to a filename pattern of [base] + '.' + [position-in-inventory]

Base of course might include several other .[position] parts when you start to get containers in containers.

This addresses the issue of handling blueprint objects as well as cloned objects in inventories.

-- FantoM - 18 Jul 2003

Presume that every savable object has a method with prototype save(string filename)

When an object is saved this method is first called with a parameter of basedir + canonical_form(file_name(the_object))

This object then saves itself and calls the save method for each object in it's inventory, passing filename + "." + index_in_inventory

Presume now that objects not in the inventory but which should be saved with the object register themselves with the object.

They can be saved now by passing filename + "." + (size_of_inventory + index_in_externalobjects)

This addresses the issue of external objects.

-- FantoM - 18 Jul 2003

 <<O>>  Difference Topic SaveAbility (r1.1 - 18 Jul 2003 - PumaN)

%META:TOPICINFO{author="PumaN" date="1058517900" format="1.0" version="1.1"}% %META:TOPICPARENT{name="MudLib"}% The ability to do a complete save of anything, possibly extending to the main-method of saving/editing rooms.

Overview of methods:

  • Each base item (rooms, players, daemons and similar) defines somewhere it will be saved
    • for areas this could be a subdir in each roomdir, or a dir on its own in each domain.
  • Each object defines (using a flag) whether it wants to save its inventory in a subdir equal to its own name (good for players) or in the same dir as the savefile
  • All other items must come as the inventory of the base-item
  • Saved inventory is saved as savefile + clonenumber of saved inventory-item
    • recursive inventory are saved as savefile + clonenumber + clonenumber + ...
  • The clone number is stored in appropriate location in the base item before the base-item is saved
    • Where the location of the object is otherwise held is a good spot for clonenumbers, thus relation mapping for regular items


  • This means only cloned items (since we use the clonenumber) will be allowed to be inside rooms, and that cloned base-items must have an external method for saving themselves (like players and rooms in grids defined by daemons (meaning the daemon is saved with the clones as it's inventory))
  • External objects, like effects for example, will need to create their own savemethod, since they are cloned objects, but are not actually in the inventory of the object (but can otherwise be saved using the same method).

-- PumaN - 18 Jul 2003

Topic SaveAbility . { View | Diffs | r1.2 | > | r1.1 | More }
Revision r1.1 - 18 Jul 2003 - 08:45 GMT - PumaN
Revision r1.2 - 18 Jul 2003 - 12:17 GMT - FantoM
Copyright © 2001 by the contributing authors. All material on this collaboration tool is the property of the contributing authors.
Ideas, requests, problems regarding Tharsis? Send feedback.