how_to_build
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| how_to_build [2026/07/10 04:02] – appledog | how_to_build [2026/07/10 04:20] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 109: | Line 109: | ||
| == Custom Commands | == Custom Commands | ||
| A very common thing you want to do is add a way to create a custom command; either to show a custom flavortext or to cause something to happen. This section will detail ways that you can create a custom command such as "move painting" | A very common thing you want to do is add a way to create a custom command; either to show a custom flavortext or to cause something to happen. This section will detail ways that you can create a custom command such as "move painting" | ||
| + | |||
| + | === A command on the room itself -- **cmd_// | ||
| + | |||
| + | The simplest custom command needs no item at all -- you hang it on the **room**. A room-data field named **cmd_// | ||
| + | |||
| + | {{{ | ||
| + | room data cmd_examine_keyhole exa You examine the keyhole. It is unusually small. It must require an unusually small key! | ||
| + | }}} | ||
| + | |||
| + | Now typing **examine keyhole** in that room prints that line. A room command **pre-empts everything** -- it fires even when the word is normally a built-in (// | ||
| + | |||
| + | To print more than one line, add numbered continuations -- **cmd_// | ||
| + | |||
| + | {{{ | ||
| + | room data cmd_examine_keyhole exa The keyhole is unusually small. | ||
| + | room data cmd_examine_keyhole_2 exa It must require an unusually small key! | ||
| + | }}} | ||
| + | |||
| + | //The slug is the whole typed phrase.// " | ||
| + | |||
| + | === Verbs on an object -- **do //word// to //thing//** | ||
| + | |||
| + | A custom command can also live on an **item** -- a prop -- and there it can do more than print. Give the prop a **verb hook** and any player who types "// | ||
| + | |||
| + | {{{ | ||
| + | item rug data verb_move A trapdoor is revealed beneath the rug! | ||
| + | item rug data verb_move_reveal trapdoor | ||
| + | }}} | ||
| + | |||
| + | Now **move rug** prints that line //and// clears the // | ||
| + | |||
| + | === Commands that reach across a zone -- flags and gates | ||
| + | |||
| + | A verb hook fires in one room. When a custom command should reach //across// an area -- light three braziers scattered through the sewers and a stone door grinds open somewhere else -- the prop raises a flag on the shared **zone blackboard**, | ||
| + | |||
| + | {{{ | ||
| + | item brazier data verb_light_zoneflag brazier_a | ||
| + | }}} | ||
| + | |||
| + | Lighting each brazier sets its own flag (one-way, and cleared on a zone reset so the puzzle re-arms); the gate room lists the flags it needs and un-seals a hidden exit once they are all raised. The full recipe -- flags, requiring a tool in hand, and building the gate -- is in **[[Advanced Building]]** (// | ||
| == Builder help topics | == Builder help topics | ||
how_to_build.txt · Last modified: by 127.0.0.1
