Read chapter 12 of the second edition of the "Specification of the
Z-machine" and you'll see that the limitation is designed into the
Z-machine in a decision (valid in 1978 but hurting now) to trade
flexibility for compactness of representation. Perhaps the discussion
about extensions to the Z-machine will remedy this, but until then you
have the options of changing to TADS (when you can have as many
attributes and properties as you like) or working out how to use the
properties you have more effectively.
Changing to TADS obviously will result in more elegant code, but if you
are determined to stick with Inform I can offer some hints on reducing
your use of attributes and properties:
(1) One use of an attribute is to identify a group of similar objects.
For example, you have five gold coins, and declare the attribute
`is_coin' so that code can tell when an object is a coin.
But the atribute is unnecessary, because you have almost certainly
declared your coins like so:
Class CoinClass
has is_coin
with name "coin",
plural "coins",
parse_name [; ... ],
list_together [; ... ];
Object Coin1 "coin" class CoinClass;
Object Coin2 "coin" class CoinClass;
Object Coin3 "coin" class CoinClass;
Object Coin4 "coin" class CoinClass;
Object Coin5 "coin" class CoinClass;
In which case, the test
if (object.parse_name == Coin1.parse_name)
is entirely sufficient to distinguish a coin from a non-coin.
(2) Another use of an attribute is so that you can manipulate all
objects with that attribute; for example, you want to return all five
coins to the bank, so you write:
for (i = selfobj+1: i < top_object: i++)
if (i has is_coin)
move i to BankVault;
But you can make this code run faster by putting the coins into a linked
list, like so:
Property tail; ! tail of a linked list
Object Coin1 "coin" class CoinClass tail Coin2;
Object Coin2 "coin" class CoinClass tail Coin3;
Object Coin3 "coin" class CoinClass tail Coin4;
Object Coin4 "coin" class CoinClass tail Coin5;
Object Coin5 "coin" class CoinClass tail NULL;
and then
for (i = Coin1: i ~= NULL: i = i.tail) move i to BankVault;
does the same task as the earlier `for' loop. This solution wins if you
have several groups of objects that need to be linked in this way; then
you can then use the `tail' property for each.
-- Gareth Rees