*disable_reuse is a *choice-related, conditional command, affecting the display of an option that has previously been selected.
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.
*disable_reuse works in the same way as the *hide_reuse command, with two major differences:
- Instead of completely hiding the used option like *hide_reuse, it will just grey the option out (it will still be displayed, but unselectable)
- Unlike *hide_reuse, *disable_reuse cannot affect an entire scene and must instead be added individually to each option you wish to disable the reuse of.
It is worth stressing that 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 *disable_reuse condition will not be needed.
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.
*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. *finish
With the addition of a *disable_reuse condition on the Eat and Sleep options, we can still allow this *choice to be re-used, but grey out (i.e. disable) any option previously chosen, so the player can Eat or Sleep only once before that option becomes unselectable, so finally leaving only the Go outside option available. As follows:
*label Home What do you want to do? *choice *disable_reuse #Eat. You eat and are not hungry anymore. *goto Home *disable_reuse #Sleep. You sleep for 10 hours. *goto Home #Go outside. You go outside. *finish
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.
Combining *disable_reuse with *selectable_if
*disable_reuse can also be combined with a *selectable_if command, provided they are on the same line, and the *disable_reuse command precedes the conditional statement.
*temp hunger 0 *temp fatigue 0 *label Home What do you want to do? *choice *disable_reuse *selectable_if (hunger > 0) #Eat. You eat and are not hungry anymore. *goto Home *disable_reuse *selectable_if (fatigue > 10) #Sleep. You sleep for 10 hours. *goto Home #Go outside. You go outside. *finish
The options to "Eat" or "Sleep" will be visible but disabled ("greyed out"), both if the player has previously chosen the option to sleep or eat, and if the variables "hunger" or "fatigue" are greater than a certain number. Otherwise, the options will be selectable.
|Choice||*choice, *fake_choice, *disable_reuse, *hide_reuse, *allow_reuse, *selectable_if|
|Variable||*create, *temp, *set, Arithmetic operators, *delete, *input_number, *input_text, *print, *rand|
|Conditional||*if, *elseif, *else|
|Goto||*label, *goto, *goto_scene, *goto_random_scene, *gosub, *gosub_scene, *finish|
|Formatting||Bold text, Italic text, *image, *line_break, *page_break, *link, *stat_chart|
|Miscellaneous||*comment, *scene_list, *title, *author, *achieve, *achievement, *check_achievements, *bug, *ending, *more_games, *share_this_game, *show_password, *script|