I7 : ask a quantity to the player ?

Hello,

I want my player to be able to buy a quantity of goods when he is in a factory.
The issue, the way I am modelling the world, is that goods and values a both values (I can trade tens of goods or more, so I don’t want them to be actual objects). But apparently, actions can only take one value parameter.

So, a solution I am thinking of, would be to create a dialog looking like that :

What would be the best way to do this ?

I have seen the “Identity theft” example in the recipe book. Is it the best way to go ?

[code]“Identity Theft”

The player’s forename is a text that varies. The player’s full name is a text that varies.

When play begins:
now the command prompt is "What is your name? > ".

To decide whether collecting names:
if the command prompt is "What is your name? > ", yes;
no.

After reading a command when collecting names:
if the number of words in the player’s command is greater than 5:
say “[paragraph break]Who are you, a member of the British royal family? No one has that many names. Let’s try this again.”;
reject the player’s command;
now the player’s full name is the player’s command;
now the player’s forename is word number 1 in the player’s command;
now the command prompt is “>”;
say “Hi, [player’s forename]![paragraph break]”;
say “[banner text]”;
move the player to the location;
reject the player’s command.
[/code]

The usual solution here would be to make goods a kind of object rather than a value, but have them always off-stage and place them in scope only during the buying action.

After deciding the scope of the player while buying: repeat with N running through things begin; place N in scope; end repeat;

Thank you maga.
At first I though “Meh. I don’t want to replace my values with objects”. But reading a bit more about ways to read number directly from text input, indeed, it might be easier to use objects.

For example, I am considering now creating an object called “Food”, which has a good value called “food” (I need that value name to be able to browse the storages in my factory).

Or I might create new command recognizing only a number (16.10. Commands consisting only of nouns), which would only be recognized after having told that I want to buy some good.

I’ll keep investigating.