Digging rooms, connecting them, and what players see as they move.
@dig takes a room type and an optional name:
> @dig ic = The Old Library
Created room #412: The Old Library| Type | Is | Use for |
|---|---|---|
ic | In-character room | The world itself. This is the usual answer. |
ooc | Out-of-character room | Lobbies, help areas, staff space. |
room | Plain base room | When 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 LibraryA 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.
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 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.
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 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 object | No | Yes |
| Appears in room contents | No | Yes |
| Destination | Required | Optional — can link later |
| Custom messages | Via @virtualize, below | Directly |
| Can carry behaviour | No | Yes |
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:
| Command | Makes | Players |
|---|---|---|
@gopen gate to #412 | A walkable exit | go gate |
@dopen door to #412 | A door | Open, close, lock and unlock it |
@copen stairs to #412 | A climbable exit | climb stairs |
@jopen chasm to #412 | A jumpable exit | jump 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.
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.
Three messages are shown when someone uses an exit, and each goes to a different audience:
| Message | Seen by | Where |
|---|---|---|
success | The person moving | — |
osuccess | Everyone else | The room being left |
odrop | Everyone else | The 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.
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.
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.