[I7] Before rules, removing clothing [SOLVED]

I am reading “§7.3. Before rules” and trying to create a text before the player removes a piece of clothing, but I can not seem to get it to work. The robe is refereed to as simple robe in the code.

Right now it is:

remove robe
You take off the simple robe.

I WANT it to be:

remove robe
(first folding it neatly)
You take off the simple robe.

What I write in Inform 7:

Before removing the simple robe, say "(first folding it neatly)".

What Inform says:
You wrote ‘Before removing robe’ , which seems to introduce a rule taking effect only if the action is ‘removing robe’. But that did not make sense as a description of an action. I am unable to place this rule into any rulebook.

Thoughts?

Solved! I had to type “taking off the robe” instead of “removing the robe”!

Glad you figured it out!
The best way to quickly discover the proper name of an action is to type ACTIONS while testing the game in the IDE, and Inform will document each action it tries and whether it succeeds or not.

This is solved by an AFTER which overrides the standard REPORT rule. You’d not use the BEFORE in this case.

After taking off the simple robe: say "You take off the robe and fold it neatly."

BEFORE is good for putting a message before an action that can happen in different circumstances or forcing the PC do another action before the specified one.

Before diving from something: say "All right, here goes nothing..."

[code]Before dropping a fragile thing:
if the player carries feather pillow:
try dropping feather pillow.

After dropping a fragile thing:
if feather pillow is in the location:
say “You set [the noun] on the feather pillow gently.”;
otherwise:
say “With a crash, [the noun] breaks into a zillion pieces!”;
remove the noun from play.[/code]