I sadly don’t fully grasp the ‘understand’ function. For example, I have several occasions throughout the game I’m working on where the player will have to type on a keyboard or keypad certain words/numbers. In the scenario below I need them to type ‘selfishness of the man’s nature’. Any suggestions?
Understand "key board" or "keypad" or "key pad" as the keyboard.
The keyboard is here. It is scenery.
Typing is an action applying to one visible thing.
Understand "type on [a keyboard]" as typing.
After typing "selfishness of the man's nature" on the keyboard:
say "You hear the iron click and the wheel begins to turn until it reaches a 180 degree position."
As it stands, you’re just creating the action “type on keyboard”. If you want the player to be able to enter arbitrary text in that command, you need to tell Inform to expect that:
The keyboard is here. It is scenery.
Typing it on is an action applying to one topic and one thing.
Understand "type [text] on [something]" as typing it on.
Check typing it on:
say "That seems to accomplish nothing." instead.
Instead of typing "selfishness of the man's nature" on the keyboard:
say "You hear the iron click and the wheel begins to turn until it reaches a 180 degree position."
The important parts here are “action applying to one topic and one thing”, as well as the “[text]” token in the understand line. See §17.5 of Writing with Inform.
I suspect that because I have two instances in the game where there is typing that I’ve created a clash instead of actually running out of memory. Here’s my two typing sections. Have I written something redundant?
Carry out typing it on:
say "You type [the topic understood] on the wooden keypad.";
If the topic understood matches "consciousness of duty":
Say "[line break]The box makes a clicking noise which is followed by one of its sides popping out. It seems that the box was housing a portable stair step.";
Now the portable stair step is in the location.
The portable stair step is a thing.
The Rusty Keyboard is here. It is scenery.
Check typing it on:
say "That seems to accomplish nothing." instead.
Instead of typing "selfishness of the man's nature" on the Rusty Keyboard:
say "You hear the iron click and the wheel begins to turn until it reaches a 180 degree position."
The entire “Inform 6 ran out of memory” thing is an annoying relic in the design on the compiler. It doesn’t mean that you did anything wrong, your game has just gotten a bit larger than the compiler was set up to expect. Just raise the number in question until the error goes away.
As for your two sets of rules, yes, the generic “check typing it on” would prevent the “carry out typing it on” from running. You’d probably want to change the first one to be an Instead of typing it on the wooden keypad rule (assuming you have an object called a wooden keypad).
Ok, I was trying fix this but I might have misunderstood what you meant. Here’s what I changed it to:
Typing it on is an action applying to one topic and one thing. Understand "type [text] on [something]" as typing it on.
Instead of typing it on the wooden keypad:
say "You type [the topic understood] on the wooden keypad.";
if the topic understood matches "consciousness of duty":
say "[line break]The box makes a clicking noise which is followed by one of its sides popping out. It seems that the box was housing a portable stair step.";
now the portable stair step is in the location.
This is a tricky bit of Inform-ese that’s not well explained in the documentation, unfortunately – your action is called “typing”, not “typing it on” – the “it” and the “on” help Inform understand where the nouns will wind up going, so they’re necessary when you’re doing action declaration, but not otherwise. This should work:
Instead of typing on the wooden keypad:
say "You type [the topic understood] on the wooden keypad.";
if the topic understood matches "consciousness of duty":
say "[line break]The box makes a clicking noise which is followed by one of its sides popping out. It seems that the box was housing a portable stair step.";
now the portable stair step is in the location.
The memory setting MAX_OBJECTS (which is 512 at present) has been exceeded. Try running Inform again with $MAX_OBJECTS=<some-larger-number> on the command line.