I’m having a problem with multiple occurrences of the same thing. (like gold pieces). Have not been able to find documentation on the issue. At random (code below), when inserting the gold piece into the slot, am getting error messages, at random. By changing the code below when removing the gold from play, get 2 different messages. For some I get the message ‘gold piece: (first taking the gold piece) Done.’ and for others when I remove the thing from play I get the message ‘gold piece: That isn’t available.’. Not all things are removed from the players inventory. Any help would be appreciated. Thanks in advance.
“Multiple things” by Fyther LaSage
Section - Gold Coins - tokens
A gold piece is a kind of thing. The plural of gold piece is gold pieces. The player carries 50 gold pieces.
The main casino is a room.
The slot machine is a fixed in place device. The slot machine is in the main casino.
The money slot is part of the slot machine. The money slot is an open container.
instead of inserting carried things into the money slot:
if things is gold piece carried by the player:
let GP be a random gold piece carried by the player;
if GP is nothing:
say “You have no more gold to put into the slot machine[line break]”;
else:
[ remove GP from play;]
[ move GP to money slot;]
now GP is nowhere;
[ now GP is off-stage;]
say “(Ding, Ding - 1 coin has been played)[line break]”;
else:
say “You can’t insert the [noun] into the slot of the slot machine. Only gold pieces are allowed!”.
Test me with “I / insert 15 gold pieces in money slot / I”
Multiple things
An Interactive Fiction by Fyther LaSage
Release 1 / Serial number 200526 / Inform 7 build 6M62 (I6/v6.33 lib 6/12N) SD
main casino
You can see a slot machine here.
test me
(Testing.)
[1] i
You are carrying:
fifty gold pieces
[2] insert 15 gold pieces in money slot
gold piece: (Ding, Ding - 1 coin has been played)
gold piece: (Ding, Ding - 1 coin has been played)
gold piece: (Ding, Ding - 1 coin has been played)
gold piece: (Ding, Ding - 1 coin has been played)
gold piece: (Ding, Ding - 1 coin has been played)
gold piece: That isn’t available.
gold piece: (Ding, Ding - 1 coin has been played)
gold piece: (Ding, Ding - 1 coin has been played)
gold piece: (Ding, Ding - 1 coin has been played)
gold piece: (Ding, Ding - 1 coin has been played)
gold piece: (Ding, Ding - 1 coin has been played)
gold piece: (Ding, Ding - 1 coin has been played)
gold piece: (Ding, Ding - 1 coin has been played)
gold piece: That isn’t available.
gold piece: That isn’t available.
[3] i
You are carrying:
thirty-eight gold pieces