Oops, you’re right. I’m a bit embarrassed by that. I thought I checked the code before cutting and pasting…
I’ll add another one. I enjoy being able to test certain verbs, but it’s a pain to keep typing them in. So I thought I’d show how I run quick and dirty tests. Running one of these brings a little variety to the general programmer regression tests you have to do. It’s not just about going through a walkthrough
[code]volume specific verb tests - not for release
… (define variables and toggles here)
think-every-turn is a truth state that varies.
chapter thinkting
thinkting is an action out of world.
understand the command “thinkt” as something new.
understand “thinkt” as thinkting.
carry out thinkting:
now think-every-turn is whether or not think-every-turn is true;
showme think-every-turn;
the rule succeeds;
every turn (this is the test module rule):
if think-every-turn is true, try thinking;
if hint-every-turn is true, try hinting;
if smell-every-turn is true, try smelling;
if listen-every-turn is true, try listening;
if inv-every-turn is true, try taking inventory; [there are others of course]
if pronoun-every-turn is true, try requesting the pronoun meanings; [this is the equivalent of the PRONOUN command]
[/code]
For the “pronoun” test, I noticed Climbingstars wasn’t the only one who shared it. You did too…
I found it immediately handy long ago, and I bet others will too.
To set the/-- pronoun it to (O - an object): (- LanguagePronouns-->3 = {O}; -).
To set the/-- pronoun him to (O - an object): (- LanguagePronouns-->6 = {O}; -).
To set the/-- pronoun her to (O - an object): (- LanguagePronouns-->9 = {O}; -).
To set the/-- pronoun them to (O - an object): (- LanguagePronouns-->12 = {O}; -).
I find setting pronouns particularly useful if you want to focus the player on scenery, or you want to make sure “it” is not out of play, or “it” changes, e.g.
USE BROOM
The broom sweeps the floor. You find a penny under the dust. You pick it up.
X IT
(player probably means the penny)
There are good hint testing modules that are a lot more robust than the code above, and they may well have inspired my code and I forgot about it. But this lets you construct what you want with brute force. I like to razz folks I test for to add a “hint-every-turn” rule so they can be sure it doesn’t misfire.