Difference between revisions of "ActionWML"
From The Battle for Wesnoth Wiki
m (+ Category:ActionsWML) |
(→Where ActionWML can be used: Acknowledge other types of loops) |
||
(9 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
+ | {{WML Tags}} | ||
'''ActionWML''' is a summarizing term for all '''WML actions''' which can be used in events and some other places. | '''ActionWML''' is a summarizing term for all '''WML actions''' which can be used in events and some other places. | ||
== Types of ActionWML == | == Types of ActionWML == | ||
− | When a tag permits ActionWML, this means that it permits | + | When a tag permits ActionWML as content, this means that it permits a sequence of any of the following tags: |
* direct actions ([[DirectActionsWML]]) which have a direct effect on gameplay | * direct actions ([[DirectActionsWML]]) which have a direct effect on gameplay | ||
Line 10: | Line 11: | ||
* conditional actions ([[ConditionalActionsWML]]) which contain other actions, which then are (maybe) executed ([if], [switch], [while], [command]) | * conditional actions ([[ConditionalActionsWML]]) which contain other actions, which then are (maybe) executed ([if], [switch], [while], [command]) | ||
* [event] (see [[EventWML#Nested Events|EventWML]]) which creates a new event handler | * [event] (see [[EventWML#Nested Events|EventWML]]) which creates a new event handler | ||
− | ** note: [event] can also be a subtag of [unit], [era] and [scenario], where it would not be counted as ActionWML (but has the same syntax). | + | ** note: [event] can also be a subtag of [unit], [era] and [scenario], where it would not be counted as ActionWML (but has nearly the same syntax). |
* [lua] ([[LuaWML]]) which contains Lua code to be executed, and | * [lua] ([[LuaWML]]) which contains Lua code to be executed, and | ||
− | * all tags created from lua | + | * all tags created from lua in [[LuaWML:Events#wesnoth.wml_actions|wesnoth.wml_actions]] (if they don't fit in one of the categories above) |
+ | When the ActionWML is executed, all its action tags are executed in order. | ||
== Where ActionWML can be used == | == Where ActionWML can be used == | ||
− | ActionWML can be used | + | ActionWML can be used: |
* inside an [event], to define a event handler (see [[EventWML]]), | * inside an [event], to define a event handler (see [[EventWML]]), | ||
* inside a [then] or [else] of an [if] tag (see [[ConditionalActionsWML]]), | * inside a [then] or [else] of an [if] tag (see [[ConditionalActionsWML]]), | ||
− | * inside a [case] or [else | + | * inside a [case] or [else] of a [switch] tag (see [[ConditionalActionsWML]]), |
− | * inside the [do] of a [while] tag (see [[ConditionalActionsWML]]), | + | * inside the [do] of a [while] or other loop tag (see [[ConditionalActionsWML]]), |
* inside a [command] tag (in [option] or [set_menu_item] or directly as ActionWML) (see [[InterfaceActionsWML]]), | * inside a [command] tag (in [option] or [set_menu_item] or directly as ActionWML) (see [[InterfaceActionsWML]]), | ||
* in certain Lua-created tags (if the registered WML action handler interprets the content as ActionWML). | * in certain Lua-created tags (if the registered WML action handler interprets the content as ActionWML). | ||
− | + | In most other places, ActionWML code may be ignored or give error messages. In some cases it will be interpreted differently – there are some tags which are ActionWML and also have similar or different meanings in other places, like [event], [item], or [object]. | |
[[Category:ActionsWML]] | [[Category:ActionsWML]] | ||
+ | [[Category:WML Reference]] |
Latest revision as of 09:22, 5 December 2022
ActionWML is a summarizing term for all WML actions which can be used in events and some other places.
Types of ActionWML
When a tag permits ActionWML as content, this means that it permits a sequence of any of the following tags:
- direct actions (DirectActionsWML) which have a direct effect on gameplay
- display actions (InterfaceActionsWML) which show something to the user
- internal actions (InternalActionsWML) which are used by WML internally
- conditional actions (ConditionalActionsWML) which contain other actions, which then are (maybe) executed ([if], [switch], [while], [command])
- [event] (see EventWML) which creates a new event handler
- note: [event] can also be a subtag of [unit], [era] and [scenario], where it would not be counted as ActionWML (but has nearly the same syntax).
- [lua] (LuaWML) which contains Lua code to be executed, and
- all tags created from lua in wesnoth.wml_actions (if they don't fit in one of the categories above)
When the ActionWML is executed, all its action tags are executed in order.
Where ActionWML can be used
ActionWML can be used:
- inside an [event], to define a event handler (see EventWML),
- inside a [then] or [else] of an [if] tag (see ConditionalActionsWML),
- inside a [case] or [else] of a [switch] tag (see ConditionalActionsWML),
- inside the [do] of a [while] or other loop tag (see ConditionalActionsWML),
- inside a [command] tag (in [option] or [set_menu_item] or directly as ActionWML) (see InterfaceActionsWML),
- in certain Lua-created tags (if the registered WML action handler interprets the content as ActionWML).
In most other places, ActionWML code may be ignored or give error messages. In some cases it will be interpreted differently – there are some tags which are ActionWML and also have similar or different meanings in other places, like [event], [item], or [object].
This page was last edited on 5 December 2022, at 09:22.