SHOW_MENU
Usage:
SHOW_MENU <title> [option 1] [option 2] [option 3] etc.
Variants:
SHOW_MENU_LDF <ldf reference> [option 1] [option 2] [option 3] etc.
Description:
Displays a menu to the player, which pauses the game
(including all scripts) until the user makes a valid selection.
You must use TAGGED_INDEPENDENT with this command.
Also note that if the menu is repeatable (i.e. TAGGED_REPEATABLE)
you must use RETRIGGER at the end of your radius trigger script
(see script below for an example).
You have two types of SHOW_MENU commands:
- normal = the text shown is what you specify inside quotes via the <title> argument.
- LDF = the text shown comes from an entry in LANGUAGE.LDF which you specify via the <ldf reference> argument.
Details:
<title> or <ldf reference> is the main text which
will be shown to the player.
[option 1] and the other [option X] are the available choices for the user to select. If only one option is available then the menu option is NOT prefixed with "1.", and SPACE/ENTER keys can be used to accept it.
Savegames are disabled while the RTS menu is shown.
Once the menu is finished, the JUMP_ON MENU command will test the result, and jump to the matching label. It will fail to jump if there aren't enough labels, or menu could not be shown (e.g. multiplayer game).
The title can contain newlines (given by "\n"), to make multi-line titles. Newlines don't work in the options however.
Tip: to keep the SHOW_MENU command readable, you can split it across multiple lines by placing the \ character at the end of each partial line.
Example:
RADIUS_TRIGGER 0 0 -1 TAGGED_USE TAGGED_INDEPENDENT TAGGED_REPEATABLE //step 1: what we want to show SHOW_MENU "What can I do for you?" \ "Give me Health" \ "Give me Ammo" \ "Nothing" //step 2: where we want to jump to JUMP_ON MENU option1 option2 option3 // we only get here if the menu failed TIP "WTF?? Menu failed!" JUMP finished //some labeled RTS LABEL option1 HEAL_PLAYER 150 200 TIP "Have some health" JUMP finished LABEL option2 GIVE_BENEFIT BULLETS(100) TIP "Have some ammo" JUMP finished LABEL option3 TIP "OK then. Have a nice day" JUMP finished LABEL finished WAIT 3 RETRIGGER //reset the trigger END_RADIUS_TRIGGER