/dmp_reader version 2.0

Specification


Usage Notes

The /dmp_reader approximates DS's map loading process in order to allow dynamic map loading. To load a map at runtime, create an instance of /dmp_reader, and then call load_map() with a .dmp file as the only argument. The /dmp_reader expands the world's maxx, maxy, and maxz settings in order to fit the new map file, and loads the map onto new z levels; it will not shrink the world.

Note that all type paths specified in the .dmp file must exist in the world's code. Also, much like DS, the /dmp_reader trusts that files to be loaded are in fact valid .dmp files. Errors in the .dmp format will cause runtime errors.

Here is an example of a test for the /dmp_reader:

    mob/verb/new_map(var/dmp_map as file)
        var/old_maxz = world.maxz
        var/dmp_reader/instance = new()
        instance.load_map(dmp_map)
        usr.z = old_maxz + 1

The 2.0 release of the reader no longer requires that redefinitions of New() include spawn() statements. The new reader introduces a preloader object, which is passed all atoms at New(), and which sets their attributes to the data stored in the dmp file. However, it is nessesary that all redefinitions of New() call the parent proc "..()". If for whatever reason you cannot call the parent proc, spawning the custom New() commands will allow the library time to do it's work, just like it used to.


Version History