Verb both Transitive and Intransitive

Here’s the best way I’ve come up with to do it:

[code]Flying is an action applying to one topic.
Understand “fly [text]” as flying.
Understand “fly” as flying. [maybe not needed?]

Instead of flying “plane” when the player is in the plane:
say “You fly the plane.[line break]”.

Instead of flying “plane” when the player is not in the plane:
say “You are not in a plane.[line break]”.

Instead of flying:
If the player is in the plane
Begin;
say “You fly the plane.[line break]”;
Otherwise;
say “You flap your arms but nothing happens.[line break]”;
End if.[/code]

The problems are minor: If you’re in the plane with the doodad and you say “fly doodad”, you end up flying the plane.

Adding a block like this caused only the last set to fire:

[code]Instead of flying “plane” when the player is in the plane:
say “You fly the plane.[line break]”.

Instead of flying “plane” when the player is not in the plane:
say “You are not in a plane.[line break]”.

Instead of flying [text]:
If the player is in the plane
Begin;
say “Perhaps you be a little clearer.”; [in case they say something that happens to mean plane]
Otherwise;
say “It doesn’t seem flyable.[line break]”;

Instead of flying:
If the player is in the plane
Begin;
say “You fly the plane.[line break]”;
Otherwise;
say “You flap your arms but nothing happens.[line break]”;
End if.[/code]

This didn’t seem to be possible, unless I couldn’t get the syntax right:

Flying is an action applying to nothing or applying to one thing. Understand "fly [thing]" as flying. Understand "fly" as flying.

This is the ideal sort of result I want:

Of course in the final version I’d want those last two "fly"s to get “You’re already flying the plane”, but I can handle that. Just trying to keep the example short.

The word [text] here does nothing. Bracketed text outside of quotation marks is always considered comments and thus ignored. That’s probably why that rule didn’t work as expected.

As for your main problem with transitive / intransitive, whether or not an action requires a direct object (and / or an indirect one) is determined by the action definition. In many cases, you’d want two different actions to describe a transitive / intransitive situation. In this case, however, you could look at it as one transitive verb, with cases where the direct object is understood, not stated.

Inform can do this – see ch 17.30 “Supplying a missing noun/second noun.” The trick is to set up a grammar line without a direct object and then write a rule for filling it in:

[code]The lab is a room. The plane is a vehicle in the lab. A rock is in the plane.

Flying is an action applying to one thing. Understand “fly [something]” as flying.

Check flying:
if the noun is not the plane, say “You can’t fly that.” instead.

Check flying:
if the player is not enclosed by the plane, say “You’ll have to get in first.” instead.

Carry out flying:
say “Weee.”

[Here we set up the case where a noun is omitted.]

Understand “fly” as flying.
Rule for supplying a missing noun when flying: [ch 17.30]
if the player is enclosed by the plane, change the noun to the plane;
otherwise say “You flap your arms, but nothing happens.” instead.

test me with “fly / fly plane / enter plane / fly rock / fly / fly plane”.[/code]
EDIT: Okay, strictly speaking, bracketed text in an i6 inclusion is not considered a comment, but in pure I7 code, it is.

Oh yay, that looks much simpler than I was making it out to be.

And I knew that about the bracketed text, I just forgot Again :blush:

Thanks so much!