Mud Mapper

The mud mapper is a window application that allows rooms of an SWLPC mud to be positioned, edited and linked. There is also the facility to translate an SWLPC muds rooms and monsters into a Circlemud or Smaugfuss mud.

files/mudmapper700.jpg

The mud mapper works from a 2D image that has the dimensions of the mud (3d space) and colors representing what is at the room eg cyan for a town.

files/mudmappersanom.jpg

Using the spy glass buttons shown above it is possible to zoom in and out of the map. It is also possible to use the trackbars to scroll to different parts of the mud map.

Loading a room
By clicking on the room in the mud map (ie one of the red dots) the rooms swlpc script will be displayed in the right hand panel. For example:

files/mudmapperscript.jpg

Editing a room
After you've loaded a room you can edit the script and then save it by clicking on the save button shown in the picture above.

Moving a room
You can move the room position by right clicking the room you want to move then click on 'set x,y'

files/mudmappermoveroom.jpg

This will bring up a dialog that lets you change the x,y position.

While in god mode you can walk around in the mud client and press 'ctrl p' to put the mud coordinates into the clipboard. To copy the coordinates of the clipboard into the 'set xy' dialog you can click 'Set from clipboard' and the x,y coordinates from the clipboard will be copied. This might be useful if you walk to the centre of a restaurant in the mud client and want to use this as the room centre in the mud.

Creating a new room
To create a new room its a good idea to click on a room that is similar to the room you want to create and then edit that. Eg if you are creating a second butcher click on the first butcher to load up the butcher script. Next right click on mud map where you want the new room to go:

files/mudmappernewroom6.jpg

Then click new room and this will change the coordinates in your room script to set_xy(-1,-1);

It is a good idea to clear the exits in the script you are copying eg if you have something like:

set_dest_dir ( ({
"room/sanom/cordoth256.000,295.000,0","south"
}));

it should become:

set_dest_dir ( ({
}));

This will stop the new room having the links of the room you copied.

Once you have positioned the new room you can save it by clicking the save button above the script list box. set_xy in the script should change from set_xy(-1,-1); to the new coordinates where you set the new room eg set_xy(300.1,202.2);

You will now have a room that is something like:

files/mudmappernewroom2.jpg

Linking a room
The newly created room described above is an unlinked room that is not reachable by any players. To link this room to the room north of it right click on the new room and select 'Add to list'. You should see a white cross appear over the new room:

files/mudmappernewroom3.jpg

Now do the same to the room north of it:

files/mudmappernewroom4.jpg

This has put two rooms into a room list. There is a list of a operations that can be performed on a list of rooms that appear in the 'list' menu. The 'list' menu becomes enabled only after you have a room in the room list. One of the menu items in 'list' menu is 'Autolink rooms in list'. Click on this menu item and the two rooms will be linked:

files/mudmappernewroom5.jpg

If you click on the new room in the mud map the script will have changed from:

set_dest_dir ( ({
}));

to something like:

set_dest_dir ( ({
"room/sanom/soupkitchen258.100,294.030,0","north"
}));

This means that the mud mapper has created a link to the northern room. Likewise the northern room will have an extra exit in 'set_dest_dir' going south to the new room.

Uploading your new room to the mud
If you are using the mud mapper for the first time you will be working on the sanom town of by default. These rooms will be located in your

c:\program files\mudclient\mudmapper\mlib\room\sanom

directory.

But your live mud might be on

k:\swlpc-2.0.6\mlib\room\sanom

Thus for the room you just linked in 'Linking a Room' to be available in your mud you'll have upload your local rooms to your live mud. This can be done in the mud mapper by setting the 'Live Room Dir' to the directory of your sanom directory on your mud. For example in the screenshot below it has been set to

k:\swlpc-2.0.6\mlib\room\sanom

where k is the network drive to your Linux machine running SWLPC.

files/mudmappercopyover.jpg

When you click on the 'Copy All to Live' button all the rooms in your local directory will be copied to the mud directory. The old rooms will be put in a backup directory in the directory:

k:\swlpc-2.0.6\mlib\room\sanom\backup

To copy individual local rooms to your live mud you can put the rooms into a room list (ie with white crosses in the linking example) and then in the 'list' menu click on 'Copy list to dir'. This will copy just the selected rooms to your mud instead of everything if you clicked on the 'Copy All to Live' button.

Different Towns
In Shattered World different towns and the terrain are divided into different directories. For example all Sanom rooms are located in the directory 'c:\program files\mudclient\mudmapper\mlib\room\sanom' (k:\swlpc-2.0.6\mlib\room\sanom if K is Linux) and all sengoku rooms are in 'c:\program files\mudclient\mudmapper\mlib\room\sengoku'. Every directory can have its own ini file that holds the zoom, x, y position of scroll bars, mud map etc so that every time you load say 'sanom.ini' or 'sengoku.ini' the scroll and zoom, world map are set and you have to set the scrolls and zoom every time you run the mud mapper. These ini files are located in the c:\program files\mudclient\mudmapper\mlib\ and can be opened by going to the 'open config' in the 'file' menu and opening it. Thus if you open the 'sengoku.ini' file you might see something like this:

