wesnoth/data/schema/core/actionwml.cfg
Dalas121 74da2a1724
TDG: add to schema, and fix schema issues (#9786)
While adding TDG to mainline, I missed adding it to the schema. As a result, a lot of issues went unnoticed.

This PR adds TDG to the schema, and fixes the various discovered errors. This PR also updates the schema to reflect the engine supporting multiple [filter] tags in events, and to reflect the engine supporting [change_theme] without keys.
2025-01-21 19:50:18 -06:00

1454 lines
33 KiB
INI

#define ACTION_TAG NAME EXTRA
[tag]
name="{NAME}"
super="$action_wml"
{EXTRA}
[/tag]
#enddef
#define SHOW_IF_TAG
[tag]
name="show_if"
super="$conditional_wml"
[/tag]
#enddef
#define COLOR_KEYS TYPE
{SIMPLE_KEY red {TYPE}}
{SIMPLE_KEY green {TYPE}}
{SIMPLE_KEY blue {TYPE}}
#enddef
#define FORMATTING_KEYS
{SIMPLE_KEY font string}
{SIMPLE_KEY font_family string}
{SIMPLE_KEY font_size font_size}
{SIMPLE_KEY font_style font_style}
{SIMPLE_KEY font_weight font_weight}
{SIMPLE_KEY font_variant font_variant}
{SIMPLE_KEY font_stretch font_stretch}
{SIMPLE_KEY color html_color}
{SIMPLE_KEY bgcolor html_color}
{SIMPLE_KEY underline font_underline}
{SIMPLE_KEY underline_color html_color}
{SIMPLE_KEY rise s_int}
{SIMPLE_KEY strikethrough s_bool}
{SIMPLE_KEY strikethrough_color html_color}
{SIMPLE_KEY fallback s_bool}
{SIMPLE_KEY letter_spacing s_unsigned}
{SIMPLE_KEY gravity font_gravity}
{SIMPLE_KEY gravity_hint font_gravity_hint}
#enddef
#define REQUIRED_KEYS_LOC_OR_XY KEY_BASE TYPE_LOC TYPE_XY
[if]
[not]
glob_on_{KEY_BASE}_loc=*
[/not]
[then]
{REQUIRED_KEY {KEY_BASE}_x {TYPE_XY}}
{REQUIRED_KEY {KEY_BASE}_y {TYPE_XY}}
[/then]
[else]
{REQUIRED_KEY {KEY_BASE}_loc {TYPE_LOC}}
[/else]
[/if]
#enddef
#define OPTIONAL_KEYS_LOC_OR_XY KEY_BASE TYPE_LOC TYPE_XY
[if]
glob_on_{KEY_BASE}_x=*
[or]
glob_on_{KEY_BASE}_y=*
[/or]
[then]
{REQUIRED_KEY {KEY_BASE}_x {TYPE_XY}}
{REQUIRED_KEY {KEY_BASE}_y {TYPE_XY}}
[/then]
[else]
{SIMPLE_KEY {KEY_BASE}_loc {TYPE_LOC}}
[/else]
[/if]
#enddef
[tag]
name="$action_wml"
max=0
{INSERT_TAG}
{ACTION_TAG "command" max=infinite}
{LINK_TAG "event"}
{LINK_TAG "lua"}
# Flow control (ConditionalActionsWML)
[tag]
name="if"
max=infinite
super="$conditional_wml"
{ACTION_TAG "then" max=infinite}
[tag]
name="elseif"
max=infinite
super="$conditional_wml"
{ACTION_TAG "then" max=infinite}
[/tag]
{ACTION_TAG "else" max=infinite}
[/tag]
[tag]
name="switch"
max=infinite
{REQUIRED_KEY variable string}
{INSERT_TAG}
[tag]
name="case"
max=infinite
super="$action_wml"
{REQUIRED_KEY value string}
[/tag]
{ACTION_TAG "else" max=infinite}
[/tag]
[tag]
name="while"
max=infinite
super="$conditional_wml"
{ACTION_TAG "do" max=infinite}
[/tag]
[tag]
name="for"
max=infinite
{SIMPLE_KEY variable string}
{INSERT_TAG}
[if]
glob_on_array=*
[then]
{SIMPLE_KEY array string}
{DEFAULT_KEY reverse s_bool no}
[/then]
[else]
{SIMPLE_KEY start s_int}
{SIMPLE_KEY end s_int}
{SIMPLE_KEY step s_int}
[/else]
[/if]
{ACTION_TAG "do" min,max=0,infinite}
[/tag]
[tag]
name="foreach"
max=infinite
{INSERT_TAG}
{SIMPLE_KEY array string}
{SIMPLE_KEY variable string}
{SIMPLE_KEY index_var string}
{DEFAULT_KEY readonly s_bool no}
{ACTION_TAG "do" min,max=0,infinite}
[/tag]
[tag]
name="repeat"
max=infinite
{INSERT_TAG}
{SIMPLE_KEY times s_int}
{ACTION_TAG "do" min,max=0,infinite}
[/tag]
# Direct actions (DirectActionsWML)
[tag]
name="endlevel"
max=infinite
{INSERT_TAG}
{DEFAULT_KEY result endlevel_result victory}
{SIMPLE_KEY side s_unsigned}
{DEFAULT_KEY bonus s_bool,s_real yes}
{DEFAULT_KEY carryover_report s_bool yes}
{DEFAULT_KEY save s_bool yes}
{DEFAULT_KEY replay_save s_bool yes}
{DEFAULT_KEY linger_mode s_bool yes}
{DEFAULT_KEY reveal_map s_bool yes}
{SIMPLE_KEY next_scenario string}
{SIMPLE_KEY carryover_percentage int}
{DEFAULT_KEY carryover_add s_bool no}
{SIMPLE_KEY music string_list}
{DEFAULT_KEY end_credits s_bool yes}
{SIMPLE_KEY end_text s_t_string}
{SIMPLE_KEY end_text_duration s_unsigned}
{SIMPLE_KEY test_result string}
[tag]
name="result"
max=infinite
{INSERT_TAG}
{REQUIRED_KEY result endlevel_result}
{REQUIRED_KEY side s_unsigned}
{DEFAULT_KEY bonus s_bool,s_unsigned yes}
{SIMPLE_KEY carryover_percentage int}
{DEFAULT_KEY carryover_add s_bool no}
[/tag]
[/tag]
[tag]
name="unit"
max=infinite
super="units/$unit"
{INSERT_TAG}
{DEFAULT_KEY animate s_bool no}
{SIMPLE_KEY name s_t_string}
{SIMPLE_KEY to_variable string}
[/tag]
[tag]
name="recall"
max=infinite
super="$filter_unit,$action_wml/role/auto_recall"
{INSERT_TAG}
{FILTER_TAG "secondary_unit" unit {INSERT_TAG}}
[/tag]
[tag]
name="teleport"
max=infinite
{INSERT_TAG}
{FILTER_TAG "filter" unit {INSERT_TAG}}
{SIMPLE_KEY x s_int}
{SIMPLE_KEY y s_int}
{SIMPLE_KEY location_id string}
{DEFAULT_KEY clear_shroud s_bool yes}
{DEFAULT_KEY animate s_bool no}
{DEFAULT_KEY check_passability s_bool yes}
[/tag]
[tag]
name="terrain_mask"
max=infinite
{INSERT_TAG}
{SIMPLE_KEY x s_int}
{SIMPLE_KEY y s_int}
{SIMPLE_KEY mask map_data}
{SIMPLE_KEY mask_file string}
{SIMPLE_KEY alignment mask_alignment}
{DEFAULT_KEY border s_bool no}
{DEFAULT_KEY ignore_special_locations s_bool no}
[tag]
name="rule"
max=infinite
{INSERT_TAG}
{SIMPLE_KEY old terrain_list}
{SIMPLE_KEY new terrain_list}
{SIMPLE_KEY terrain terrain_code}
{DEFAULT_KEY layer terrain_layer both}
{DEFAULT_KEY replace_if_failed s_bool no}
{DEFAULT_KEY use_old s_bool no}
[/tag]
[/tag]
[tag]
name="terrain"
max=infinite
super="$filter_location"
{INSERT_TAG}
{REQUIRED_KEY terrain s_terrain_code}
{DEFAULT_KEY layer terrain_layer both}
{DEFAULT_KEY replace_if_failed s_bool no}
[/tag]
[tag]
name="gold"
max=infinite
super="$filter_side"
{INSERT_TAG}
{REQUIRED_KEY amount s_int}
[/tag]
[tag]
name="unstore_unit"
max=infinite
{INSERT_TAG}
{REQUIRED_KEY variable string}
{DEFAULT_KEY find_vacant s_bool no}
{DEFAULT_KEY check_passability s_bool yes}
{SIMPLE_KEY text s_t_string,int}
{SIMPLE_KEY male_text s_t_string,int}
{SIMPLE_KEY female_text s_t_string,int}
{COLOR_KEYS s_unsigned} # TODO: These are probably deprecated?
{SIMPLE_KEY color s_color}
{DEFAULT_KEY advance s_bool yes}
{DEFAULT_KEY fire_event s_bool no}
{DEFAULT_KEY animate s_bool yes}
{SIMPLE_KEY x s_coordinates}
{SIMPLE_KEY y s_coordinates}
{SIMPLE_KEY location_id string}
[/tag]
[tag]
name="allow_recruit"
max=infinite
super="$filter_side"
{INSERT_TAG}
{REQUIRED_KEY type string_list}
[/tag]
[tag]
name="disallow_recruit"
max=infinite
super="$filter_side"
{INSERT_TAG}
{SIMPLE_KEY type string_list}
[/tag]
[tag]
name="set_recruit"
max=infinite
super="$filter_side"
{INSERT_TAG}
{REQUIRED_KEY recruit string_list}
[/tag]
[tag]
name="allow_extra_recruit"
max=infinite
super="$filter_unit"
{INSERT_TAG}
{REQUIRED_KEY extra_recruit string_list}
[/tag]
[tag]
name="disallow_extra_recruit"
max=infinite
super="$filter_unit"
{INSERT_TAG}
{REQUIRED_KEY extra_recruit string_list}
[/tag]
[tag]
name="set_extra_recruit"
max=infinite
super="$filter_unit"
{INSERT_TAG}
{REQUIRED_KEY extra_recruit string_list}
[/tag]
[tag]
name="modify_side"
max=infinite
{INSERT_TAG}
{FILTER_TAG "filter_side" side {INSERT_TAG}}
{SIMPLE_KEY side s_unsigned_range_list}
{SIMPLE_KEY income s_int}
{SIMPLE_KEY recruit string_list}
{SIMPLE_KEY team_name string}
{SIMPLE_KEY side_name s_t_string}
{SIMPLE_KEY user_team_name s_t_string}
{SIMPLE_KEY gold s_int}
{SIMPLE_KEY village_gold s_int}
{SIMPLE_KEY controller controller}
{SIMPLE_KEY fog s_bool}
{SIMPLE_KEY shroud s_bool}
{SIMPLE_KEY hidden s_bool}
{SIMPLE_KEY color string}
{SIMPLE_KEY switch_ai string}
{SIMPLE_KEY reset_maps s_bool}
{SIMPLE_KEY reset_view s_bool}
{SIMPLE_KEY share_vision share_vision}
{DEPRECATED_KEY share_maps s_bool}
{DEPRECATED_KEY share_view s_bool}
{SIMPLE_KEY shroud_data shroud_data}
{SIMPLE_KEY suppress_end_turn_confirmation s_bool}
{SIMPLE_KEY scroll_to_leader s_bool}
{SIMPLE_KEY flag string}
{SIMPLE_KEY flag_icon string}
{SIMPLE_KEY village_support s_int}
{SIMPLE_KEY defeat_condition defeat_condition}
[tag]
name="ai"
super="$side/ai"
max=infinite
{INSERT_TAG}
[/tag]
[/tag]
[tag]
name="modify_turns"
max=infinite
{INSERT_TAG}
{SIMPLE_KEY value s_unsigned,unlimited}
{SIMPLE_KEY add s_int}
{SIMPLE_KEY current s_unsigned}
[/tag]
{EMPTY_TAG "allow_end_turn" 0 infinite}
[tag]
name="disallow_end_turn"
max=infinite
{DEFAULT_KEY reason s_t_string ""}
[/tag]
[tag]
name="capture_village"
max=infinite
super="$filter_location"
{INSERT_TAG}
{SIMPLE_KEY side s_unsigned}
{DEFAULT_KEY fire_event s_bool no}
{FILTER_TAG "filter_side" side {INSERT_TAG}}
[/tag]
[tag]
name="kill"
max=infinite
super="$filter_unit"
{INSERT_TAG}
{SIMPLE_KEY animate s_bool}
{SIMPLE_KEY fire_event s_bool}
{FILTER_TAG "secondary_unit" unit {INSERT_TAG}}
{FILTER_TAG "primary_attack" weapon {INSERT_TAG}}
{FILTER_TAG "secondary_attack" weapon {INSERT_TAG}}
[/tag]
[tag]
name="move_unit"
max=infinite
super="$filter_unit"
{INSERT_TAG}
{SIMPLE_KEY to_x s_unsigned_range_list}
{SIMPLE_KEY to_y s_unsigned_range_list}
{SIMPLE_KEY to_location string}
{SIMPLE_KEY dir dir_count_list}
{DEFAULT_KEY clear_shroud s_bool no}
{DEFAULT_KEY fire_event s_bool no}
{DEFAULT_KEY check_passability s_bool yes}
{SIMPLE_KEY force_scroll s_bool}
[/tag]
[tag]
name="modify_ai"
super="$ai/modify_ai"
{INSERT_TAG}
[/tag]
[tag]
name="modify_unit"
max=infinite
super="units/$unit"
{INSERT_TAG}
{FILTER_TAG "filter" unit {INSERT_TAG}}
{SIMPLE_KEY mode string} # TODO: This is undocumented and it's unclear what's allowed here; probably should be an enum though?
{LINK_TAG "units/$modifications/trait"}
{LINK_TAG "units/$modifications/advancement"}
{LINK_TAG "units/$modifications/object"}
{LINK_TAG "units/$modifications/base/effect"}
{LINK_TAG "$action_wml/clear_variable"}
{LINK_TAG "$action_wml/set_variable"}
[/tag]
[tag]
name="transform_unit"
max=infinite
super="$filter_unit"
{INSERT_TAG}
{SIMPLE_KEY transform_to string}
[/tag]
{FILTER_TAG "petrify" unit (
max=infinite
{INSERT_TAG}
)}
{FILTER_TAG "unpetrify" unit (
max=infinite
{INSERT_TAG}
)}
[tag]
name="object"
max=infinite
super="units/$modifications/object"
{INSERT_TAG}
{DEFAULT_KEY take_only_once s_bool yes}
{DEFAULT_KEY delayed_variable_substitution s_bool no}
{SIMPLE_KEY silent s_bool}
{SIMPLE_KEY image string}
{SIMPLE_KEY name s_t_string}
{SIMPLE_KEY description s_t_string}
{SIMPLE_KEY cannot_use_message s_t_string}
{FILTER_TAG "filter" unit {INSERT_TAG}}
{ACTION_TAG "then" ()}
{ACTION_TAG "else" ()}
[/tag]
[tag]
name="remove_object"
max=infinite
super="$filter_unit"
{INSERT_TAG}
{SIMPLE_KEY object_id string}
[/tag]
[tag]
name="remove_trait"
max=infinite
super="$filter_unit"
{INSERT_TAG}
{SIMPLE_KEY trait_id string}
[/tag]
[tag]
name="remove_shroud"
max=infinite
super="$filter_location"
{INSERT_TAG}
{SIMPLE_KEY side s_unsigned_range_list}
{FILTER_TAG "filter_side" side {INSERT_TAG}}
[/tag]
[tag]
name="place_shroud"
max=infinite
super="$filter_location"
{INSERT_TAG}
{SIMPLE_KEY side s_unsigned_range_list}
{FILTER_TAG "filter_side" side {INSERT_TAG}}
[/tag]
[tag]
name="lift_fog"
max=infinite
super="$filter_location"
{INSERT_TAG}
{FILTER_TAG "filter_side" side {INSERT_TAG}}
{DEFAULT_KEY multiturn s_bool no}
[/tag]
[tag]
name="reset_fog"
max=infinite
super="$filter_location"
{INSERT_TAG}
{FILTER_TAG "filter_side" side {INSERT_TAG}}
{DEFAULT_KEY reset_view s_bool no}
[/tag]
{EMPTY_TAG "allow_undo" 0 infinite}
{EMPTY_TAG "cancel_action" 0 infinite}
{ACTION_TAG "on_undo" (
max=infinite
{DEFAULT_KEY delayed_variable_substitution s_bool no}
)}
[tag]
name="heal_unit"
max=infinite
{INSERT_TAG}
{FILTER_TAG "filter" unit {INSERT_TAG}}
{FILTER_TAG "filter_second" unit {INSERT_TAG}}
{SIMPLE_KEY amount heal_amount}
{DEFAULT_KEY animate s_bool no}
{DEFAULT_KEY moves heal_amount 0}
{DEFAULT_KEY restore_attacks s_bool no}
{DEFAULT_KEY restore_statuses s_bool yes}
[/tag]
[tag]
name="harm_unit"
max=infinite
{INSERT_TAG}
{FILTER_TAG "filter" unit (
min=1
{INSERT_TAG}
)}
{FILTER_TAG "filter_second" unit {INSERT_TAG}}
{REQUIRED_KEY amount s_int}
{SIMPLE_KEY alignment s_alignment}
{SIMPLE_KEY damage_type string}
{DEFAULT_KEY kill s_bool yes}
{DEFAULT_KEY fire_event s_bool no}
{DEFAULT_KEY animate s_bool no}
{DEFAULT_KEY delay s_unsigned 500}
{SIMPLE_KEY variable string}
{DEFAULT_KEY poisoned s_bool no}
{DEFAULT_KEY slowed s_bool no}
{DEFAULT_KEY petrified s_bool no}
{DEFAULT_KEY unhealable s_bool no}
{DEFAULT_KEY experience string_list yes}
{DEFAULT_KEY resistance_modifier s_real 1}
{FILTER_TAG "primary_attack" weapon {INSERT_TAG}}
{FILTER_TAG "secondary_attack" weapon {INSERT_TAG}}
[/tag]
[tag]
name="time_area"
max=infinite
super="scenario/time_area,$filter_location"
{INSERT_TAG}
{SIMPLE_KEY id string} # TODO: Is this allowed in scenario-level areas too?
{DEFAULT_KEY remove s_bool no}
{SIMPLE_KEY current_time s_unsigned}
[/tag]
[tag]
name="remove_time_area"
max=infinite
{INSERT_TAG}
{REQUIRED_KEY id string}
[/tag]
{EMPTY_TAG "end_turn" 0 infinite}
[tag]
name="replace_map"
max=infinite
{INSERT_TAG}
{DEPRECATED_KEY map map_data}
{SIMPLE_KEY map_data map_data}
{SIMPLE_KEY map_file string}
{DEFAULT_KEY expand s_bool no}
{DEFAULT_KEY shrink s_bool no}
[/tag]
[tag]
name="replace_schedule"
max=infinite
{INSERT_TAG}
{LINK_TAG "scenario/time"}
{SIMPLE_KEY current_time s_unsigned}
[/tag]
[tag]
name="tunnel"
max=infinite
super="units/unit_type~core/abilities/teleport/tunnel"
{INSERT_TAG}
{SIMPLE_KEY id string}
{DEFAULT_KEY remove s_bool no}
[if]
[not]
# As it allows s_bool, this can't test for every possible "yes" value,
# but if there's no remove= then it's definitely adding a tunnel.
glob_on_remove=*
[/not]
[then]
# These are also max=1, but max defaults to 1 anyway
{FILTER_TAG "filter" unit min=1}
{FILTER_TAG "source" location min=1}
{FILTER_TAG "target" location min=1}
[/then]
[/if]
[/tag]
[tag]
name="do_command"
max=infinite
{INSERT_TAG}
# Don't link from SaveWML schema since these accept variable substitution
[tag]
name="attack"
max=infinite
{INSERT_TAG}
{SIMPLE_KEY weapon s_int}
{SIMPLE_KEY defender_weapon s_int}
[tag]
name="source"
{SIMPLE_KEY x s_int}
{SIMPLE_KEY y s_int}
[/tag]
[tag]
name="destination"
{SIMPLE_KEY x s_int}
{SIMPLE_KEY y s_int}
[/tag]
[/tag]
[tag]
name="move"
max=infinite
{SIMPLE_KEY x s_unsigned_range_list}
{SIMPLE_KEY y s_unsigned_range_list}
{SIMPLE_KEY skip_sighted string} # TODO: Make this an enum type
[/tag]
[tag]
name="recruit"
max=infinite
{INSERT_TAG}
{SIMPLE_KEY type string}
{SIMPLE_KEY x s_int}
{SIMPLE_KEY y s_int}
[tag]
name="from"
{SIMPLE_KEY x s_int}
{SIMPLE_KEY y s_int}
[/tag]
[/tag]
[tag]
name="recall"
max=infinite
{INSERT_TAG}
{SIMPLE_KEY value string}
{SIMPLE_KEY x s_int}
{SIMPLE_KEY y s_int}
{SIMPLE_KEY location_id string}
[tag]
name="from"
{SIMPLE_KEY x s_int}
{SIMPLE_KEY y s_int}
[/tag]
[/tag]
[tag]
name="disband"
max=infinite
{SIMPLE_KEY value string}
[/tag]
[tag]
name="fire_event"
max=infinite
{INSERT_TAG}
{SIMPLE_KEY raise string}
[tag]
name="source"
{SIMPLE_KEY x s_int}
{SIMPLE_KEY y s_int}
[/tag]
[tag]
name="set_variable"
deprecated=yes
{SIMPLE_KEY name string}
{SIMPLE_KEY value string}
[/tag]
[/tag]
[tag]
name="lua_ai"
max=infinite
deprecated=yes
{SIMPLE_KEY code string}
[/tag]
[tag]
name="custom_command"
max=infinite
{SIMPLE_KEY name string}
{DATA_TAG "data" 1 1 string}
[/tag]
[/tag]
[tag]
name="put_to_recall_list"
max=infinite
super="$filter_unit"
{INSERT_TAG}
{DEFAULT_KEY heal s_bool no}
[/tag]
[tag]
name="set_achievement"
max=infinite
{REQUIRED_KEY content_for string}
{REQUIRED_KEY id string}
[/tag]
[tag]
name="set_sub_achievement"
max=infinite
{REQUIRED_KEY content_for string}
{REQUIRED_KEY id string}
{REQUIRED_KEY sub_id string}
[/tag]
[tag]
name="progress_achievement"
max=infinite
{REQUIRED_KEY content_for string}
{REQUIRED_KEY id string}
{REQUIRED_KEY amount s_int}
{SIMPLE_KEY limit s_int}
[/tag]
# Display actions (InterfaceActionsWML)
[tag]
name="inspect"
max=infinite
{SIMPLE_KEY name string}
[/tag]
[tag]
name="message"
max=infinite
super="$filter_unit"
{INSERT_TAG}
{SIMPLE_KEY speaker string}
{SIMPLE_KEY message s_t_string}
{SIMPLE_KEY male_message s_t_string}
{SIMPLE_KEY female_message s_t_string}
{SIMPLE_KEY wait_description s_t_string}
{SIMPLE_KEY side_for s_unsigned_range_list}
{SIMPLE_KEY image string}
{SIMPLE_KEY mirror s_bool}
{SIMPLE_KEY second_image string}
{SIMPLE_KEY second_mirror s_bool}
{SIMPLE_KEY image_pos image_pos}
{SIMPLE_KEY caption s_t_string}
{DEFAULT_KEY scroll s_bool yes}
{DEFAULT_KEY highlight s_bool yes}
{SIMPLE_KEY sound string_list}
{SIMPLE_KEY voice string_list}
{SIMPLE_KEY male_voice string_list}
{SIMPLE_KEY female_voice string_list}
{SIMPLE_KEY variable string}
{FORMATTING_KEYS}
{SHOW_IF_TAG}
[tag]
name="option"
max=infinite
{INSERT_TAG}
{DEPRECATED_KEY message s_t_string}
{SIMPLE_KEY image string}
{SIMPLE_KEY label s_t_string}
{SIMPLE_KEY description s_t_string}
{SIMPLE_KEY default s_bool}
{SIMPLE_KEY value string}
{SHOW_IF_TAG}
{ACTION_TAG "command" max=infinite}
[/tag]
[tag]
name="text_input"
{SIMPLE_KEY variable string}
{SIMPLE_KEY label s_t_string}
{SIMPLE_KEY max_length s_unsigned}
{SIMPLE_KEY text string}
[/tag]
[/tag]
[tag]
name="objectives"
max=infinite
super="$filter_side"
{INSERT_TAG}
{SIMPLE_KEY bullet string}
{SIMPLE_KEY summary s_t_string}
{SIMPLE_KEY note s_t_string}
{SIMPLE_KEY victory_string s_t_string}
{SIMPLE_KEY defeat_string s_t_string}
{SIMPLE_KEY gold_carryover_string s_t_string}
{SIMPLE_KEY notes_string s_t_string}
{DEFAULT_KEY silent s_bool no}
{DEFAULT_KEY delayed_variable_substitution s_bool no}
[tag]
name="objective~base"
max=0
{SIMPLE_KEY bullet string}
{COLOR_KEYS s_unsigned}
{SHOW_IF_TAG}
[/tag]
[tag]
name="objective"
max=infinite
super="$action_wml/objectives/objective~base"
{SIMPLE_KEY description s_t_string}
{SIMPLE_KEY caption s_t_string}
{SIMPLE_KEY condition objective_condition}
{DEFAULT_KEY show_turn_counter s_bool no}
[/tag]
[tag]
name="gold_carryover"
max=infinite
super="$action_wml/objectives/objective~base"
{SIMPLE_KEY bonus s_bool}
{SIMPLE_KEY carryover_percentage int}
[/tag]
[tag]
name="note"
max=infinite
super="$action_wml/objectives/objective~base"
{SIMPLE_KEY description s_t_string}
[/tag]
[/tag]
[tag]
name="set_menu_item"
max=infinite
{INSERT_TAG}
{SIMPLE_KEY id string}
{SIMPLE_KEY description s_t_string}
{SIMPLE_KEY image string}
{DEPRECATED_KEY needs_select s_bool}
{DEFAULT_KEY synced s_bool yes}
{DEFAULT_KEY use_hotkey s_bool,only yes}
{SHOW_IF_TAG}
{FILTER_TAG "filter_location" location {INSERT_TAG}}
{ACTION_TAG "command" {DEFAULT_KEY delayed_variable_substitution s_bool yes}}
[tag]
name="default_hotkey"
{SIMPLE_KEY key string}
{SIMPLE_KEY alt bool}
{SIMPLE_KEY ctrl bool}
{SIMPLE_KEY shift bool}
{SIMPLE_KEY cmd bool}
{DEFAULT_KEY repeat_on_hold s_bool no}
[/tag]
[/tag]
[tag]
name="clear_menu_item"
max=infinite
{REQUIRED_KEY id string}
[/tag]
[tag]
name="change_theme"
max=infinite
{SIMPLE_KEY theme string}
[/tag]
[tag]
name="item"
max=infinite
super="$filter_location,scenario/item"
{INSERT_TAG}
{DEFAULT_KEY redraw s_bool yes}
{SIMPLE_KEY write_name string}
{SIMPLE_KEY name string}
# Override some supertag keys to allow variable substitutions
{DEFAULT_KEY visible_in_fog s_bool yes}
{SIMPLE_KEY submerge s_real}
{FILTER_TAG "filter_side" side ()}
[/tag]
[tag]
name="remove_item"
max=infinite
super="$filter_location"
{INSERT_TAG}
{SIMPLE_KEY image string}
[/tag]
[tag]
name="print"
max=infinite
{SIMPLE_KEY text s_t_string}
{SIMPLE_KEY size s_unsigned}
{SIMPLE_KEY duration s_unsigned,unlimited}
{SIMPLE_KEY fade_time s_unsigned}
{COLOR_KEYS s_unsigned}
{SIMPLE_KEY color string}
[/tag]
[tag]
name="$fake_unit"
max=0
{SIMPLE_KEY type string}
{SIMPLE_KEY x s_unsigned_range_list}
{SIMPLE_KEY y s_unsigned_range_list}
{SIMPLE_KEY side s_unsigned}
{SIMPLE_KEY gender gender,subst}
{SIMPLE_KEY variation string}
{SIMPLE_KEY image_mods string}
[/tag]
[tag]
name="move_unit_fake"
max=infinite
super="$action_wml/$fake_unit"
{DEFAULT_KEY force_scroll s_bool yes}
[/tag]
[tag]
name="move_units_fake"
max=infinite
{INSERT_TAG}
{DEFAULT_KEY force_scroll s_bool no}
[tag]
name="fake_unit"
super="$action_wml/$fake_unit"
max=infinite
{SIMPLE_KEY skip_steps s_unsigned}
[/tag]
[/tag]
{FILTER_TAG "hide_unit" unit (
max=infinite
{INSERT_TAG}
)}
{FILTER_TAG "unhide_unit" unit (
max=infinite
{INSERT_TAG}
)}
{EMPTY_TAG "lock_view" 0 infinite}
{EMPTY_TAG "unlock_view" 0 infinite}
[tag]
name="scroll"
max=infinite
{INSERT_TAG}
{SIMPLE_KEY x s_int}
{SIMPLE_KEY y s_int}
{SIMPLE_KEY side s_unsigned}
{FILTER_TAG "filter_side" side {INSERT_TAG}}
[/tag]
[tag]
name="scroll_to"
max=infinite
super="$filter_location"
{INSERT_TAG}
{DEFAULT_KEY check_fogged s_bool no}
{DEFAULT_KEY immediate s_bool no}
{DEFAULT_KEY highlight s_bool no}
{SIMPLE_KEY side s_unsigned}
{FILTER_TAG "filter_side" side {INSERT_TAG}}
[/tag]
[tag]
name="scroll_to_unit"
max=infinite
super="$filter_unit"
{INSERT_TAG}
{DEFAULT_KEY check_fogged s_bool no}
{DEFAULT_KEY immediate s_bool no}
{DEFAULT_KEY highlight s_bool no}
{SIMPLE_KEY for_side s_unsigned}
{FILTER_TAG "for_side" side {INSERT_TAG}}
[/tag]
[tag]
name="select_unit"
max=infinite
super="$filter_unit"
{INSERT_TAG}
{DEFAULT_KEY fire_event s_bool no}
{DEFAULT_KEY highlight s_bool yes}
[/tag]
[tag]
name="sound"
max=infinite
{REQUIRED_KEY name string_list}
{DEFAULT_KEY repeat s_unsigned 0}
[/tag]
{LINK_TAG "scenario/sound_source"}
[tag]
name="story"
max=infinite
super="scenario/story"
[/tag]
[tag]
name="remove_sound_source"
max=infinite
{REQUIRED_KEY id string}
[/tag]
{LINK_TAG "titlescreen_music/music"}
[tag]
name="volume"
max=infinite
{SIMPLE_KEY music s_unsigned}
{SIMPLE_KEY sound s_unsigned}
[/tag]
[tag]
name="color_adjust"
max=infinite
{COLOR_KEYS s_int}
[/tag]
[tag]
name="screen_fade"
max=infinite
{COLOR_KEYS s_unsigned}
{REQUIRED_KEY alpha s_unsigned}
{REQUIRED_KEY duration s_unsigned}
[/tag]
[tag]
name="delay"
max=infinite
{REQUIRED_KEY time s_unsigned}
{DEFAULT_KEY accelerate s_bool no}
[/tag]
[tag]
name="redraw"
max=infinite
super="$filter_side"
{INSERT_TAG}
{DEFAULT_KEY clear_shroud s_bool no}
[/tag]
[tag]
name="unit_overlay"
max=infinite
super="$filter_unit"
{INSERT_TAG}
{REQUIRED_KEY image string}
{SIMPLE_KEY object_id string}
{SIMPLE_KEY duration object_duration}
[/tag]
[tag]
name="remove_unit_overlay"
max=infinite
super="$filter_unit"
{INSERT_TAG}
{REQUIRED_KEY image string}
{SIMPLE_KEY object_id string}
[/tag]
[tag]
name="animate_unit"
max=infinite
{REQUIRED_KEY flag string}
{SIMPLE_KEY hits s_anim_hits}
{SIMPLE_KEY text s_t_string,int}
{SIMPLE_KEY male_text s_t_string,int}
{SIMPLE_KEY female_text s_t_string,int}
{COLOR_KEYS s_unsigned}
{SIMPLE_KEY with_bars s_bool}
{FILTER_TAG "filter" unit {INSERT_TAG}}
{FILTER_TAG "primary_attack" weapon {INSERT_TAG}}
{FILTER_TAG "secondary_attack" weapon {INSERT_TAG}}
{FILTER_TAG "facing" location {INSERT_TAG}}
[tag]
name="animate"
super="$action_wml/animate_unit"
# TODO: [filter] is now mandatory rather than optional...
# TODO: Also, is nested [aniamte] allowed?
[/tag]
[/tag]
[tag]
name="label"
max=infinite
super="scenario/label,$filter_location"
{INSERT_TAG}
[/tag]
[tag]
name="floating_text"
max=infinite
super="$filter_location"
{INSERT_TAG}
{REQUIRED_KEY text s_t_string,int}
{SIMPLE_KEY color s_color}
[/tag]
[tag]
name="deprecated_message"
max=infinite
{SIMPLE_KEY message string}
{SIMPLE_KEY level deprecation_level}
{SIMPLE_KEY what string}
{SIMPLE_KEY version version}
[/tag]
[tag]
name="wml_message"
max=infinite
{SIMPLE_KEY message any}
{SIMPLE_KEY logger logger}
{SIMPLE_KEY to_chat s_bool}
[/tag]
[tag]
name="test_condition"
max=infinite
super="$conditional_wml"
{DEFAULT_KEY result s_bool no}
{SIMPLE_KEY logger logger}
[/tag]
[tag]
name="open_help"
max=infinite
{SIMPLE_KEY topic string}
[/tag]
[tag]
name="show_objectives"
max=infinite
super="$filter_side"
{INSERT_TAG}
[/tag]
[tag]
name="chat"
max=infinite
super="$filter_side"
{INSERT_TAG}
{DEFAULT_KEY speaker string "WML"}
{REQUIRED_KEY message string}
{DEFAULT_KEY observable s_bool yes}
[/tag]
[tag]
name="zoom"
max=infinite
{SIMPLE_KEY factor s_unsigned}
{SIMPLE_KEY relative s_bool}
[/tag]
# Internal actions (InternalActionsWML)
[tag]
name="set_variable"
max=infinite
{INSERT_TAG}
{REQUIRED_KEY name string}
{SIMPLE_KEY value any}
{SIMPLE_KEY literal any}
{SIMPLE_KEY to_variable string}
{SIMPLE_KEY suffix any}
{SIMPLE_KEY prefix any}
{SIMPLE_KEY add s_real}
{SIMPLE_KEY sub s_real}
{SIMPLE_KEY multiply s_real}
{SIMPLE_KEY divide s_real}
{SIMPLE_KEY modulo s_real}
{SIMPLE_KEY abs s_bool}
{SIMPLE_KEY reverse s_bool}
{SIMPLE_KEY root root_base,subst}
{SIMPLE_KEY power s_real}
{SIMPLE_KEY round rounding_method,subst}
{SIMPLE_KEY ipart s_real}
{SIMPLE_KEY fpart s_real}
{SIMPLE_KEY min s_real}
{SIMPLE_KEY max s_real}
{SIMPLE_KEY string_length string}
{SIMPLE_KEY time stamp}
{SIMPLE_KEY rand string_list}
{SIMPLE_KEY formula formula}
[tag]
name="join"
{REQUIRED_KEY variable string}
{DEFAULT_KEY key string "value"}
{SIMPLE_KEY separator string}
{SIMPLE_KEY remove_empty s_bool}
[/tag]
[/tag]
[tag]
name="set_variables"
max=infinite
{INSERT_TAG}
{REQUIRED_KEY name string}
{SIMPLE_KEY to_variable string}
[if]
[not]
glob_on_to_variable=*
[/not]
[then]
{SIMPLE_KEY mode set_variables_mode}
{DATA_TAG value 0 infinite any}
{DATA_TAG literal 0 infinite any}
[tag]
name="split"
max=infinite
{SIMPLE_KEY list string}
{DEFAULT_KEY key string "value"}
{SIMPLE_KEY separator char}
{SIMPLE_KEY remove_empty s_bool}
[/tag]
[/then]
[/if]
[/tag]
[tag]
name="store_gold"
max=infinite
super="$filter_side"
{INSERT_TAG}
{SIMPLE_KEY variable string}
[/tag]
[tag]
name="store_side"
max=infinite
super="$filter_side"
{INSERT_TAG}
{DEFAULT_KEY variable string "side"}
[/tag]
[tag]
name="store_starting_location"
max=infinite
super="$filter_side"
{INSERT_TAG}
{SIMPLE_KEY variable string}
[/tag]
[tag]
name="store_locations"
max=infinite
super="$filter_location"
{INSERT_TAG}
{DEFAULT_KEY variable string "location"}
{DEFAULT_KEY mode store_unit_mode "always_clear"}
[/tag]
[tag]
name="store_unit"
max=infinite
{INSERT_TAG}
{FILTER_TAG "filter" unit (
min=1
{INSERT_TAG}
)}
{DEFAULT_KEY variable string "unit"}
{SIMPLE_KEY mode store_unit_mode}
{SIMPLE_KEY kill s_bool}
[/tag]
[tag]
name="store_reachable_locations"
max=infinite
{INSERT_TAG}
{DEFAULT_KEY range reachable_range movement}
{DEFAULT_KEY moves reachable_moves current}
{SIMPLE_KEY viewing_side s_unsigned}
{REQUIRED_KEY variable string}
{FILTER_TAG "filter" unit (
min=1
{INSERT_TAG}
)}
{FILTER_TAG "filter_location" location {INSERT_TAG}}
[/tag]
[tag]
name="store_map_dimensions"
max=infinite
{DEFAULT_KEY variable string "map_size"}
[/tag]
[tag]
name="store_time_of_day"
max=infinite
{SIMPLE_KEY x s_unsigned}
{SIMPLE_KEY y s_unsigned}
{DEFAULT_KEY variable string "time_of_day"}
{SIMPLE_KEY turn s_unsigned}
[/tag]
[tag]
name="store_turns"
max=infinite
{DEFAULT_KEY variable string turns}
[/tag]
[tag]
name="store_unit_defense"
max=infinite
super="$filter_unit"
{SIMPLE_KEY loc_x s_unsigned}
{SIMPLE_KEY loc_y s_unsigned}
{SIMPLE_KEY terrain terrain_code}
{SIMPLE_KEY variable string}
[/tag]
[tag]
name="store_unit_defense_on"
max=infinite
super="$filter_unit"
{SIMPLE_KEY loc_x s_unsigned}
{SIMPLE_KEY loc_y s_unsigned}
{SIMPLE_KEY terrain terrain_code}
{SIMPLE_KEY variable string}
[/tag]
[tag]
name="store_unit_type"
max=infinite
{REQUIRED_KEY type string}
{SIMPLE_KEY variable string}
[/tag]
[tag]
name="store_unit_type_ids"
max=infinite
{SIMPLE_KEY variable string}
[/tag]
[tag]
name="store_villages"
max=infinite
super="$action_wml/store_locations"
deprecated=yes
[/tag]
[tag]
name="store_items"
max=infinite
super="$action_wml/store_locations"
{SIMPLE_KEY item_name string}
[/tag]
[tag]
name="store_relative_direction"
max=infinite
{INSERT_TAG}
{REQUIRED_KEY variable string}
{SIMPLE_KEY mode s_unsigned} # TODO: This should really be an enum type
[tag]
name="source"
min=1
{SIMPLE_KEY x s_unsigned}
{SIMPLE_KEY y s_unsigned}
[/tag]
[tag]
name="destination"
min=1
{SIMPLE_KEY x s_unsigned}
{SIMPLE_KEY y s_unsigned}
[/tag]
[/tag]
[tag]
name="find_path"
max=infinite
{INSERT_TAG}
{SIMPLE_KEY variable string}
{DEFAULT_KEY allow_multiple_turns s_bool no}
{DEFAULT_KEY check_visibility s_bool no}
{DEFAULT_KEY check_teleport s_bool yes}
{DEFAULT_KEY check_zoc s_bool yes}
{DEFAULT_KEY nearest_by find_path_nearest_by movement_cost}
{FILTER_TAG "traveler" unit (
min=1
{INSERT_TAG}
)}
{FILTER_TAG "destination" location (
min=1
{INSERT_TAG}
)}
[/tag]
[tag]
name="unit_worth"
max=infinite
super="$filter_unit"
{INSERT_TAG}
[/tag]
[tag]
name="clear_variable"
max=infinite
{REQUIRED_KEY name string_list}
[/tag]
[tag]
name="sync_variable"
max=infinite
{SIMPLE_KEY name string}
[/tag]
[tag]
name="fire_event"
max=infinite
{INSERT_TAG}
{SIMPLE_KEY name string}
{SIMPLE_KEY id string}
{FILTER_TAG "primary_unit" unit {INSERT_TAG}}
{FILTER_TAG "secondary_unit" unit {INSERT_TAG}}
{FILTER_TAG "primary_attack" weapon {INSERT_TAG}}
{FILTER_TAG "secondary_attack" weapon {INSERT_TAG}}
{DATA_TAG data 0 1 string}
[/tag]
[tag]
name="remove_event"
max=infinite
{REQUIRED_KEY id string}
[/tag]
[tag]
name="role"
max=infinite
super="$filter_unit"
{INSERT_TAG}
{SIMPLE_KEY role string}
{SIMPLE_KEY type string_list}
{DEFAULT_KEY search_recall_list search_recall_list yes}
{DEFAULT_KEY reassign s_bool yes}
{ACTION_TAG else max=infinite}
[tag]
name="auto_recall"
{DEFAULT_KEY show s_bool yes}
{DEFAULT_KEY fire_event s_bool no}
{DEFAULT_KEY check_passability s_bool yes}
{SIMPLE_KEY facing dir}
{SIMPLE_KEY x s_coordinates}
{SIMPLE_KEY y s_coordinates}
{SIMPLE_KEY location_id string}
[/tag]
[/tag]
[tag]
name="random_placement"
max=infinite
{INSERT_TAG}
{REQUIRED_KEY num_items f_unsigned,s_unsigned,s_int_percent}
{REQUIRED_KEY variable string}
{DEFAULT_KEY min_distance s_unsigned 0}
{DEFAULT_KEY allow_less s_bool no}
{FILTER_TAG "filter_location" location {INSERT_TAG}}
{ACTION_TAG "command" min=1}
[/tag]
{EMPTY_TAG "break" 0 infinite}
{EMPTY_TAG "continue" 0 infinite}
{EMPTY_TAG "return" 0 infinite}
[tag]
name="micro_ai"
max=infinite
{INSERT_TAG}
{REQUIRED_KEY ai_type string}
{REQUIRED_KEY side s_unsigned_range_list}
{REQUIRED_KEY action micro_ai_action}
{SIMPLE_KEY ca_id string}
[if]
[not]
action=delete
[/not]
[then]
super="$ai/micro_ai"
[/then]
[/if]
[/tag]
# Undocumented tags (or at least not linked from ActionWML wiki page)
[tag]
name="add_ai_behaviour"
max=infinite
deprecated=yes
{FILTER_TAG "filter" unit min=1}
{REQUIRED_KEY side s_unsigned}
{DEFAULT_KEY sticky s_bool no}
{DEFAULT_KEY loop_id string main_loop}
{SIMPLE_KEY evaluation string}
{SIMPLE_KEY execution string}
{SIMPLE_KEY bca_id string}
[/tag]
{ACTION_TAG "unsynced" max=infinite}
[tag]
name="clear_global_variable"
{REQUIRED_KEY global string}
{REQUIRED_KEY namespace string}
{DEFAULT_KEY side s_unsigned,global global}
{DEFAULT_KEY immediate s_bool no}
[/tag]
[tag]
name="get_global_variable"
{REQUIRED_KEY from_global string}
{REQUIRED_KEY to_local string}
{REQUIRED_KEY namespace string}
{DEFAULT_KEY side s_unsigned,global global}
[/tag]
[tag]
name="set_global_variable"
{REQUIRED_KEY to_global string}
{REQUIRED_KEY from_local string}
{REQUIRED_KEY namespace string}
{DEFAULT_KEY side s_unsigned,global global}
{DEFAULT_KEY immediate s_bool no}
[/tag]
[tag]
name="store_rotate_map_location"
max=infinite
{INSERT_TAG}
{REQUIRED_KEY variable string}
{DEFAULT_KEY angle s_int 1}
{SIMPLE_KEY mode s_unsigned} # TODO: This should really be an enum type
[tag]
name="source"
min=1
{SIMPLE_KEY x s_unsigned}
{SIMPLE_KEY y s_unsigned}
[/tag]
[tag]
name="destination"
min=1
{SIMPLE_KEY x s_unsigned}
{SIMPLE_KEY y s_unsigned}
[/tag]
[/tag]
any_tag=yes
[/tag]