Defining a verb applying to doors?

Sorry for asking and asking, but I am stuck again.

I would like to define a new verb for doors (as a kind). Something like X is an action applying to one door, but I don´t know if that is possible.

This is a confusing bit. When you define an action on any kind of object, you say thing. If it’s arbitrary text, the thing for which you would use [text] in the understand line, you say topic. For any other kind of value, you say that kind of value, number, color (if you’ve added a kind of value named “color”), etc.

So you could say, for instance:

Knocking is an action applying to one touchable thing.
Understand "knock on/-- [thing]" as knocking.
Check knocking when the noun is not a door: instead say "That would serve no purpose."

You could say

Understand "knock on/-- [door]" as knocking.

and you wouldn’t need the check rule, but then you’d get a parser error (“That noun did not make sense in this context.”) if the player tried to knock on a non-door, which wouldn’t be as clear.

4 Likes

Two options:

Knocking is an action applying to one touchable thing.

Understand "knock on [door]" as knocking.

This way the parser won’t understand if they type KNOCK ON HEAD, but will if you type KNOCK ON RED DOOR – gets what you’re after, but might be confusing. A better approach is probably:

Knocking is an action applying to one touchable thing.

Understand "knock on [something]" as knocking.

Check knocking:
     If the noun is not a door, say "You can't knock on that!" instead.

Hope this helps!

EDIT: Ninja’d! Always feels nice when I wind up saying almost the same thing as Zed, though :slight_smile:

4 Likes

Thank you, Zed, and thank you Mike! ^^

This solution it´s fine, but I should had explained my problem with a little more detail. I am trying to use some verb that the Spanish extension understands as inserting something, although the action is throwing something out of the window, a message saying “You can´t insert that into the window” keeps popping. (The strange thing is there isn´t a problem with “lanza”.) The parser understands the verb as something you can only use with containers, and my window is a door (you can get out of the room through it too). But thanks to you I can see that there are no special definitions for doors, so I suppose will have to change the standard rules for the extension. Though I am not sure I know how to do that.

If you want your game to forget the meaning of an existing command so you can redefine it you can say:

Understand the command "command-name" as something new.

And then you could associate it with another action.

Understand "command-name [thing]" as my-new-action-ing.
3 Likes

Awesome! I will try this. Hopefully I will be able to fix this mess. It is strange how the things that I thought were supereasy are the most difficult and vice versa.

Thank you very much to both of you! :slight_smile:

1 Like

welcome to Inform! :grinning:

3 Likes