Hide reuse
hide_reuse is one of four specifically *choice-related, conditional command, affecting the display of one or more options (the others being *allow_reuse, *disable_reuse and *selectable_if). hide_reuse是四个专门与choice相关的条件命令之一,它影响一个或多个选项的显示(其他三个分别是allow_reuse、disable_reuse和selectable_if)。
It is only useful when the same choice is repeated several times, like in a menu or a conversation with a character, where most of the #options end up looping back to the main choice. 仅当同一个选项被重复多次时,它才有用,比如在菜单中或与角色的对话中,大多数#选项最终都会循环回到主选项。
Usage 用法
*hide_reuse can be used in two completely different, separate ways: *hide_reuse 可以以两种完全不同的、独立的方式使用:
it can hide a single option after the player uses that option, 它可以隐藏玩家使用过的单个选项,
it can hide all the used options in the entire scene except for any given a separate condition. 它可以隐藏整个场景中所有已使用的选项,除非为某个选项单独设置了条件。
However, it should be noted that either purpose of this command is only of use in those cases where you specifically intend to allow the re-use of some or all parts of a particular *choice statement. In most cases a *choice statement is used only once within a particular scene, so a hide_reuse condition will not be needed. 然而,需要注意的是,此命令的任一用途仅适用于您特意允许重复使用特定choice语句中部分或全部内容的情况。在大多数场景中,choice语句仅使用一次,因此通常不需要hide_reuse条件。
Hiding a single option after using it once 单次使用后隐藏单个选项
The following code uses *goto and *label to re-use the same choice statement when the player chooses either of the first two options. In essence, it allows the player to eat and sleep as many times as they wish -- until they become bored of doing so and opt instead to Go outside. 以下代码利用goto和label指令,在玩家选择前两个选项中的任意一个时,重复使用同一个choice语句。本质上,它允许玩家随心所欲地进食和睡觉——直到他们对此感到厌倦,转而选择外出。
*label Home
What do you want to do?
*choice
#Eat.
You eat and are not hungry anymore.
*goto Home
#Sleep.
You sleep for 10 hours.
*goto Home
#Go outside.
You go outside.
*finishWith the addition of a hide_reuse condition on the Eat and Sleep options, we can still allow this choice to be re-used, but hide (i.e. not display) any option previously chosen, so the player can Eat or Sleep only once before that option disappears, so finally leaving only the Go outside option available. As follows: 通过在"进食"和"睡觉"选项上添加hide_reuse条件,我们仍可允许此choice被重复使用,但会隐藏(即不再显示)先前选择过的任何选项。这样玩家在进食或睡觉仅一次后,该选项便会消失,最终仅保留"外出"选项可用。具体如下:
Note: Remember to always have an exit choice #option to let the player escape the loop (i.e. the "#Go outside" option above)! You will get a "No selectable options" error if all the options have been exhausted and there is no escape option. 注意:请务必始终设置一个退出choice #选项,让玩家能够跳出循环(例如上面的“#出门”选项)!如果所有选项都已用尽且没有退出选项,将会出现“无可选选项”错误。
Hiding all the options in the entire scene when used once 一次性隐藏整个场景中的所有选项
Alternatively, we can make all choice options act as if they have the hide_reuse condition, by simply placing the hide_reuse command on a line of its own near the very top of each scene file, before any actual choice. 或者,我们可以让所有choice选项表现得如同带有hide_reuse条件,只需在每个场景文件的最顶部、任何实际choice之前,将hide_reuse命令单独放置在一行即可。
In the above example, each option will be displayed only until it has been selected by the player, and thereafter it will be hidden, due to that prevalent hide_reuse command at the top of the scene. However, it's also possible to override a prevalent hide_reuse command with its opposite, *allow_reuse: 在上面的示例中,每个选项只会显示到玩家选择过为止,之后由于场景顶部存在该hide_reuse命令,它将被隐藏。不过,也可以使用其相反命令*allow_reuse来覆盖普遍存在的hide_reuse命令:
In the above example, Eat will be selectable only once (due to the prevalent *hide_reuse) but the player will be allowed to Sleep as many times as they like.
We can also use a *temp command and additional conditional code to limit the number of times a particular option may be chosen. The following example will now allow the player to choose "Sleep" only three times before that option is hidden: 我们还可以使用 *temp 命令和额外的条件代码来限制特定选项可被选择的次数。以下示例将只允许玩家选择"睡觉"选项三次,之后该选项将被隐藏: