I’m currently trying to create an if condition that evaluates a value that belongs to a part of a thing, like so:
If the size of the feet which are part of the target is 9:
Unfortunately, this doesn’t work. While Inform 7 can parse “the feet which are part of the target” and work out what it means, “the size of feet which are part of the target” doesn’t seem to be recognized as a variable.
I’ve worked around the issue by creating an ugly dummy if condition, like so:
If the feet (called the legends) which are part of the target are part of the target:
If size of the legends is less than 12:
Obviously, this isn’t an ideal solution. How should I improve on it?
[code]Some feet are a kind of thing. Some feet are plural-named. Feet have a number called size. The size of feet is usually 10.
Some feet are part of every person.
instead of jumping: now the size of John’s feet are 13.
repeat with target running through visible people:
if the target has big feet, say “[The target] has big feet!”
To decide if the (target - a person) has big feet:
if some feet (called the appendages) are part of the target:
if the size of the appendages is less than 12:
The Testery is a room. John, Eric and Phil are men. Everyone is in the Testery.[/code]
This may be what you wanted. Using numbers this way isn’t ideal, but it works for the example - IMO it’s much more natural to use values directly to create a range of different sizes for feet. That would make the “to decide” statement redundant and improve clarity.
You’ve run into (what is in my opinion) one of the most counterintuitive limits of the fragment of English that makes up Inform 7. You’re not the first one into that pitfall!
The correct syntax in this and like cases (and I can’t actually specify what makes these cases alike) is:
If the size of random feet which are part of the target is 9:
Ah, thanks! That ‘random’ is a necessary term is interesting… I guess it kinda makes sense that Inform would need some way to tell which specific part is being referred to, even if there is only one part present.