I have a bunch of objects created by several different assemblies. I would like to change the way their name is printed in some circumstances - specifically, when the owner of the object has been already printed. (Using Plurality)
For a single type of object, it’s simply:
Rule for printing the name of a nose (called the item) when the holder of the item is the prior named noun:
say "[its-their] nose";
(This is so you don’t get output like “George wriggles George’s nose”).
But if you have a number of similar assemblies, you have to write a separate rule for every kind, or do an if-then-otherwise for every kind.
What I would like is:
Rule for printing the name of a body part (called the item) when the holder of the item is the prior named noun:
say "[its-their] [kind of the item]";
Obviously “[kind of the item]” doesn’t work. And I can’t find a phrase in the Phrase book that does what I want.
Is there a way of getting this - maybe by dropping down into I6, even?
The default name of assembly parts is decided by Inform on some quite low level – beneath I6, as far as I can tell. I found that out while translating I7 to Swedish. There just was no elegant way to turn those names into another language. (Perhaps that counts as a bug, even?)
I’ve gone the route of defining a short-name for each kind, and now have:
Rule for printing the name of a body part (called the item) when the holder of the item is the prior named noun:
say "[its-their] [short-name of the item]";
But it turns out that I also need to determine if the name should be capitalized.
I dug around the Standard Library and found nothing, but found “Global caps_mode = false;” in Printing.i6t. I tried accessing this with I7:
Capitalizing is a truth state that varies. The capitalizing variable translates into I6 as "caps_mode".
Rule for printing the name of a body part (called the item) when the holder of the item is the prior named noun:
if capitalizing is true, say "[Its-their] [short-name of the item]";
otherwise say "[its-their] [short-name of the item]".
This results in an Inform6 compilation error:
C:\Program Files\Inform 7\Compilers\inform-632 \
-wSDv8 +include_path=..\Source,.\ auto.inf output.z8
Inform 6.32 for Win32 (18th November 2010)
auto.inf(25418): Error: Variable must be defined before use: "caps_mode"
> Global caps_mode
Compiled with 1 error and 1681 suppressed warnings (no output)
Compiler finished with code 1
Obviously I need to write an “Include (- … -) after Printing.i6t” segment, but I’m not familiar enough with I6 to write it properly. Any clues?
See my post on August 4th - that was my first attempt, and it doesn’t work (I6 compilation error). It seems you can’t access caps_mode until it’s defined in Printing.i6t, and Printing.i6t is included after the I7 source text. The only way to force Inform to place code after Printing.i6t is to do a full “Include (- I6 code -) after …” method.
Ah yes, I see now you’ve already tried that. The real problem seems to be that caps_mode is defined much later than it otherwise should be. Shifting the definition to “Definitions.i6t” seems to fix this.
[spoiler][code]“Test”
Include (- Global caps_mode = false; -) after “Definitions.i6t”.
I think I’ll stick with defining the small I6 function rather than redefining an entire section of the template code. (Especially since I’m including this in an extension).