AUTOLOADING OBJECTS
===================

It is possible to make objects that will stay with a player, we call them
autoloading objects since they are loaded and cloned to the player each
time he logs on. Such items should be rare but sometimes called for. Guild
items are good examples on this, coins another.

STORING THE OBJECTS
===================

To make an object autoloading all you have to do is define the function
query_auto_load() in it. The function should return the filename of the
object. The file name should end with a ':'. Typically the function could
look like:

    string
    query_auto_load()
    {
	return "/std/coins:";
    }

In the case of coins, it would be good if we saved how many coins and what
type of coins the player had too. It is possible to save these variables 
by adding text after the ':'. The ':' is there, simply to separate the
filename from the variables saved. The improved function would be:
    
    string
    query_auto_load()
    {
	return "/std/coins:" + num_heap() + "," + coin_type;
    }

RE-INITIALIZING OBJECTS
=======================

We need a way to restore these variables when the object is autoloaded
again. The function init_arg(string arg) will be called when an object is
autoloaded. The <arg> is what was put behind the ':' in query_auto_load().
So to restore the number of coins and coin types we would have init_arg()
look like this:

    public void
    init_arg(string arg)
    {
	int sum;
	string ct;

	if (sscanf(arg, "%d,%s", sum, ct) == 2)
	{
	    set_heap_size(sum);
	    set_coin_type(ct);
	}
    }

Note that the init_arg() function is only necessary if you have variables
that were stored and that you want to re-initialize again. It is not
necessary to define the function if you have nothing to initialize.

RECOVERY
========

Note that objects can survive reboots too. It's a more modern version of
autoloading objects. We call these objects recoverable. The functions to
use in this case are:

    string query_recover()
    void init_recover(string arg)

The function query_recover() and init_recover() look exactly the same as
the functions query_auto_load() and init_arg, except that they are used
for recovery rather than for autoloading objects For more information on
recovery, see 'man recover'.

AUTOLOADING AND RECOVERING: WARNING
===================================

Recovery and autoloading is mutually exclusive. An autoloading object cannot
be subject to recovery at the same time for that will multiply those objects.
If you therefore want to make an object autoloading that is recoverable by
default, like for instance a guild object that is an armour, like a belt or
a necklace, you have to disable recovery by adding the following function to
the code:

    string
    query_recover()
    {
	return 0;
    }

