[Solved] Creating an Action

Hello All!

I am attempting to make an action where the user can type “Use paint on door” and I can’t seem to get it to work.

[code]Using is an action applying to two things.

Understand “use [something] on [something]” as Using.

Instead of Using paint on rusted door:
if the paint can has the paint:
say “You put te paint on the door.”;
Now the rusted door is painted;
say “That really doesn’t make any sense, does it?”;
stop the action. [/code]

It keeps throwing me this error:

Problem. You wrote ‘Instead of Using paint on rusted door’ , which seems to introduce a rule taking effect only if the action is ‘Using paint on rusted door’. But that did not make sense as a description of an action. I am unable to place this rule into any rulebook.

Any idea what I am doing wrong here?

You need to define your action thus:

Using it on is an action applying to two things.

When you want to have a preposition as part of an action description, you need to include “it” so Inform knows where the first noun ends and the preposition begins. So the unlocking action is actually defined as “unlocking it with,” so Inform knows that the action will be something like “unlocking THE DOOR with THE KEY.” If you just have “Using is an action applying two things,” Inform will expect you to say things like “instead of using paint rusted door”–you haven’t told it to expect “on” there.

So if you define the action as “using it on” Inform will know that “Instead of using paint on rusted door” is your “using it on” action.

You’ll also need the understand line to be

Understand "use [something] on [something]" as using it on.

There are some circumstances where in generic cases it’s OK to say “using”–I think “Instead of using:” is OK but you’d need “Instead of using the paint on something” rather than just “Instead of using the paint.” But in your action definition you’ll need to write out “Understand… as using it on” in full.

Thank you so much. This worked. Creating new actions has been a bit confusing to me and this explanation helped out really well. I appreciate you writing it up, sir!