From 3f30fa3eec9c2e2acf9a984ccefb9529a25e688a Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Tue, 7 Jul 2026 05:50:37 -0400 Subject: feat: add insert/remove room to context menu in admin web GUI to 'push' or 'pull' map rooms --- building_guide/admin.md | 37 ++++++++++++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 3 deletions(-) (limited to 'building_guide/admin.md') diff --git a/building_guide/admin.md b/building_guide/admin.md index 023fae1..fe940e3 100644 --- a/building_guide/admin.md +++ b/building_guide/admin.md @@ -105,6 +105,7 @@ to see all available actions: | `addspawn` | `room addspawn [qty] [respawn]` | Add an item spawn (must exist in data/items/) | | `remspawn` | `room remspawn ` | Remove an item spawn | | `insert` | `room insert [name]` | Insert a new room into an exit, pushing rooms further out | +| `remove` | `room remove ` | Delete the inserted room and pull the far end back | All room commands are admin-only. Referenced objects, mobs, and items are validated before being added. @@ -117,7 +118,37 @@ twist. For up/down, no grid check is needed — the new room simply becomes an intermediate floor. The new room inherits the current room's outward-facing exit properties (conditions, blocked messages, flags), while the far room's reciprocal exit properties are preserved on its side. You are teleported into -the new room, just like `dig`. +the new room, just like `dig`. Diagonal directions (NE/NW/SE/SW) are supported. + +`room remove` is the inverse of `room insert`: it deletes the room reached via +the current room's `` exit (the "inserted" room) and "pulls" the +far end of the map back one step — the room that was beyond the deleted room +becomes adjacent to the current room, and everything reachable beyond it shifts +one step toward you. The current room's `` exit is repointed at the +far room (preserving the current room's exit properties), and the far room's +reciprocal exit is repointed back at the current room (preserving the far +room's own exit properties). You stay where you are; any other player standing +in the deleted room is relocated to the current room. + +`room remove` fails (and prints a message, changing nothing) when: + +- the `` exit's room does not lead back to the current room via the + opposite direction (it's not an insert chain), +- the deleted room has no room beyond it to pull (a dead end — use `undig` + instead), +- the deleted room has any exit other than the back-exit and the forward-exit, +- the far room's opposite exit does not lead back to the deleted room, +- some other room points into the deleted room (it was modified since + insertion), or +- the pull would cause a map overlap or twist. + +Both `room insert` and `room remove` are also available from the admin web +GUI's Map page: right-click a room and choose **Insert Room…** or +**Remove Room…**, then pick a direction from the submenu. The GUI endpoints +perform the same grid validation and exit-property preservation as the +in-game commands. The GUI cannot relocate live players standing in a removed +room (the same limitation as the existing Delete Room action); ensure no one +is in the target room before removing it from the GUI. #### god ``` @@ -250,9 +281,9 @@ The map page (`/`) is the main navigation hub: The typical admin worldbuilding workflow: -1. **Lay out rooms:** Use `dig` to create connected rooms quickly, or use the web map to create and link rooms visually. If `dig` would create a grid overlap, a two-way link is created instead — no duplicate rooms. Use `room insert` to place a new room between two already-connected rooms without breaking the map grid. +1. **Lay out rooms:** Use `dig` to create connected rooms quickly, or use the web map to create and link rooms visually. If `dig` would create a grid overlap, a two-way link is created instead — no duplicate rooms. Use `room insert` to place a new room between two already-connected rooms without breaking the map grid, and `room remove` to delete an inserted room and pull the far end back. 2. **Flesh out rooms:** Use `room` commands to set names, descriptions, add objects/mobs/spawns directly from inside the game. Use the web admin editors for richer CRUD with undo/redo. For deeper edits, edit the YAML files directly in `data/rooms/` to add on-enter scripts, triggers, hazards, etc. -3. **Rearrange:** Use `swapid` to renumber rooms and `undig` to delete rooms you no longer want (with full exit cleanup). Use `close` to remove individual exits. +3. **Rearrange:** Use `swapid` to renumber rooms and `undig` to delete rooms you no longer want (with full exit cleanup). Use `room remove` to cleanly undo a `room insert` (it pulls the far end back and rejects edits that would break the grid). Use `close` to remove individual exits. 4. **Reload:** Run `reload` to pick up YAML changes without restarting (rooms auto-reload). 5. **Test:** Use `goto` to jump around while debugging room connections and content. 6. **God mode:** Use `god` to test dangerous areas safely — full stats, no aggro, pass through blocked exits. `ungod` restores normal state. -- cgit v1.2.3