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.
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â.
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.
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).
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.
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.
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.