[Home] [Downloads] [Search] [Help/forum]

SMAUG/ROM area to MUSH conversion

Summary

Area Editor now has a function to export an area as MUSH code.

The MUSH export function (found under the File Menu > Export > MUSHcode) is intended to allow SMAUG or ROM areas to be exported as MUSH instructions which will allow a similar set of rooms, exits, mobs and objects to be set up in a MUSH.

This has been specifically tested with PennMUSH version 1.7.2 patchlevel 12.


Scope

This function is designed to export setup instructions for:

In each case the name and description of the item is generated. Other things, like flags, MUD programs, stats and so on are ignored (many won't apply in a MUSH anyway).


Differences between MUSH and SMAUG/ROM

After using this exported code you will (hopefully) have added to your MUSH the room descriptions and exits, as mentioned above. What you will not have is a fully-operational SMAUG/ROM-style MUD. SMAUG and ROM are Diku-MUD derivatives, and as such, provides functionality such as shops, mobiles (monsters) that can be fought, doors with optional locks, and a built-in programming language that allows mobiles and rooms to do things automatically under certain circumstances.

However this export function will let you easily add a bit of colour to your MUSH by using one or more of the many SMAUG/ROM areas available on the Internet.

Bear in mind that some areas rely upon MUD programs to move players from room to room (if they meet certain criteria, for example). As such programs are not part of the exported file you may find progress blocked at such a point. In this case you would need to manually link from one room to the next, or write the equivalent MUSHcode to achieve a similar result.


Where can I find SMAUG/ROM areas?

There are 24 areas supplied as part of the SMAUG distribution. This can be obtained from: http://www.game.org

There are 53 areas supplied as part of the ROM distribution. This can be obtained from: http://www.cmc.net/~rtaylor/

Other area files are available from (at the time of writing):


A warning regarding PennMUSH throttling

There is anti-spam functionality built into PennMUSH that stops it executing large numbers of commands. After a batch of 1,000 commands from a single user, additional commands are processed at the (rather slow) rate of one per second. To avoid this, break up the generated mushcode file into smaller files, if necessary, so that each file is less than 1,000 lines long.


How to use the MUSH export function

Important! BACK UP YOUR DATABASE! If something goes wrong during the import process (sending the MUSHcode to your MUSH) it will be very tedious to manually delete hundreds of rooms and exits.

  1. Load the appropriate area into Area Editor.
  2. Select File > Export > MUSHcode.
  3. Choose an appropriate filename for the exported area file (or accept the default name).
  4. When the export is complete you will see a dialog box telling you how many rooms, exits, mobiles and objects were exported.
  5. Save your MUSH database (enter: @dump)
  6. Backup your database (copy the output database to a different file name)
  7. If the exported mushcode file exceeds 1,000 lines use a text editor to break it up into manageable chunks (eg. 500 lines each).
  8. Using a suitable client program (MUSHclient is recommended) send the mushcode file (or files, if you have broken a large file into chunks) to the MUSH. With MUSHclient use the Game > Send File function.
  9. After sending each chunk, scroll back through the output buffer of your client program and check that there were no error messages.
  10. If there were major error messages, shutdown your MUSH, restore you database from the backup, and restart the MUSH.
  11. After running the mushcode you should have in your inventory an object called DBHOLDER which is a placeholder which stores the relationship between room vnums and database numbers. You can use this to work out which db number each room is. (ie. "examine dbholder") Try teleporting to one of the new rooms and checking that the descriptions and exits are correct. To find the db number for a specific room, enter its vnum like this:
    
    examine dbholder/room10410
    

    You will see something like this:

    
    ROOM10410 [#3]: #435
    

    Thus, room 10410 in the SMAUG/ROM area is database number #435 in the MUSH.

  12. Link the newly generated rooms to your existing MUSH. Normally the first room in an area is a "starting point", so if you link an existing MUSH room to that room, you will probably find that most other rooms are accessible. I suggest doing a trial walkthrough to check this out.

Warning regarding multiple dbholders

The generated code makes use of an object called DBHOLDER to track the relationship between SMAUG/ROM vnums and MUSH database numbers. This is necessary so that exits can be linked to the correct rooms. If you run multiple imports of mushcode, make sure you delete (or rename) old DBHOLDER objects. The import function will not work correctly if you have two or more DBHOLDERs.

Also, the mushcode relies on side-effects being enabled. This is a MUSH compilation option.

It is:


#define FUNCTION_SIDE_EFFECTS

in options.h

If this is not enabled, then the import will not work, as the functions create(), link() etc. will not work.


Example of converted area

If you don't have Windows, or don't want to download Area Editor, I have converted an example area to show the idea. This is the town of New Darkhaven, a town of 257 rooms, 544 exits, 71 mobiles (monsters) and 12 objects. This is available from:

http://www.gammon.com.au/files/areaeditor/darkhavendb.zip (Windows ZIP format)

http://www.gammon.com.au/files/areaeditor/darkhaven.db (straight text for Unix users)

If you want the mushcode that actually adds these rooms to your existing database, download:

http://www.gammon.com.au/files/areaeditor/mushcode.txt


A couple of rooms viewed in the SMAUG server:


Darkhaven Square
You are standing within the expanse of the famous Darkhaven Square.  A
stone statue of occupies the square's center, surrounded by gardens of
shrubbery which enhance the air of serenity and peace here in the center
of the city.  The main road lead away in the cardinal directions, while
to the northeast and northwest are forested paths.  The spires of a
cathedral can be seen rising to the northwest.
Exits: north east south west up northeast northwest.

> north
Vertic Avenue
Here the roadway passes by a circular platform, atop which stands a man of
ultimately stern countenance.  A wall surrounding the cathedral rises to
the west, and a small forested area lines the eastern roadway.  Vertic
Avenue ranges to the north and south.
Exits: north south.
A executioner stands silently before you.
The Executioner is shrouded in flowing shadow and light.

The same rooms viewed in the MUSH server, after conversion:


Darkhaven Square
You are standing within the expanse of the famous Darkhaven Square. A stone
statue of occupies the square's center, surrounded by gardens of shrubbery
which enhance the air of serenity and peace here in the center of the city.
The main road lead away in the cardinal directions, while to the northeast and
northwest are forested paths. The spires of a cathedral can be seen rising to
the northwest.
Obvious exits:
Northwest  Northeast  Up  West  South  East  North

north

Vertic Avenue
Here the roadway passes by a circular platform, atop which stands a man of
ultimately stern countenance. A wall surrounding the cathedral rises to the
west, and a small forested area lines the eastern roadway. Vertic Avenue
ranges to the north and south.

Contents:
A executioner stands silently before you.
Obvious exits:
South  North

[Previous] [Next] [Back] [Home]
Written by Nick Gammon - 5K

Comments to Gammon Software support

[Best viewed with any browser - 2K]    Internet Contents Rating Association (ICRA) - 2K    [Web site powered by FutureQuest.Net]

Page updated on Wednesday, 15 December 2004