Table of Contents

Script Law — Rooms

Hand-holding for room SpecProcs. Classic Diku room triggers / dg_scripts are not how Neo works — you create a named Beanshell room proc with @proc room, then attach that name on a room prototype with @room proc.

Hub: Script Law. Build the room first: Creation Law — Rooms.

Order of operations (do not skip)

Attaching a proc name that does not exist yet is the usual first failure — create, then attach.

Create and edit a room proc

> @proc room new quiet_enter
Okay.
> @proc room script quiet_enter
(writer opens — paste Beanshell, finish writer)
> @proc room examine quiet_enter
…script text…
> @proc room matrix quiet_enter 0.0
Okay.
> index proc_room quiet
>

Help pattern: @proc room [delete|examine|new|matrix|rename|script] <name>. Names are lowercased, alphabetic/underscore, length 3–16.

Rename / delete when you outgrow a name:

> @proc room rename quiet_enter alley_enter
Okay.
> @proc room delete alley_enter
Okay.
>

Detach rooms that still name a proc before you delete it if you want clean references.

Personal ''script room'' writer

> script room list
> script room write
(writer opens for the SpecProc named like your player)
>

Usage: script (mobile|item|room) (list|write) [player]. Implementors may pass another player name.

Attach to a room prototype

> @load room 1200
Okay.
> @room proc quiet_enter
Okay.
> @examine room
(confirm proc name)
> @save room
Okay.
> goto 1200
>

If @load room complains about an open draft, @examine room then @save or @clear.

Triggers rooms care about

Branch on var.STATE (see hub table). For rooms you will use most:

Return true only when you intend to block the triggering command; otherwise return false;.

Room shell APIs (illustrative)

Prefer methods that already appear in live procs / RoomShell. Examples used in world data and shell surface:

Also: var fields (STATE, mobile, item, command, args, scratch aliases) and util.roll / util.chance. Do not invent method names — @proc room examine an existing proc or read shell code when unsure.

Minimal ENTER example (teaching stub)

Paste into @proc room script … only after you understand it blocks nothing:

if (var.STATE == var.STATE_ENTER) {
  if (util.chance(50)) {
    var.room.echo("The air shifts as someone arrives.");
  }
}
return false;

Attach, goto the room from next door, and confirm you see the echo sometimes. If nothing happens: confirm @examine room shows the proc name, you @saved, and your script actually branches on ENTER (not only SCRIPT).

Hard-coded room specials

Some rooms use compiled SpecRoom via @room attrs rather than a free-form script name (e.g. patterns like RoomSkullDoor). That is Creation-side attribute work, not @proc room — see Rooms and the Script Law hub note on Java specials.

Common mistakes