InternalActionsWMLUnitTags

From The Battle for Wesnoth Wiki
Revision as of 02:32, 23 March 2009 by Voris (talk | contribs) (Initial creation.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

When a unit is stored, all keys and tags in the unit definition may be manipulated, including some others, with [set_variable]. Here is a sample list. (If you have a doubt about what keys are valid or what the valid value range is for each key, code a [store_unit] event, save the game, and examine what keys are in the file.)

  • advances_to
  • alignment
  • alpha
  • attacks_left
  • canrecruit
  • cost
  • experience
  • facing
  • flying
  • gender
  • goto_x
  • goto_y
  • hitpoints
  • id
  • language_name (same as the name key in the unit config)
  • max_experience
  • max_hitpoints
  • max_moves
  • moves
  • overlays
  • resting
  • side
  • type
  • unit_description
  • unrenamable
  • upkeep
  • x
  • y
  • zoc
  • [advancement]
  • [movement_costs]
  • [defense]
  • [resistance]
  • [variables]
  • [status]
  • [attack]
  • [modifications_description]
  • [modifications]

These values are all children of the stored unit variable (it is a container variable) and the bracketed values (advancement, movement_costs, defense, etc.) are, themselves, container variables. Example:

[set_variable]
    name=unit_store.status.poisoned
    value=yes
[/set_variable]