Learning ChoiceScript: Part 7: Inputs

Learning ChoiceScript

ChoiceScript is a scripting language from Choice of Games LLC for creating choose-you-own-adventure games.


 

Inputs

While most ChoiceScript games use text and choices to drive their stories, there is also functionality to supply input: the commands *input_text and *input_number.

Text

Screenshot 2018-08-25 12.48.12

The command *input_text, as it name implies, shows a text box for the user to enter text. The variable name should follow the command and will be where the entered text will be saved.

 Screenshot 2018-08-25 12.55.51

Numbers

Screenshot 2018-08-25 13.10.06

Similar to *input_text, the command *input_number provides the user the ability to enter numbers instead of text. However, while *input_text allows for entering any amount of text, *input_number must be given a range from the minimum and to a maximum.

Screenshot 2018-08-25 13.10.20

 

GitHub Gist Version:


We stood before the large gate and looked up at the guards. They looked down at us. There was a tense moment before they spoke.
[b]What's the password?[/b]
*input_number password 0 30
*if password = 16
We passed through gate.
*finish
*else
The guards grunted a response. "Wrong answer."
*finish

view raw

gate.txt

hosted with ❤ by GitHub