Possible Inform 7 bug

I wonder why the following code gives an error message in Inform 7. Does anybody have any ideas? Use scoring.

Room 1 is a room.

The description of Room 1 is “This is Room 1.”

The player is in Room 1.

Understand “press button” as pressing button.

Pressing the button is an action applying to nothing.

Understand “pull lever” as pulling lever.

Pulling the lever is an action applying to nothing.

The button is in Room 1.

The lever is in Room 1.

The button is fixed in place.

The lever is fixed in place.

Carry out pressing the button:
if the player is in Room 1:
say “You press the button.”;
increase score by 8;
otherwise:
say “There is not any button here.”.

Carry out pulling the lever:
if the player is in Room 1:
say “You pull the lever.”;
decrease score by 3;
otherwise:
say “There is not any lever here.”.

You need to put the action definition as before the understand statement. PUSH and PULL are already understood by Inform (in the sense of moving, e.g. PUSH THE TABLE), so you can delete the action definitions.

"Buttons and Levers"

Use scoring.

Room 1 is a room.

The description of Room 1 is “This is Room 1.”

The player is in Room 1.

The button is in Room 1.

The lever is in Room 1.

The button is a fixed in place device.

The lever is a fixed in place device.

Check pushing the button:
	try switching on the noun instead.

Check pulling the lever:
	try switching on the noun instead.
	
Check switching on the button:
	say “You press the button.”;
	increase score by 8;
	rule fails.

Check switching on the lever:
	say “You pull the lever.”;
	decrease score by 3;
	rule fails.
3 Likes

Everything seems to work fine now. Thank you.