Difference between revisions of "UsefulWMLFragments"

From The Battle for Wesnoth Wiki
m (Useful WML Fragments)
(Useful WML Fragments)
Line 2: Line 2:
  
 
Most of the things found here are macros (see [[PreprocessorRef]]) that may 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.
 
Most of the things found here are macros (see [[PreprocessorRef]]) that may 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.
 +
[[WML Templates]]: Generic campaign, scenario and unit templates.
  
''The reorganization of this page is still incomplete. Scroll down to see the contents of the old page.''
+
-------------------------------------------------------------------
 +
''There is overlap between WML_Utilities, ProgrammingMacros, and WML_Macros.
 +
Working on resolving this.''
  
[[WML Templates]]: Generic campaign, scenario and unit templates.
+
[[WML Utilities]]: Convenient shortcuts for the most common tasks, such as variable formatting, storing/unstoring and modifying of units, and so on. Also some utility macros for more complex tasks, such as mirroring hex coordinates. Generally useful, scenario-independent little helpers.
 +
 
 +
[[ProgrammingMacros]]: Definitions for some low-level macros to make it easier to write program-like WML.
  
[[WML Utilities]]: Convenient shortcuts for the most common tasks, such as variable formatting, storing/unstoring and modifying of units, and so on. Also some utility macros for more complex tasks, such as mirroring hex coordinates. Generally useful, scenario-independent little helpers.
+
[[WML Macros]]: Convenient shortcuts for the most common tasks, such as variable formatting, storing/unstoring and modifying of units, and so on.
 +
-------------------------------------------------------------------
  
 
[[WML Scenario Tools]]: Branch on Village Type, Recruit from a Ship.
 
[[WML Scenario Tools]]: Branch on Village Type, Recruit from a Ship.
Line 15: Line 21:
 
[[RandomTraitUnit]]: A series of macros to create a unit with two random traits.
 
[[RandomTraitUnit]]: A series of macros to create a unit with two random traits.
  
[[Victory Conditions]]: Number of Villages, Amount of Gold. Also suitable for multiplayer scenarios.
+
[[Victory Conditions]]: Number of Villages, Amount of Gold. Suitable for multiplayer scenarios.
  
 
[[WML Abilities]]: Unit abilities and specials implemented in WML. Cannot currently be incorporated in the unit type definitions themselves, but must be individually included in every scenario in which they should work.
 
[[WML Abilities]]: Unit abilities and specials implemented in WML. Cannot currently be incorporated in the unit type definitions themselves, but must be individually included in every scenario in which they should work.
Line 30: Line 36:
  
 
[[Advanced WML]]: Point Rotation Scheme.
 
[[Advanced WML]]: Point Rotation Scheme.
 
 
 
 
 
-------------------------------------------------------------------
 
[[ProgrammingMacros]]: Definitions for some low-level macros to make it easier to write program-like WML.
 
 
[[WML Macros]]: Convenient shortcuts for the most common tasks, such as variable formatting, storing/unstoring and modifying of units, and so on.
 
  
 
== See Also ==
 
== See Also ==
  
 
* [[ReferenceWML]]
 
* [[ReferenceWML]]

Revision as of 23:28, 30 July 2006

Useful WML Fragments

Most of the things found here are macros (see PreprocessorRef) that may 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. WML Templates: Generic campaign, scenario and unit templates.


There is overlap between WML_Utilities, ProgrammingMacros, and WML_Macros. Working on resolving this.

WML Utilities: Convenient shortcuts for the most common tasks, such as variable formatting, storing/unstoring and modifying of units, and so on. Also some utility macros for more complex tasks, such as mirroring hex coordinates. Generally useful, scenario-independent little helpers.

ProgrammingMacros: Definitions for some low-level macros to make it easier to write program-like WML.

WML Macros: Convenient shortcuts for the most common tasks, such as variable formatting, storing/unstoring and modifying of units, and so on.


WML Scenario Tools: Branch on Village Type, Recruit from a Ship.

MoveExistingUnit: A general way to move a unit from one place to another, displaying its movement.

RandomTraitUnit: A series of macros to create a unit with two random traits.

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

WML Abilities: Unit abilities and specials implemented in WML. Cannot currently be incorporated in the unit type definitions themselves, but must be individually included in every scenario in which they should work.

WML Buildings: The Basic Building Template, Light House, Wishing Well #1, Wishing Well #2.

DroppableItem: A macro to create items that units can carry, that are left on the ground when those units die.

A Shop Like Thing: How to add even more RPG elements to your scenarios.

PseudoRandom: A replacement for {RANDOM} in multiplayer, where {RANDOM} is buggy.

Rain effect: Creating an overlay of rain in a scenario.

Advanced WML: Point Rotation Scheme.

See Also