← MegaMOO Guide

Rooms & Exits

Digging rooms, connecting them, and what players see as they move.

Digging a room

@dig takes a room type and an optional name:

> @dig ic = The Old Library Created room #412: The Old Library
TypeIsUse for
icIn-character roomThe world itself. This is the usual answer.
oocOut-of-character roomLobbies, help areas, staff space.
roomPlain base roomWhen you want neither of the above.

Two switches are worth knowing. @dig/types lists the available types, and @dig/tel teleports you into the new room as soon as it is made:

> @dig/tel ic = The Old Library

A new room is not attached to anything. It exists, but there is no way to walk to it until you make an exit — that is the next step, and it is where the important decision is.

Directional exits: @vopen and @open

There are two ways to make a compass exit, and they differ in a way that matters for the long-term health of your world.

@vopen — virtual, and what you should normally use

> @vopen north to #412 You created a new virtual north exit to #412:The Old Library.

A virtual exit is not an object. The connection is recorded in a property on the room itself — the destination and the movement messages, stored in a single list slot for that direction. Nothing is created, and nothing is added to the room's contents.

That is the whole advantage, and it compounds. A world built with @vopen has rooms containing only the things that are actually in them. Object numbers are not consumed by scaffolding. Listing a room's contents shows furniture and items rather than a dozen invisible exit objects, and every tool that walks the world stays fast and readable.

@vopen requires a destination

You must give it a room that already exists: @vopen north to #412. Dig the destination first, note its number, then connect. If a virtual exit already exists in that direction and points at the same room, MegaMOO says so and does nothing. If it points somewhere else, the destination is changed and you are told what it was.

@open — a real exit object

> @open north to #412 > @open south # unlinked for now

@open creates an actual exit object and puts it in the room. It can be created unlinked and connected later, and — because it is an object — it can carry properties and its own behaviour.

Reach for it when the exit needs to be a thing: when you want to give it custom messages, hang behaviour on it, or have players interact with it directly. For a plain connection between two rooms, @vopen does the same job without leaving an object behind.

The difference is visible the moment you look at the room. A virtual exit is marked (v) and belongs to the room; an object exit shows up with a number, because it is a thing lying there:

> @vopen north to #205 > @open south to #205 > look Obvious Exits: north(v) -> #205, #206:a south -> #205 ^ no object ^ an object in the room
@vopen@open
Creates an objectNoYes
Appears in room contentsNoYes
DestinationRequiredOptional — can link later
Custom messagesVia @virtualize, belowDirectly
Can carry behaviourNoYes

Named exits: gates, doors, stairs, chasms

Not every exit is a compass direction. These four create exits players refer to by name, and the one you choose decides how players get through it:

CommandMakesPlayers
@gopen gate to #412A walkable exitgo gate
@dopen door to #412A doorOpen, close, lock and unlock it
@copen stairs to #412A climbable exitclimb stairs
@jopen chasm to #412A jumpable exitjump chasm

All four create the return exit at the destination automatically. Add /noret for a one-way trip:

> @gopen/noret trapdoor to #412

These all create objects — a door has to be an object, since it has a state players can change. @dopen requires a destination; the others can be linked later. Remove any exit with @rmexit.

Creation commands take a bare noun

Never put an adjective in the name you give a creation command. Make the exit with its noun alone, then add the adjective afterwards:

> @dopen door to #412 You created a new closable exit #413:door. > @adj #413 = oak Adjectives reset to 'oak'. Object title: 'an oak door'.

The same rule applies to @gopen, @copen, @jopen, @open, @vopen, @make and @name. Players still refer to it as oak door — the adjective becomes a match word once @adj has set it. Remember the return exit is a separate object: adjective that side too.

Exit messages

Three messages are shown when someone uses an exit, and each goes to a different audience:

MessageSeen byWhere
successThe person moving
osuccessEveryone elseThe room being left
odropEveryone elseThe room being entered

So a single move produces three different lines of text, and the room you walk into sees you arrive. Set them with:

> @success gate = You slip through the gate. > @osuccess gate = &S slips through the gate. > @odrop gate = &S arrives, breathing hard.

@success and @osuccess shorten to @succ and @osucc; @odrop is already short. Give no message to clear one. &S stands in for whoever is moving, capitalised.

The defaults

Every exit starts with sensible messages already filled in, using the direction you gave it:

success You &MODE &1. -> "You walk north." osuccess &S &OMODE &1. -> "Ana walks north." odrop &S &OMODE in from the &1. -> "Ana walks in from the south."

&MODE and &OMODE are filled in at the moment someone moves, with how they are moving — walk, walks; fly, flies. Notice that odrop uses the reverse direction, because to the room being entered the traveller comes in from the opposite side.

Custom messages on a directional exit

The message commands work on exit objects, so they cannot target a virtual exit — there is no object to name. If you want your own wording and a room free of exit objects, use all three commands in order:

> @open east to #204 You created a new exit #207:east. Exit linked to: #204:The Old Library > @succ east = You duck through the low arch. > @osucc east = &S ducks through the low arch. > @odrop east = &S ducks in, brushing off dust. > @virtualize east Converted #207:an east (east) to virtual exit -> #204:The Old Library. Exit object #207 recycled. > look Obvious Exits: east(v) -> #204

@virtualize moves the destination and all three messages into the room and recycles the exit object. You end up with exactly what @vopen would have built — carrying your wording instead of the defaults. This is the recommended way to make a directional exit that both reads well and leaves nothing behind.