Input number
The input_number command allows the player to input a number into a field.
input_number 命令允许玩家在字段中输入一个数字。
It works the same way as input_text, with two major differences:
其工作方式与 input_text 相同,但有两大区别:
the player is only allowed to input numeric characters when writing the command, 玩家只能输入数字字符,并且在编写命令时,
it's not enough to specify a variable; you have to specify a minimum and maximum number so that the player can't write a number smaller than the minimum one or higher than the maximum one you specify 仅指定变量是不够的;你必须指定一个最小值和最大值,这样玩家就无法输入小于你指定的最小值或大于最大值的数字
Usage
In order to use this command, you must create a variable in startup.txt (or create a temp (temporary) variable in the scene file) to be modified by the player's input.
为了使用此命令,你必须在 startup.txt 中 *创建一个变量(或在场景文件中创建一个 *temp(临时)变量),以便由玩家的输入来修改。
*temp coins 0
How many gold coins do you have?
*input_number coins 50 100In this example, the player may input a certain number of "coins", which modifies the "coin" variable. The game will only allow the player to input a number between 50 and 100. 在这个例子中,玩家可以输入一定数量的“硬币”,这会修改“硬币”变量。游戏将只允许玩家输入一个介于50到100之间的数字。
Known input_number Bug
Note that there is a known input_number related game-stopping bug when playing a ChoiceScript game using Microsoft's Internet Explorer. It does not occur in any other browsers, and there is no known workaround.
请注意,在使用微软的Internet Explorer玩ChoiceScript游戏时,存在一个已知的input_number相关的游戏停止错误。该错误在任何其他浏览器中都不会发生,并且目前没有已知的解决方法。(王洛木:真的还有人在用 IE 浏览器么……)