I7: Conditions

I want to parse an existing verb which applies to one object, but with two objects. I need to check two conditions simultanously. My non working code is

MySqueeze is an action applying to two things. Understand "squeeze [something] into [something]" as MySqueeze.
Check MySqueeze when noun is not the twig and noun is not the scale: instead say "That's not something you can squeeze something else into.".
Check MySqueeze when second noun is not the twig and second noun is not the scale: instead say "That's not something you can squeeze into something else.".
Check MySqueeze when noun is the same as the second noun: instead say "Nice try.".

The second sentence is not understood. How would the correct syntax look like?

Assuming it’s the last sentence that doesn’t work, try:

Check MySqueeze when noun is the second noun: instead say "Nice try."

Thanks, would’ve gotten to that, but currently it’s sentence 2+3 that’s not working. :frowning:

Really?
They worked for me.

Have you tried to tell Inform to “Understand the command “squeeze” as something new.”?

Nope. Just to be on the safe side: Would “Understand the command “squeeze” as something new.” substitute or extend the external squeeze routine?

(In case this be hard to understand: I did a new “squeeze” verb but learned that a squeeze verb already exists. What I’m used to from I6 is to extend the original verb, rather than overwrite it. Thought it’d be the same under I7.

Understanding a command as something new will make that command not trigger the actions it formerly triggered – so in the source code it has to go before one defines any new actions to be triggered by that command or it will affect one’s new definitions, too. (Sorry about that.)

Still, that may not be your problem at all.
What problem message do you get?

I guess Inform doesn’t like the format of your action name.
Does it accept this?

Squeezing it into is an action applying to two things. 
Understand "squeeze [something] into [something]" as squeezing it into.

Check squeezing it into when noun is not the twig and noun is not the scale: instead say "That's not something you can squeeze something else into."

Check squeezing it into when second noun is not the twig and second noun is not the scale: instead say "That's not something you can squeeze into something else."

Check squeezing it into when the noun is the second noun: instead say "Nice try."

“Understand … as something new” is the I7 equivalent of I6’s “Extend… replace…”

Puh… Works now. Thanks to all of you!

New problem, same subject, more or less.

Situation: “ram X into ground” shall work, “ram Y into ground” as well.

Ramming is an action applying to two things. Understand "ram [something] into [something]" as ramming.
Check ramming when noun is the Y and the second noun is the ground:
  (stuff).
Check ramming when noun is not the X: instead say "That cannot be rammed.".
Check ramming when the second noun is not the ground: instead say "That's not something you can ram the twig into.".
(more conditions, success).

“ram X into ground” works as intended, “ram Y into ground” results in “That cannot be rammed.”.

Why, oh why is that so?

I’m not sure. “When the noun is not X” can’t reasonably be more specific than “when the noun is Y and the second noun is the ground”.

But again perhaps Inform gets confused because it expects an action applying to two things to have an “it” as placeholder for the noun.

With “ramming it into is an action applying to two things” you should be able to write rules like “instead of ramming the twig into the ground” etc.

Note that multiple check rules can fire for the same action.

I’m not clear what you’re trying to achieve. Do you want the first check rule to make sure the action succeeds, or do you want the first rule to give a different reason for failure?

If your goal is the former, you’re going to have to do some reconfiguring - as EmacsUser mentioned, check rules just keep on running until something stops the action. So a check rule should never stop the action unless every case in which it applies should be denied.

If your goal is the latter, you might have to do some manual rule ordering. I don’t think that’s such a bad thing. You can do it by putting the “last” or “first” keyword at the beginning of the rule preamble, or you can name the rules and explicitly state their order. I use the Standard Rules as my guideline for the final approach.

To determine what order the rules are in now, you can either look at the Actions tab of the Index, or use “rules all” while playing. The “rules all” command lists even rules that do not apply.

Hm. Switched the order of some checks, replaced some full stops by semicolons, and now it works, although I don’t exactly know why. Thanks for your help anyway!