Specification
- Released February 8th, 2007.
- Defines the object /dmp_writer
- Provides the public method write_dmp()
- Returns a text string of the map in dmp format
ready for output to a file.
- Provides the public method save_map()
- Returns a .dmp file if map is saved
- Returns FALSE if map fails to save
- Automatically Saves the .dmp file in the world's directory
- Note: Because of this behavior, save_map() is being phased out, it is suggested that you use write_dmp() instead.
Usage Notes
The /dmp_writer approximates DM's map saving process in order to allow dynamic map
saving. To save a map at runtime, create an instance of /dmp_writer, and then call
write_map(), which accepts three arguments:
- A turf representing one corner of a three dimensional grid (Required).
- Another turf representing the other corner of the same grid (Required).
- Any, or a combination, of several bit flags (Optional):
- DMP_IGNORE_AREAS : the writer will write all turfs as contained in world.area
- DMP_IGNORE_TURFS : grid locations will be filled with the world.turf typepath
- DMP_IGNORE_OBJS : objects will not be saved
- DMP_IGNORE_MOBS : mobs will not be saved.
- Note: DMP_IGNORE_MOBS == DMP_IGNORE_PLAYERS & DMP_IGNORE_NPCS
- DMP_IGNORE_PLAYERS : mobs with attached clients will not be saved
- DMP_IGNORE_NPCS : mobs without attached clients will not be saved
The order in which the turfs are supplied does not matter, the /dmp_writer will
determine the grid containing both, in much the same way as DM's block() function.
write_dmp() returns a text string representing the map in dmp format, which can then be
output to a file:
var/dmp_file = file("my_map.dmp")
dmp_file << write_dmp(turf1, turf2, DMP_IGNORE_PLAYERS)
Version History
- 1.4
- Released February 8th, 2007
- Fixed a bug whereby semicolons were being appended to attribute declarations where DM did not. (Android Data)
- 1.3
- Released January 25th, 2007
- Fixed a bug whereby text was being saved without quotes. (D4RK3 54B3R)
- 1.2
- Released September 21st, 2006
- Fixed a bug whereby numbers were saved as text. (D4RK3 54B3R)
- 1.1
- Released September 8th, 2006
- Added public method write_map()
- Changed save_map() so as to use write_map() internally
- Changed the demo so as to reflect the emphasis on write_dmp()
- 1.0
- Released June 21th, 2006
- save_map() now crashes if supplied invalid arguments, as this was determined to be easier to debug.
- /dmp_writer was accepted into DM.libraries
- Beta 2.2
- Released June 20th, 2006
- save_map() no longer crashes if supplied invalid arguments.
- Fixed errors in the documentation.
- Changed several lines of the demo to improve readability.
- Beta 2.1
- Released May 10th, 2006
- Fixed: Demo would generate invalid strings.
- Beta 2
- Released February 18th, 2006