Difference between revisions of "ActionWML"

From The Battle for Wesnoth Wiki
(new page: ActionWML (to bundle information from other places).)
 
m (formatting, some additions.)
Line 2: Line 2:
  
 
== Types of ActionWML ==
 
== Types of ActionWML ==
 +
 +
When a tag permits ActionWML, this means that it permits all of the following:
  
 
* direct actions ([[DirectActionsWML]]) which have a direct effect on gameplay
 
* direct actions ([[DirectActionsWML]]) which have a direct effect on gameplay
 
* display actions ([[InterfaceActionsWML]]) which show something to the user
 
* display actions ([[InterfaceActionsWML]]) which show something to the user
 
* internal actions ([[InternalActionsWML]]) which are used by WML internally
 
* 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])
 
 
* conditional actions ([[ConditionalActionsWML]]) which contain other actions, which then are executed on certain conditions
 
 
* [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).
 
* [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 with [[LuaWML:Events#wesnoth.register_wml_action|wesnoth.register_wml_action]] (if they don't fit in one of the categories above)
 
* all tags created from lua with [[LuaWML:Events#wesnoth.register_wml_action|wesnoth.register_wml_action]] (if they don't fit in one of the categories above)
Line 17: Line 18:
  
 
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} of a [switch] tag  (see [[ConditionalActionsWML]]).
+
* 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] 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).
 +
 
 +
 
 +
On most other places ActionWML code will either be ignored, give error messages or interpreted differently (there are some tags which are ActionWML and have other meanings in other places, like [event] or [variable]).

Revision as of 19:31, 10 January 2011

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, this means that it permits all of the following:

  • 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 the same syntax).
  • [lua] (LuaWML) which contains Lua code to be executed, and
  • all tags created from lua with wesnoth.register_wml_action (if they don't fit in one of the categories above)


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] 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).


On most other places ActionWML code will either be ignored, give error messages or interpreted differently (there are some tags which are ActionWML and have other meanings in other places, like [event] or [variable]).