I cannot figure out why each time I execute the BUY action, I get different results.
Can someone help me?
"sandbox" by Clyde Falsoon
Include Questions by Michael Callaghan.
Equipment is a kind of thing.
A block is a kind of equipment. An arrow is a kind of equipment.
The Lab is a room. "This is a normal room for conducting experiments.".
Ten blocks are in Lab. 15 arrows are in Lab.
The player carries 3 arrows.
Does the player mean buying something that is carried by the player: it is very unlikely.
The can't take what's already taken rule does nothing when taking.
QtyQuestion is some text that varies. QtyQuestion is "Great! How many do you want? ".
Instead of buying equipment (called target):
if the player carries the target:
say "You don't see any of those for sale." instead;
now current question is QtyQuestion;
now the current prompt is " Select from 1 to 10: " ;
Ask a closed question, in number mode;
A number question rule (this is the get quantity rule):
if the current question is QtyQuestion:
let Nbr be the the number understood;
[ say "The number understood = [Nbr][line break]";]
[Need an extra cycle because 'exit' action throws last one away]
repeat with N running from 1 to Nbr:
try silently taking random block;
say "Paying for [Nbr] thing[s]: ";
exit; [exit discards last step in loop]
test buying with "i/buy block/buy block/buy arrow/i/look".
test Qbuy with "look/i/buy block/3/i/look".
Thanks. That is helpful. Seems obvious that not carried is uncarried, like many other properties have that, but then, I beat my head against the obvious.
Yeah, Inform specifically does not create “un-” adjectives automatically (though it does make “-er” and “-est” adjectives), because there are so many exceptions where it would get in the way. For example, unliving = not living, but undead ≠ not dead.
So it just leaves it up to the author to define those.