I7 How do you put a description of an item once I pick it up

How do I do this? :smiley:


Thanks to everyone for being so helpful

It depends on what you mean. There’s the description when taking inventory, that by default would look something like this:

>i
You are carrying:
  a noodle
  a rubber chicken with a pulley in the middle
  ten different recipes of spam

That is regulated by the “listing contents of yourself” activity (see Chapter 17.13 in the Inform 7 manual). One way to change it at that point is like so:

Flash is a man. The player is Flash.

Control Room is a room. "The bridge of the rocket is filled with the most modern of contrivances. It's all incredibly futuristic, although most of the machinery seems decorated with brass spokes or tesla coils."

The ray gun is a thing in the Control Room. "Mounted on a wall is your trusty atomic blaster." Understand "atomic" or "blaster" or "sidearm" or "elongated" as the ray gun.

Rule for printing the name of the ray gun while taking inventory: say "ray gun (oddly warm)".


Test me with "get gun/i".

I can think of at least two different things that you want to do.

  1. You may want to print something more informative than “Taken.”, when the player takes the orb of eternal fortune (or whatever).
  2. Or you may want to print a special paragraph about a thing lying about in a room even if the player has once handled it and it’s ‘initial appearance’ is therefore not printed again.
    For 1), use an ‘after rule’. You can do that in lots of ways depending on the exact effect you want to achieve. If e.g. you want a special message to be printed only the first time you pick something up, use:
After taking the orb for the first time: say "You pick up the ball and have a look at it. [line break]Wow! It's the orb of eternal fortune! ... Or wait - was that 'misfortune'?"

For 2), you can tell inform to print special paragraphs without using the initial appearance property with a ‘rule for writing a paragraph about’ (see the Activities chapter in the built-in Manual). If you simply write a rule for writing a paragraph about something, the game will never print the initial appearance of that thing; but you can tell Inform not to heed that rule until the the thing is handled:

Rule for writing a paragraph about the orb when the orb is handled: say "That ball thing you didn't dare to keep is still lying about here. You get the impression that it pulsates with a faint, ominous glow."


EDIT: And I see Eleas thought of yet a third interpretation.

Or, for that matter, he may just be talking about the regular description when you examine something.

Ian: We also have an Inform-specific board on this forum that might give you better answers to your questions.