Hi everyone.
I am trying to implement a REALLY simple money/barter system in Inform 7. Basically I have an innkeeper who will only give you a key when you give him 5 coins (known as ‘firnlots’ in my game… an anagram of florints for anyone who’s interested).
So all I do at the moment is set up the definition of a ‘firnlot’ like so…
[code]A firnlot is a kind of thing.
The description of a firnlot is “A roughly circular coin that is the accepted currency in these parts.”.
Understand “Coin” or “Coins” or “Money” as firnlot.
Understand “give [things] to [someone]” as giving it to.
The block giving rule is not listed in any rulebook.
[Temp]
A bag is carried by the player.
40 firnlots are in the bag.
[/code]
So I don’t bother with giving them monetary value as such, there’s only one opportunity for such a transaction in my small game (it’s my first) so I don’t really need a full blown monetary system.
Now all I need to do is check when the innkeeper receives 5 coins and hey presto, he’ll give you the key…
[code]The innkeeper can be satisfied or unsatisfied.
The innkeeper is unsatisfied.
Before giving firnlots to the innkeeper:
if the innkeeper is satisfied, stop the action;
After giving firnlots to the innkeeper:
if the innkeeper is satisfied, stop the action;
if the innkeeper has 5 firnlots:
say “‘Very well then,’ says the innkeeper, ‘you can borrow my ladder but you had better bring it back in one piece. Here’s the key to remove the padlock.’”;
now the iron key is carried by the player;
now the innkeeper is satisfied.[/code]
This works fine, except for one thing… the output looks like this…
>give 6 firnlots to the innkeeper
firnlot: (first taking the firnlot)
firnlot: (first taking the firnlot)
firnlot: (first taking the firnlot)
firnlot: (first taking the firnlot)
firnlot: (first taking the firnlot)
"Very well then," says the innkeeper, "you can borrow my ladder but you had better bring it back in one piece. Here's the key to remove the padlock."
firnlot:
(I deliberately gave him 6 firnlots to test what would happen)
Yuck!! How can I get rid of all those needless “firnlot: (first taking…” lines?
I’ve been trying to figure this out for hours but my head is spinning now.
Thanks in advance,
Chris.