Actions not firing as expected

I have a device that allows people to see in the dark. However, the action is not firing when the player puts it on. Strangely, the action fires when you take it off.

Cuthbert glasses are in reliquery. Cuthbert glasses are wearable. 
Understand the lit property as describing Cuthbert glasses. Cuthbert glasses are unlit.
Description of Cuthbert glasses is "Two rose-colored lenses are connected and attached to curved wires that fit around one's ears.".
Understand "glasses/device" as Cuthbert glasses.

After opening reliquery:
	say "A strange device rests inside on a red satin cushion. It contains two rose-colored lenses with curved wires to fit around one's ears. There is a small metal plaque on the back of the cabinet.".

After putting on Cuthbert glasses:
	say "The room glows in golden brightness.";
	now Cuthbert glasses are lit;
	try looking;
	
After taking off Cuthbert glasses:
	say "The golden glow fades.";
	now Cuthbert glasses are unlit;

I ran this with actions on and saw that it failed? It can’t be much simpler. Why did putting on the glasses fail?
I get this displayed:

What do you do? **put on glasses**
[wearing Cuthbert glasses]
[wearing Cuthbert glasses - failed]

As shown in the ACTIONS output, the action for putting on clothing is “wearing”, not “putting on”. That’s the name you’ll have to use in your code.

“Putting on” is the action for PUT BOOK ON SHELF.

3 Likes

This is something that kind of bothered me about parser IF, actually. Yes, I do understand, as a player of quite a bit of IF, that “wear glasses” is the ‘right’ command to equip wearable items. But a lot of people, at least in the USA, use the term “put on” to mean “wear”. And of course, “put X on Y” is used to place things on top of other things. I think it would be cool if Inform and other parsers could disambiguate between “put on (wearable)” to mean “wear (wearable)” and “put X on Y”.

I think there might be some confusion here?

Laboratory
You can see reliquery (closed) here.
 
>test me
(Testing.)
 
>[1] open reliquery
A strange device rests inside on a red satin cushion. It contains two rose-colored lenses with curved wires to fit around one's ears. There is a small metal plaque on the back of the cabinet.
 
>[2] look
Laboratory
You can see reliquery (in which is Cuthbert glasses) here.
 
>[3] wear glasses
(first taking Cuthbert glasses)
The room glows in golden brightness.
 
Laboratory
You can see reliquery (empty) here.
 
>[4] put glasses in reliquery
(first taking it off)
The golden glow fades.
 
You put Cuthbert glasses into reliquery.
 
>[5] put on glasses
(first taking Cuthbert glasses)
The room glows in golden brightness.
 
Laboratory
You can see reliquery (empty) here.
 
> 

Inform is very much capable allowing the player to use put on for the wearing action. Consulting the Standard Rules:

Understand "wear [something preferably held]" as wearing.
Understand the command "don" as "wear".
 
Understand "put [other things] on/onto [something]" as putting it on.

Understand "put on [something preferably held]" as wearing.
Understand "put [something preferably held] on" as wearing.

A lot of ways of expressing the same action. And you can add your own.

1 Like

There is perhaps confusion between what the player types (you want to offer lots of synonyms) and what the author types (life is simpler if every entity in the source code has exactly one name).

3 Likes

Yeah, Inform allows the player to refer to actions in a bunch of different ways, but only allows the author to use a single one. This gets back to how Inform is designed for ease of reading over ease of writing.

2 Likes

This looks good, except that neither “put on glasses” nor “wear glasses” works. (I get the same non-response.) Perhaps there is something elsewhere in the source code blocking this action.

If you turn on the RULES testing command, that might help you find what rule is causing the issue.

Yes, I found another “After putting on Cuthbert glasses” rule elsewhere in the code that blocked the action of the one above. Remove it, and it now works as expected.

2 Likes