sd:rogueima_plan
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| sd:rogueima_plan [2026/09/08 15:55] – external edit 127.0.0.1 | sd:rogueima_plan [2026/09/09 03:27] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1269: | Line 1269: | ||
| village is a place; it is not yet inhabited. | village is a place; it is not yet inhabited. | ||
| - | ==== Step 28. A level script ==== | + | ==== Step 28. A level script, and people who answer questions - DONE ==== |
| - | Brynn is 84x30 of map text followed by directives: | + | A level' |
| - | | + | DENIZEN Farmer_Jim 19 17 |
| - | | + | CHAT |
| - | " | + | REPLY job |
| + | | ||
| - | Underscores for spaces, because | + | '' |
| - | has a comment saying | + | '' |
| - | and attached | + | inside a token -- so **Brynn' |
| - | '' | + | and '' |
| - | at. | + | |
| + | === Why a directive and not punctuation === | ||
| + | |||
| + | '' | ||
| + | and the answer can contain as many more as it likes, so no escape is needed | ||
| + | for the colon at all -- a keyword is one word and cannot contain one. | ||
| + | |||
| + | Two things argued against it: | ||
| + | |||
| + | * The format already has **exactly one escape**, '' | ||
| + | backslash rule would be a second one to learn, and every directive added | ||
| + | later would inherit both. | ||
| + | * Inferring the // | ||
| + | keyword from a random line that happens to contain a colon. | ||
| + | |||
| + | A directive says which it is instead of leaving it to be guessed, and the next | ||
| + | thing we want -- '' | ||
| + | another mark. | ||
| + | |||
| + | === Talking: Ultima IV's three cases === | ||
| + | |||
| + | NetWhack has only the middle one. An NPC there holds a list of lines and says | ||
| + | one at random; there is no interactive speech in it anywhere. The other two | ||
| + | are Rogueima' | ||
| + | |||
| + | ^ case ^ what happens ^ | ||
| + | | nothing to say | //"They do not seem to want to talk."// | ||
| + | | random speech | Farmer Jim says, "The apples look lovely this year." | | ||
| + | | keyword replies | a page of its own, and you type words at it | | ||
| + | |||
| + | | ||
| + | |||
| + | I work the orchard. Apples, mostly. It's a living. | ||
| + | |||
| + | Ask about a subject -- try NAME, or JOB. BYE to stop. | ||
| + | Say: | ||
| + | |||
| + | An unknown word gets //" | ||
| + | an empty line ends it. Matching folds case, so '' | ||
| + | same question. | ||
| + | |||
| + | '' | ||
| + | code**, so it can be checked without reading a screen. Replies win over chats: | ||
| + | somebody who will hold a conversation should not be reduced to muttering one | ||
| + | line at you. | ||
| + | |||
| + | === Nothing copies text === | ||
| + | |||
| + | The script stays in the program image and an NPC holds **pointers into it**. | ||
| + | '' | ||
| + | than rewriting the source | ||
| + | be built twice without its script having been consumed. A keyword ends at the | ||
| + | space that follows it in the script, since it has no terminator of its own. | ||
| + | |||
| + | === Verification === | ||
| + | |||
| + | denizens created | ||
| + | keyword replies | ||
| + | " | ||
| + | |||
| + | The three modes are read off one denizen stripped in stages: with both, it | ||
| + | converses; with its replies taken away it falls back to random; with its chats | ||
| + | gone too it has nothing to say. | ||
| + | |||
| + | === An ordering bug === | ||
| + | |||
| + | '' | ||
| + | script put four denizens into the node array and '' | ||
| + | emptied | ||
| + | Everything a level writes into has to exist before the level is built. | ||
| ==== Step 29. Branches, and stairs that know where they go ==== | ==== Step 29. Branches, and stairs that know where they go ==== | ||
sd/rogueima_plan.1788882930.txt.gz · Last modified: by 127.0.0.1
