If you want to allow others to make maps for your game, but don't have a custom map editor, you might be tempted to give them the entire source code. However, a mapper only needs a small subset of your code to create maps for your game: the basic visual data of your mappable turfs, objs, and mobs.
This library allows you to extract all of the data for your mappable atoms and create a separate project just for your mappers in as little as a single line of code:
var/MapDataExtractor/mde = new/MapDataExtractor()
The default settings will analyze your project to automatically extract any atoms that have been used in included map files, and will exclude any types listed in the project's Object Tree Hidden Paths preference. You can also specify your own list of types to include and/or exclude.
The generated project contains only a single DM code file--which holds just the visual data of the included atoms--and a precompiled RSC file.
////////////////////////
// //
// MAP DATA EXTRACTOR //
// VERSION 1.0 //
// //
// BY //
// DARKCAMPAINGER //
// //
// REFERENCE FILE //
// //
////////////////////////
//
// > Extract mapping data and generate mapping project
//
var/MapDataExtractor/mde = new/MapDataExtractor(whitelist, blacklist, projectName)
//
// > Arguments:
//
// - whitelist: List of atom paths to include in generated map data.
// (children of the supplied paths ARE also included)
// If null, parse included map files for paths.
// (children of the located paths are NOT included)
// If list passed but first entry is null, parse included
// map files for paths and append to end of list.
//
// - blacklist: List of atom paths to exclude from generated map data.
// (children of the supplied paths ARE also excluded)
// If null, parse project preferences for 'HIDDENPATHS' paths.
// (children of the located paths ARE also excluded)
// If list passed but first entry is null, parse project
// preferences for hidden paths and append to end of list.
//
// - projectName: Text to use as the name for the generated project / directory
// (Do *NOT* set to an existing folder, as it will be DELETED!)
//
// > Action:
//
// Remove any paths from whitelist that are in blacklist. Extract the visual data
// for the remaining paths and their parent paths. In the [projectName]
// directory: generate a DM code file containing the visual data, create a
// DME environment file, and copy over the existing RSC file.
Update History:
- Version 1.0 (July 3rd, 2012)
- Initial release
Just investigated your library again and I know circumstances when it won't work. For example try to place this mob on your demo's map:
If you do this, your library won't ever finish and will just stop at line:
As a result, MDE_Map_Project folder and the new .dm file won't be ever created.