Pin pad not working? [RESOLVED]

Alright,

I’ve been beating myself up over this after studying the safety example in the Inform 7 manual. What am I doing wrong here?

The pin pad is a thing. The pin pad is fixed in place. 

Instead of opening the Cold Steel door, say "There door is secured in place and needs a number on the pin pad to open."

typing is an action applying to one number and one thing. 

Check typing: 
	if the noun is not the pin pad, say "[The noun] doesn't have any numbers on it." instead. 

Report typing:
	say "James presses a bunch of buttons. Nothing happens."

Understand "type [a number] on [the noun]" as typing.

After typing on the pin pad 28374:
	now the Cold Steel door is open; 
	say "As James hits enter on the pin pad, there is an audible clunk of the door's lock mechanism retracting."

Thanks for all your help everyone!

In the future, please make sure to put I7 help requests in the I7 folder (perhaps a nice mod will move this?)

The reason you’re having trouble is because your verb is structured incorrectly. “Typing is an action applying to one number and one thing” means that your action is “typing”, but then you use “After typing on the pin pad 28374”, which would make your action “typing on”.

Here’s my recommended fix.

[code]The pin pad is a thing. The pin pad is fixed in place.

Instead of opening the Cold Steel door, say “There door is secured in place and needs a number on the pin pad to open.”

Typing it on is an action applying to one number and one thing.

Check typing it on:
if the second noun is not the pin pad, say “[The second noun] doesn’t have any numbers on it.” instead.

Report typing it on:
say “James presses a bunch of buttons. Nothing happens.”

Understand “type [a number] on [something]” as typing it on.

After typing 28374 on the pin pad:
now the Cold Steel door is open;
say “As James hits enter on the pin pad, there is an audible clunk of the door’s lock mechanism retracting.”[/code]

Also note that this revised code checks the second noun, rather than the first. This is because typing it on is an action applying to one number (this takes the place of the noun) and one thing (this is the second noun). If you go the other way around, your action will check against the nothing-object instead.

Thank you very much and next time I’ll make sure to put it in the right section. :slight_smile: Thought this fell under general coding stuff.

No problem, glad to help.