In the phrase [Something] is an action applying to one visible thing and requiring [a requirement],
the requirement can’t just be anything; there is only one phrase that works there. You can say requiring light
, but not “requiring [something else].”
There are two other types of errors that I notice that haven’t yet been reported, probably because the compiler is tripping over the “and requiring” phrases before it gets to them. One is that you write
Understand "click [something]" as clicking.
Understand the command "click" as something new.
You’re defining the click
action, but then telling the compiler to forget your definition, which means that “click [something]” won’t do anything in-game: you told the compiler to forget your definition! You can switch the order of the statements, which would be equivalent to saying “Forget what you already know about the click
command. Now, here’s a click
command.” (This is not really necessary either – Inform doesn’t have a pre-existing definition of click
or scan
– but neither does it hurt, provided that you’re not clearing out your own definition that you already wrote.)
The other problem I notice is this definition:
If player clicks on computer:
say "A log of all the hotel rooms is pulled up. They are all vacant except room 237."
… and its equivalent, If player scans key cards
, for the scanning
action. The problem is that it needs to be defined in terms of Inform’s basic action sequence, and if
doesn’t do that: it needs to be written as one or more before
, check
, instead
, report
, carry out
, and/or after
rules. (If you prefer to think about it syntactically, you can’t start a rule definition with if
in Inform; if
statements can only occur inside rules.) There’s several different ways to do this and they’re all pretty much the same in how they work.
Putting all that together, I took a shot at rewriting the scanning action in a way that should work and that illustrates these issues:
Hotel Lobby is a room. The computer is in Hotel Lobby. Some key cards are a plural-named thing in Hotel Lobby.
Room 237 is a room. door 237 is a locked door. door 237 is west of Hotel Lobby and east of Room 237.
Scanning is an action applying to one visible thing. Understand "scan [something]" as scanning.
Check scanning when the player cannot see the computer:
instead say "You'll need to use the computer to do that."
Instead of scanning:
if the noun is not key cards:
say "That does nothing.";
otherwise:
say "The scanner peeps. The key card is now activated.";
now the key cards are the matching key of door 237.
EDIT. Whoops! This works except for one thing, which I’d forgotten: it’s not possible to change the matching key of
property during play!
This is kind of an awkward problem to have because doing a good solid realistic job of fixing it would require re-implementing a handful of rules controlling how movement, doors, and locking work, and it would be hard to be sure you got it right.
Here’s what I’d do to fake it fairly well, though. First, I’d change the instead
rule to
Instead of scanning:
if the noun is not key cards:
say "That does nothing.";
otherwise:
say "The scanner peeps. The key card is now activated.";
now door 237 is unlocked.
You then have the problem of wanting to make sure that the player can’t just walk in without the key; I’d write a quick rule to prevent that:
Instead of going through door 237 when the player does not have the key cards:
say "You'll need a key card to get into this room.".