Using the verb 'type' for keypads, open containers, doors

I have several puzzles in this game that use a theoretical keypad. So in this instance I need the player to type in the words ‘consciousness of duty’. How can I make that work?

The wooden box is here. 
It is a scenery container. 
The keypad is on the wooden box.
The description of the wooden box is "The 3 meter by 3 meter structure seems insignificant at first but then you notice hinges on one of the corners. You lift up what you realize is a kind of cover or lid. This reveals words burned into the exposed wooden top that ask, 'What is sweeter than warm hearted friends with hands clapping?' Beneath the words is a keypad containing all the letters of the alphabet."

Chapter 17.5 of the manual may be helpful here.

2 Likes

Here’s a very simple version of this – lots of places to make it tighter but hopefully it helps get you started:

Test chamber is a room.

Typing it on is an action applying to one topic and one thing.  Understand "type [text] on [something]" as typing it on.

The wooden box is in the test chamber.  It is a container.  It is closed.  The description is "The 3 meter by 3 meter structure seems insignificant at first but then you notice hinges on one of the corners. [if the wooden box is open]Burned into the exposed wooden top are words that ask, 'What is sweeter than warm hearted friends with hands clapping?' Beneath the words is a keypad containing all the letters of the alphabet."  Understand "keypad" as the wooden box when the wooden box is open.

After opening the wooden box:
	Say "You lift up what you realize is a kind of cover or lid. This reveals words burned into the exposed wooden top that ask, 'What is sweeter than warm hearted friends with hands clapping?' Beneath the words is a keypad containing all the letters of the alphabet."

Check typing it on:
	if the second noun is not the wooden box, say "There's no keypad on that." instead;
	If the wooden box is closed, say "You can only type on the keypad when the box is open." instead.
	
Carry out typing it on:
	Say "You type [the topic understood] on the keypad.";
	If the topic understood matches "consciousness of duty":
		Say "[line break]That seems to have done something!";
		[Code unlocking or whatever needs doing goes here]
1 Like

Your code worked on it’s own but when I began to change it around to what’s below, I got this error: " The phrase or rule definition ‘Carry out typing it on’ is written using the ‘colon and indentation’ syntax for its 'if’s, 'repeat’s and 'while’s, where blocks of phrases grouped together are indented one tab step inward from the ‘if …:’ or similar phrase to which they belong."

The Back Lot is a room.


The description of the Back Lot is "You’ve stepped outside into a back lot enclosed by a high brick wall. There’s not much here save bits of a broken lawn chair, cigarette butts and other useless liter on the ground. But there is a wooden box sitting next to one of the walls."

The wooden box is here. It is scenery and a container. It is closed. The description of the wooden box is "The 3 meter by 3 meter structure seems insignificant at first but then you notice hinges on one of the corners. You lift up what you realize is a kind of cover or lid. This reveals words burned into the exposed wooden top that ask, 'What is sweeter than warm hearted friends with hands clapping?' Some cables eminate from inside the box and lead to a keypad containing all the letters of the alphabet."

Typing it on is an action applying to one topic and one thing.  Understand "type [text] on [something]" as typing it on.

Carry out typing it on:
	Say "You type [the topic understood] on the 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.";
		The portable stair step is now here.

You need to use indentation to nest code that comes under an if statement (or anything that ends with a colon). That last command also won’t compile – the syntax is “now X is Y”, and “the location” is how you tell a rule to use the room where the player is located – and you’ve got an errant space after your line break in the say command. This should work:

Carry out typing it on:
	Say "You type [the topic understood] on the 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.
1 Like

Beautiful!