files/mudmappersengoku2.jpg

To save your own config file click on the 'save config' menu item in the 'file' and save it.

Linking rooms of different towns
Notice in the screenshot above the red arrow. The cyan dot indicates a link to a room that doesnt exist in the sengoku folder. If you click on the room west of the cyan dot (room room/sengoku/road285.000,250.000,0) you will see 'set_dest_dir's eastern link is to a shatterrain (Shattered World terrain) folder:

set_dest_dir ( ({
"room/sengoku/generalstore285.000,249.000,0","south",
"room/sengoku/road284.000,250.000,0","west",
"room/shatterrain/field286.338,249.928,0","east"
}));

This provides the link from Sengoku to the terrain. The terrain in turn links back to Sengoku. The way to do links between folders is to copy the room name into the clipboard eg 'room/sengoku/road285.000,250.000,0' in the 'goto alias' edit box. Then load the shatterrain.ini (open config) ini file and move the scroll bars and zoom to Sengoku such as:

files/mudmappersengoku4.jpg

You would then create a western link from the room 'room/shatterrain/field286.338,249.928,0' to 'room/sengoku/road285.000,250.000,0' in the 'set_dest_dir' function:

set_dest_dir ( ({
"room/shatterrain/beach288.628,246.738,0","southeast",
"room/shatterrain/field286.394,246.689,0","south",
"room/shatterrain/beach288.237,252.315,0","northeast",
"room/shatterrain/beach288.383,249.916,0","east",
"room/shatterrain/field286.114,252.217,0","north",
"room/sengoku/road285.000,250.000,0","west"
}));

Likewise you would copy this room (room/shatterrain/field286.338,249.928,0') into the 'room/sengoku/road285.000,250.000,0' room to make an eastern link.

How to make doors
As mentioned in the rooms document a player can walk through room exits by moving a certain distance from the room centre. For example walking a certain distance east will make a player go though the eastern exit. Another way to walk through room exits is to use doorways where if a player walks through a certain point in the room it will be considered an exit. For example if the room centre is x= 200,y= 300 and room doorway is x=200.5,y=300 and a player walks through this point it is considered an eastern exit. Doorways are useful for irregular shaped rooms where a simple eastern line past the room centre doesn't provide the correct eastern exit. This matter is discussed more thoroughly in the rooms document.

In SWLPC a door is specified with the 'set_doorxy' function. For example 'set_doorxy("east",200.5,300,0.3)' puts an eastern doorway is a point 200.5,300. If the player walks through this point +/ mud units 0.15 in the y direction then it is considered that he has moved through the eastern exit.

To position doorways you can walk to an exit the mud client. An example is the doorway below:

files/doorway.jpg

You can then type 'ctrl p' that will put the mud coordinates into the clipboard. Then in the mud mapper you can create a 'set_doorxy' function in the room with the door and then paste the coordinates into the function. For example if the clipboard coordinates is 200.58,300.07 then paste it as:

set_doorxy("east", 200.58,300.07);

Thus the script might become something like:


set_dest_dir ( ({
"room/sanom/cordoth201.2,300.0,0","east" // eastern exit
}));
set_xy(200.5,300.0)); // room centre
set_doorxy("east",200.58,300.07); // eastern doorway

Exporting to Smaugfuss and Circlemud
The mud mapper can convert the SWLPC mud into a smaugfuss and circlemud mud. Only rooms and monsters are translated. Any specialized scripting of monsters and rooms in SWLPC is ignored. For example if you have an SWLPC script that makes a monster fart if its raining then this script will not be present in the smaugfuss or circlemud. The monster should be present though.

The way to create a circlemud for the current folder you are in (eg sanom) is to click on the 'Generate Circle mud' menu item under the 'file' menu. You will then be asked the zone number and if zone 327 is selected it will then generate 327.zon, 327.mob and 327.wld files in the same directory as the mud mapper. These can then be copied into the area directory of your circle mud.

Likewise to generate a smaugfuss mud click on the 'Generate Smaug mud' menu item to generate an area file. Enter the starting room number (eg 9500) and the filename of the area file. Again it will put the file in the same directory as the mud mapper and you can copy the file to your smaug mud area directory.

Room commands - Right Click


To perform an action on a single room you can right click on it. For example to create a new room.

files/mudmappernewroom6.jpg

The section lists all the of actions that can be performed on a room when you right click on it:

New room
Create a new room at position have right clicked. Wont be saved until you click on the save button. It will save whatever is in the contents of the script edit box.

Edit room
Allows you to edit the room you have clicked on. Isnt necessary since you can edit a script you click on automatically anyway.

Break link to room
Will break a link to the room specified in the sub menu eg break the eastern link.

Move room
Will move currently selected room to the position have right clicked on.

Add to list
Will add the selected room to the room list. Room lists are discussed next.

Delete from list
Delete this room from the room list.

Set x,y
Change they position of the room by entering the coordinate by hand or from the clip board.

Room List Commands


