OptionWML
The [options] tag
This tag might be a child of an [era], [multiplayer] or [modification] tag. (Version 1.13.1 and later only) [options] are now also recognised in a [campaign] tag. Its subtags describe a set of configuration options which are displayed to the user as widgets on the game creation screen, and the entered values are translated into WML variables in the game. The created variables' name is identical to the option's id they're attached to, so option IDs must be valid variable names and unique across all kinds of options. A good idea might be to prefix the addon ID.
The following subtags are recognized for [options]:
- [checkbox]: registers a checkbox.
- id: the id for this option. Must be unique.
- default: boolean value, determines if the box should be checked initially. Default no.
- name: a string to be displayed next to the widget.
- description: the tooltip text to be displayed when the user hovers the mouse over the widget.
- [choice]: registers a combo box. This tag used to be named [combo] before 1.13.6.
- id: the id for this option. Must be unique.
- default: the default value of the widget.
- name: a string to be displayed next to the widget.
- description: the tooltip text to be displayed when the user hovers the mouse over the widget.
- [item]: adds an item to the combo box.
- name: the displayed name of this item.
- value: the value the widget will take when this item is selected.
- [entry]: registers a text entry.
- id: the id for this option. Must be unique.
- default: the string initially displayed by the widget.
- name: a string to be displayed next to the widget.
- description: the tooltip text to be displayed when the user hovers the mouse over the widget.
- [slider]: registers an integer slider.
- id: the id for this option. Must be unique.
- default: an integer value. The slider will be positioned at this value by default.
- min: the minimal value the slider can take.
- max: the maximal value the slider can take.
- step: the difference between adjacent values the slider can take. Default 1.
- name: a string to be displayed next to the widget.
- description: the tooltip text to be displayed when the user hovers the mouse over the widget.
in 1.12 those variables are inserted as preload event that set these variables. (Version 1.13.0 and later only) These variables are now inserted directly in the scenario without events, this means you can also use those variables in scenariolevel [lua] tags and prestart events.
For [campaign] use in 1.12, options need to be inserted in the first [scenario]. Options for campaigns no longer work inside the first [scenario] and must now be placed directly inside [campaign].