[[ASK: question]] … [[ELSE]] … [[END]]
This action displays a question to the user and waits for a response.
If an affirmative response (i.e., “Yes”) is provided, the subsequent text is displayed and/or the actions within the [[ELSE]]
or [[END]]
block are executed. In case of a negative response (i.e., “No”), the subsequent text is displayed and/or the actions between the [[ELSE]]
and [[END]]
blocks are executed.
The [[ELSE]]
block is optional.
-
Example1: {[[(A), ON_SEARCH_TREASURES]] [[ASK: Do you want to put your hand into a mysterious bag?]] You found a gem worth 100 gold pieces! [[END]]}
-
Example2: {[[(A), ON_OPEN:REPEAT]] [[ASK: Do you have the key?]] [[OPEN(L26)]] [[ELSE]] [[LOCKED]] [[END]]}
In Example 1, when searching for treasure, the text "Do you want to put your hand into a mysterious bag?" is displayed. If the response is "Yes," the text "You found a gem worth 100 gold pieces!" appears. Since there is no [[ELSE]] block, nothing will appear if the player responds "No." Note that in this case, if the player responds "no," it will no longer be possible to put their hand in the bag (because ON_SEARCH_TREASURES does not repeat). NOTE: if you want the question to repeat until someone answers "Yes," you must use the IF Action (see below).
In Example 2, this is an ASK triggered in response to attempting to open a door adjacent to Marker A (and it is a repeated event). If a hero answers "no," they can still try again. After the door is opened, it cannot be opened again (because it is already open), so the ON_OPEN Event will not trigger again.
