Difference between revisions of "UsefulWMLFragments"

From The Battle for Wesnoth Wiki
m (Unit Tools)
m (Useful WML Fragments: correcting link)
Line 4: Line 4:
  
 
Some things '''not''' to do here:
 
Some things '''not''' to do here:
* Don't add macros that duplicate things in [http://www.wesnoth.org/misc/macro-reference.xhtml the core macro library].
+
* Don't add macros that duplicate things in [http://www.wesnoth.org/macro-reference.xhtml the core macro library].
 
* Don't add macros that are trivial syntax shortcuts.
 
* Don't add macros that are trivial syntax shortcuts.
 
* Don't add macros that generate unbalanced syntax fragments.
 
* Don't add macros that generate unbalanced syntax fragments.

Revision as of 18:59, 9 March 2008

Useful WML Fragments

Most of the things found here are macros (see PreprocessorRef) that must be copied into a scenario file or another file included first by the campaign, and then used in the scenario (or multiplayer map). Remember that a macro cannot be used at a point before it is defined.

Some things not to do here:

  • Don't add macros that duplicate things in the core macro library.
  • Don't add macros that are trivial syntax shortcuts.
  • Don't add macros that generate unbalanced syntax fragments.

Try to avoid adding pages here. It is better to find a category in which your code fits and add it to that page.

Logic Structure Macros

  • WML Utilities: Macros to assist other macros. Filter by Terrain. Iterate. Overlay with Filter. Determine Opposite Coordinates.

Campaign Tools

  • Victory Conditions: Number of Villages, Amount of Gold. Suitable for multiplayer scenarios.

Map Tools

Unit Tools

  • WML Abilities: Knockback. Charm. Bloodlust. Abilities cannot currently be incorporated in the unit type definitions themselves, but must be included in the scenario file.
  • WML Buildings: Generic Buildings, Light House/Dark Tower, Wishing Well #1, Wishing Well #2.

Item Tools

  • DroppableItem: Macros to drop items. Currently only macros for dropping items on unit death including a permenant item that can be picked up, and dropped, multiple times by different units.

Advanced WML

  • Advanced WML: Branch on Village Type. Recruit from a Ship. Point Rotation Scheme.

Templates

  • WML Templates: Generic campaign, scenario and unit templates. (updated)

See Also