cMud Map Importer
Posted: Fri Jun 17, 2011 5:47 am
This will import your map into Mudlet (it only works on the newer files, which are dbm or sqlite3. There is a tool however on zuggsoft website to convert maps to this format)
This script will only import your map, it will not provide you with a functional mapper.
To run it:
Note
You no longer need to have the sql database for this script, all information is stored in RoomUserData.
For brand new users
1)Import the map - run cmud importmap. A file dialog will open up where you can select the map.
2) To localize yourself, you need to find assign your location via the centerview(id) command. You can find room ids via getRooms(), or use getAreaTable() followed by getAreaRooms(zone #) to get a list of rooms.
For prior users
If you've used this script already, I added a few commands that will update your map, allowing you to keep your mapping additions since you first imported the map.
cmud colorRooms -- This will color your rooms, but you must have the lua package 'bit' to use it. Lua doesn't support bitwise operations natively.
cmud addFavs -- This will import the name of your favorites into your map under the UserData "Favorites". Note you need to set up your own nesting scheme if you want to have cmud-like functionality with nested labels. If enough people want this, I can provide my script and nesting structure.
cmud labelZones -- Labels your zones (useful for those who are stuck with the labels who don't respect the Z axis)
You can purge the map should you screw up with this alias, note areanames aren't redone because in the import they'll be the same anyways: cmud purgedb.
Edit:
August 28, 2019:
Minor bugfix - fixed LuaSQL include and gave map labels a reasonable size
May 21, 2018:
Minor bugfix - fixed to work with Mudlet 3.0+
May 30, 2012:
Minor bugfix -- sometimes zone was imported as nil
Jan 3:
Cmud colors imported now.
July 17:
Updated so room scripts are imported and rooms exiting to zones can be labelled. Note the labels don't respect the z axis at the moment (mudlet doesn't support it), so a label in the first floor will appear on the 3rd.
Older edits:
Updated a bug in the room script and forgot to add in the room weight code.
This script will only import your map, it will not provide you with a functional mapper.
To run it:
Note
You no longer need to have the sql database for this script, all information is stored in RoomUserData.
For brand new users
1)Import the map - run cmud importmap. A file dialog will open up where you can select the map.
2) To localize yourself, you need to find assign your location via the centerview(id) command. You can find room ids via getRooms(), or use getAreaTable() followed by getAreaRooms(zone #) to get a list of rooms.
For prior users
If you've used this script already, I added a few commands that will update your map, allowing you to keep your mapping additions since you first imported the map.
cmud colorRooms -- This will color your rooms, but you must have the lua package 'bit' to use it. Lua doesn't support bitwise operations natively.
cmud addFavs -- This will import the name of your favorites into your map under the UserData "Favorites". Note you need to set up your own nesting scheme if you want to have cmud-like functionality with nested labels. If enough people want this, I can provide my script and nesting structure.
cmud labelZones -- Labels your zones (useful for those who are stuck with the labels who don't respect the Z axis)
You can purge the map should you screw up with this alias, note areanames aren't redone because in the import they'll be the same anyways: cmud purgedb.
Edit:
August 28, 2019:
Minor bugfix - fixed LuaSQL include and gave map labels a reasonable size
May 21, 2018:
Minor bugfix - fixed to work with Mudlet 3.0+
May 30, 2012:
Minor bugfix -- sometimes zone was imported as nil
Jan 3:
Cmud colors imported now.
July 17:
Updated so room scripts are imported and rooms exiting to zones can be labelled. Note the labels don't respect the z axis at the moment (mudlet doesn't support it), so a label in the first floor will appear on the 3rd.
Older edits:
Updated a bug in the room script and forgot to add in the room weight code.