As described previously you can use room lists to link rooms together. When you right click on a room you are operating on a single room while with room lists you are operating on a list of rooms. As mentioned to add a room to the room list right click on it and select 'add to list' and 'delete from list' to remove it.

The following describes the commands in the 'List Selection' menu. These are related to selecting rooms to put into the room list:

Every room in selection
Will put every room into the room list.

All visible rooms in selection
Will put every room that can be seen in the mud map into the room list.

Select Starting with filename
Will select every room starting with a certain filename. For example you can select all the butchers by entering 'butcher'.

Display vector list
List the coordinates of all the rooms in the room list.

Remove all room selections
Remove all rooms from the rooms list

The follow is the actions that can be performed on a list of rooms. They are located in the 'list' menu:

Shift
Shift the rooms 1 unit in a certain direction. For example north.

Scale
Scale the rooms by a factor. For example if you enter 1.1 and the x coordinate of the room is 100.0 it will become 110.0.

Align rooms in list keeping x the same
Allows rooms in the list to be aligned into a straight line. Here the 'y' coordinate it changed to make the alignment while x stays as it was originally.

Align rooms in list with even spacing
As above except the rooms are evenly spaced along the line.

Autolink rooms in list
Link all rooms in list but only those that are close to the room. Thus if you have 5 rooms in a straight line the first will link to the second, the second to the third etc. But there will be no links say from the first to the fifth.

Autolink rooms in list with leeway
Same as above except it will add a second link to the next best exit. For example if the best link between room 1 and room 2 is north and the second best link is north east then it will create two links with one being north and the other northeast both going to the same room.

Autolink everything in list
Different to 'autolink rooms in list' in that mud mapper will attempt to link every room in the list. Thus if you have four rooms in the list then room 1 will attempt to link to room 2, room 3 and room 4 and likewise room 2 will attempt to link to room 1, 3 and 4.

Break all links in list
Breaks every link between rooms in the list leaving them with no links at all.

Break links between rooms
Breaks links between rooms but only between those in the list.

Make all coords match filename in list
As mentioned in rooms the filename of a room has the x,y,z coordinates of the room in it. For example butcher333.2,202.2,0. The coordinate of the room is specified in the room script as set_xy(332.2,202.2,0);. The command 'Make all coords match filename in list' will make the coordinates in set_xy match those in the filename.

Copy list to dir
Copy the rooms in the room list to the live mud directory. Only does so if 'Live Room Dir' has been set. Eg k:\swlpc-2.0.6\mlib\room\sanom.

Copy from dir to local
Copy rooms matching the name in your live mud directory to your local directory.

Find replace
Find a string in the rooms scripts and replace it. For example it is possible to change 'set_xy' to 'set_posxy'

Find insert after
As above except instead of replacing the found string it will insert a new line after the found string and put the new string in the new line. For example after the 'set_xy' function you could insert the line 'set_sound("crowd");'

Delete all rooms in list
Delete rooms in list

Move rooms to new dir
Move all the rooms to a new directory. Will also change the paths in the script. Eg if

set_dest_dir ( ({
"room/sanom/cordoth200.7,330.2,0","east" // eastern exit
}));

and the new dir is 'sengoku' then will become:

set_dest_dir ( ({
"room/sengoku/cordoth200.7,330.2,0","east" // eastern exit
}));

Likewise for the filename of the script.

Repair
Will fix some commonly found errors in the script such as

set_dest_dir ( ({
"room/sengoku/cordoth200.7,330.2,0","east" , // eastern exit
}));

will become:

set_dest_dir ( ({
"room/sengoku/cordoth200.7,330.2,0","east" // eastern exit
}));

Rename all in list
Change the room name of all the rooms in the list. Eg change restauraunt200.7,330.2,0 to inn200.7,330.2,0.

Main Form commands

The following is a list of the meanings of commands and boxes on the main form of the mud mapper. The following are meanings related to the top of the mud mapper as shown in the following screenshot:

files/mudmapperguitop.jpg

Map
The filename of the image in the mud map. Click the 'reload' button to redraw it if you have modified it in an external application.

Local mlib dir
The root directory of your local mudlib eg c:\program files\mudclient\mudmapper\mlib

Local room dir
Directory of your local copies of room scripts such as sanom

Live room dir
Directory of your live room scripts on your Linux machine that is running swlpc.

Copy all to live
Copy everything local to your Linux machine running SWLPC specified on in 'Live Room Dir'.

Copy all to local from live
Reverse of above. Everything copied from your mud to your local dirirectory.

The following descriptions are based upon the mid section of the mud mapper:

files/mudmappergui2.jpg
Goto alias
Provides a useful SWLPC alias command that you can use to allow you to type say 'beach' into the mud and you will jump to that location.

Editing room with coords
The x,y coordinates of the room you are editing

Room filename
The filename of the room you are editing

Mouse pos
Position of the mouse on the mud map

Image pos
Position of the mouse on the mup map in image coordinates. In image coordinates 0 is the top of the image while mud coordinates 0 is the bottom of the image

Mud pos
Mud coordinates of where mouse clicks on the mud map

Mud color
Color where clicked. Is using the index of the tga file if index tga used ie 0-255 index