Actions and Descriptions

Newbie question:

Is there a simple way to combine an action with a description, other than examine or look? Specifically, each time a key is put in the sack, I want to say the description of that key.

Thank you.

First report inserting something into the sack: You prepare to stash [the noun] in your handy rucksack, but can't help relishing the opportunity to examine it closely first."; try examining the noun.

Thank you for your fast response. I’d like to understand the code.

What does “First” do? Can I substitute “putting” for “inserting”?

Does “try examining” just give a hint to the player? Or does it actually carry out “examine” as if it had been typed at the command line?

Finally, do I need [ ]s around something and noun? And if not, why not?

Thank you for your patience with this newbie and his grandson.

This much worked fine:
First report inserting something into the sack:
try examining the noun.

Adding this generated errors:
You prepare to stash [the noun] in your handy rucksack, but can’t help relishing the opportunity to examine it closely first.";

Is there an opening " missing? Or a tab?

“First” puts the rule at the beginning of the rulebook so it will run this before reporting “You put the [whatever] in the rucksack.”

“Try examining the noun” tries the action as if the player typed it, following all the rules the “examine” gets - such as it will fail if the player is in darkness. Note that we’re not printing the name for the player, we’re telling Inform what to examine, so it doesn’t need brackets; it’s not a printed substitution.

The brackets signify a substitution in quoted text. Say “[the noun]” will substitute the printed name of the noun involved in the action.

In the rule, “something” is not in brackets because the action is called “inserting it into” that requires two nouns. Inform knows “something” means the noun the player specified and is not a substitution in quoted text as before - this is telling Inform to use something the player typed, not printing the name for the player. There is likely an understand line within in the action that goes - Understand “insert [something] into [something]” as inserting it into. Note that quoting the player’s command uses substitution brackets.

The code as you copy it may not work because I just hit space five times to make the code look right on here. If you delete the spaces and tab properly it should work unless I goofed something else up. I think I need to space four times to equal a tab in copyable code, sorry about that.

Note: another way to do this is to use an “after” rule. After rules run before report rules and succeed (ending the action), so the report rules don’t run. So if you use them as an alternate report, you need to also account for that.

After inserting something into the rucksack: say "You take a moment to examine [the noun] proudly."; try examining the noun; say "You stash [the noun] into the rucksack."

You could try them both and see which one you like better if there’s any difference. Alternately, you could use after and then “continue the action” so the report rules will run:

After inserting something into the rucksack: say "You take a moment to examine [the noun] proudly."; try examining the noun; continue the action.

Hanon0. Thank you for the extended explanation. That really helps, especially for newbies like my grandson and me.