I have a pile of sticks. I have the variable, stickCount.
Instead of taking a stick, I increase the stickCount by 1 but that leaves the player’s inventory empty.
I could place a dummy object in the player’s inventory and give it a printed name that changes from “a stick” to “some sticks” but I have the feeling that this is not the best way to go.
There is a similar problem here. David J Prokopetz gives some code for taking multiple coins. If you replace the coins with sticks, it can give you what you want.
If you wanted to use the dummy object method you could try this.
[code]“Test”
Rule for printing the name of the stick when taking inventory:
say “[the stick count of the stick in words] stick[s]”.
Check taking the pile of sticks:
increase the stick count of the stick by one;
if the player is not carrying the stick, now the player carries the stick;
say “You take a[if the stick count of the stick is greater than one]nother[end if] stick from the pile.” instead.
Check dropping the stick:
decrease the stick count of the stick by one;
if the stick count of the stick is zero, remove the stick from play;
say “You place a stick back onto the pile.” instead.
A first check dropping rule:
if the noun is the pile of sticks, say “You are not carrying any sticks.” instead.
The Testing Room is A Room. A pile of sticks is in the testing room. A stick has a number called the stick count. The stick is proper-named. The stick count of the stick is usually zero. Understand “stick” as the pile of sticks.
Test me with “take stick / i / take stick / i / take stick / i / take stick / i / drop stick / i / drop stick / i / drop stick / i / drop stick / i / drop stick”.[/code]
Thanks. I got confused by the documentation When any source text is run through Inform, a secret first line is inserted, Believing the include was automatically generated.