I’ll try to make it work using K valued properties:
Hrm. This is valid I7 but produces invalid I6, meaning there’s almost certainly a bug in some way involved (by cursory searching, I think it’s bug 751; graham’s response there states that this kind of reasoning isn’t supposed to be well supported, but let’s press on anyway):
[code]There is room.
Table of interesting ideas
Name Idea
A text A numbers valued property
“FOO” –
When play begins:
Choose a random row in the table of interesting ideas;
Now idea entry is the carrying capacity.[/code]
And this is flat-out illegal, for reasons which I entirely fail to understand:
[code]There is room.
Table of interesting ideas
Name Idea
A text A numbers valued property
“FOO” The carrying capacity[/code]
Unsurprisingly, this is illegal:
When play begins:
Let X be the carrying capacity;
Showme the X of the player.
You can write this, and it will say “true”; you cannot use a variable as an intermediary, however:
When play begins:
Showme whether or not the player provides a carrying capacity.
Finally, this is also illegal, and Inform has no idea why; this might be a bug, but I’m not really sure:
When play begins:
Let X be the carrying capacity;
Showme the total X of things which are the player.
By my limited experimentation, that is the correct way to write literal K valued properties (try “Showme the carrying capacity.” when play begins to see what I mean). I’ve run out of ideas; K valued properties probably aren’t a good way of doing this. Anyone else want to take a stab at this?
Oh, while I’ve been writing this, ektemple came up with a solution that appears to work, so you should probably use that, unless someone can make the “K valued property” approach work (since I don’t think it could fairly be described as spaghetti code).