Convert things-and-building doc to rst
This commit is contained in:
parent
0395aaadad
commit
8f3455ce0a
1 changed files with 8 additions and 5 deletions
|
|
@ -1,3 +1,4 @@
|
|||
===================
|
||||
things and building
|
||||
===================
|
||||
|
||||
|
|
@ -17,7 +18,7 @@ the decorator pattern
|
|||
the core idea: things are python classes with decorators. no custom DSL.
|
||||
python IS the language.
|
||||
|
||||
here's a full example of a pepsi can:
|
||||
here's a full example of a pepsi can::
|
||||
|
||||
from mudlib.things import thing, verb
|
||||
|
||||
|
|
@ -73,7 +74,7 @@ what's happening here:
|
|||
- no yaml needed for behavioral things. the python file IS the definition.
|
||||
|
||||
for static items (no behavior, just a description), we could support TOML-only
|
||||
for simple cases:
|
||||
for simple cases::
|
||||
|
||||
[thing]
|
||||
name = "rock"
|
||||
|
|
@ -87,6 +88,8 @@ builder commands
|
|||
|
||||
the @ prefix for builder/admin commands. not combat, not normal play. building.
|
||||
|
||||
::
|
||||
|
||||
@create item <name> opens editor with a template python file
|
||||
@create room <name> opens editor for a new room definition
|
||||
@edit <name> opens editor for an existing thing/room
|
||||
|
|
@ -149,7 +152,7 @@ open questions:
|
|||
map editing
|
||||
-----------
|
||||
|
||||
the map format (TOML) is already writable:
|
||||
the map format (TOML) is already writable::
|
||||
|
||||
[map]
|
||||
width = 20
|
||||
|
|
@ -189,14 +192,14 @@ interiors are rooms (classic MUD style) or small grids.
|
|||
entering: a tile on the overworld has an "enter" action that transitions you
|
||||
to an interior. the interior has an "exit" that puts you back on the overworld.
|
||||
|
||||
a room definition might look like:
|
||||
a room definition might look like::
|
||||
|
||||
[room]
|
||||
name = "tavern"
|
||||
description = "a warm tavern. fire crackling. smells like stew."
|
||||
exits = { out = "overworld:12,45" }
|
||||
|
||||
or as python if it has behavior:
|
||||
or as python if it has behavior::
|
||||
|
||||
@room
|
||||
class Tavern:
|
||||
Loading…
Reference in a new issue