ActionWML

From The Battle for Wesnoth Wiki
Revision as of 17:16, 5 August 2012 by BettyMorgan (talk | contribs) (minor updates)

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 with wesnoth.register_wml_action (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] 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 be interpreted differently (there may be some tags which are both ActionWML and have similar or different meanings in other places, like [event]).

NASA Announces Undersea Exploration Mission

An international team of aquanauts will travel again to the bottom of the Atlantic Ocean to simulate a visit to an asteroid in the 16th expedition of NASA Extreme Environment Mission Operations (NEEMO).

[NASA Announces Undersea Exploration Mission]

[GoodvilleNews.com - good, positive news, inspirational stories, articles]

Why You Should Always Trust Yourself

Trust yourself. You know more than you think you do. Benjamin SpockAs time passes by and the more work you will do on discovering and improving yourself, the more you will realize that the ancient Latin quotation: Ne te quaesiveris extra - Do not look outside of yourself for the truth, is true.

[Why You Should Always Trust Yourself]

[GoodvilleNews.com - good, positive news, inspirational stories, articles]

What Is Your Legacy? Living A Meaningful life

I want the world to be better because I was here. I want my life, I want my work, my family, I want it to mean something and if you are not making someone elses life better then you are wasting your time Will Smith

[What Is Your Legacy? Living A Meaningful life]

[GoodvilleNews.com - good, positive news, inspirational stories, articles]

5 Great Lessons You Can Learn From Life

Life isnt meant to be easy, its meant to be lived..sometimes happy, other times rough. But with every up and down you learn lessons that make you strong.Can you step back from your own mind for a little while and realize that life is not as bad as you think it is?

[5 Great Lessons You Can Learn From Life]

[GoodvilleNews.com - good, positive news, inspirational stories, articles]

Cat Saves Owner Hours After Adoption

A newly-adopted cat repaid his owners loving gesture earlier this month by saving her from a medical emergency just hours after he was brought home, the Green Bay Press Gazette reports.

[Cat Saves Owner Hours After Adoption]

[GoodvilleNews.com - good, positive news, inspirational stories, articles]