Hello everyone. I am currently trying to learn I7. I have done well up until now and been able to figure everything out without posting to this forum, but this one little thing has me stumped; though I am rather certain I’ve read how to do it somewhere and just can’t find it. So apologies if I’m overlooking something very simple.
Price per pound is a kind of value. $1.99/lb specifies a price per pound.
Meat is a kind of thing. Meat has a has a price. And I want the description of any instance of the meat kind to use text substitutions which refer to the specific meat being examined. I can’t quite figure out what phrasing to use.
The description of meat is usually “[The meat] costs [price per pound of the meat].”
I know why the above substitution doesn’t work… I just can’t figure out what will. Any help would be greatly appreciated. Thanks!
You just need to say “the item described” instead of “the meat”:
[code]Price per pound is a kind of value. $1.99/lb specifies a price per pound.
Meat is a kind of thing. Meat has a price per pound. The price per pound of meat is usually $6.99/lb.
The description of meat is usually “[The item described] costs [price per pound of the item described].”
Butcher Shop is a room.
Some ground chuck is meat in the butcher shop.
Some prime rib is meat in the butcher shop. The price per pound of the prime rib is $10.99/lb.[/code]
“The item described” is the phrase you want to mean “the thing that this phrase is a description/printed name/other property of.” The documentation of this is tucked away in section 5.14 of Writing with Inform – this really is one of the sneakier introductions of an important concept in the Inform docs.
Oh, haha… I had tried “the meat described”, but not “the item described”. I knew I had read it somewhere, but it was really hard to find when I needed it. Thank you, matt, for the quick response and the location of the documentation section!
You could also say “[The noun]”. Since the only way a description will be printed in standard Inform is as a result of an “Examine [something]” command, this will be equivalent to “[The item described]”.
But! If you have some other code that might display the description of any meat (or anything), not in response to an “examine” command, this will produce unpredictable results – so it’s probably best to stick with matt w’s solution.