PaladinWhite
Member
AFAIK, currently, the only way to prompt for user input is via boolean user_confirm(). Other types are hard to input.
There are many times when I want to take non-boolean user inputs in order to determine how a script will execute. Currently, I'm using some silly workarounds.
For instance, forcing input as parameters to the main() function, which only works if the script is ready for that input as the very first step:
or hardcoding values, which cannot be changed during execution:
or running user_confirm() in a loop, which is just ridiculous:
The ability to input ints would be invaluable. Strings, less so, but there are times when it would come in handy.
(Or maybe there are already ways to do this that I'm missing. Do tell!)
There are many times when I want to take non-boolean user inputs in order to determine how a script will execute. Currently, I'm using some silly workarounds.
For instance, forcing input as parameters to the main() function, which only works if the script is ready for that input as the very first step:
Code:
void main(int input) {
int turns_to_spend = input;
[spend those turns...] // works if I can take input here...
item thing;
[...]
print("You currently have " + item_amount(thing) + " " + thing + ". How many would you like to sell?");
int number_to_sell = ??? // doesn't work if I need to do something else before taking input...
[...]
}
or hardcoding values, which cannot be changed during execution:
Code:
int TURNS_TO_SPEND = 50; // edit this value if you want to spend a different number of turns!
[...]
or running user_confirm() in a loop, which is just ridiculous:
Code:
int turns_to_spend;
do {
turns_to_spend += 1;
} while(!user_confirm("Do you want to spend " + turns_to_spend + " turns?"))
[...]
The ability to input ints would be invaluable. Strings, less so, but there are times when it would come in handy.
(Or maybe there are already ways to do this that I'm missing. Do tell!)