AchievementsWML
From The Battle for Wesnoth Wiki
(Version 1.17.13 and later only)
Achievements
Achievements are defined in an achievements.cfg file located at the root directory of an add-on (in the same folder as the _main.cfg). The WML in the achievements.cfg file is loaded completely independently of any other WML in your add-on or in mainline Wesnoth - this means you do not have access to any macros that are not defined in this file nor the context setup by the [binary_path].
[achievement_group]
The following keys and tags are recognized in [achievement_group] tags:
- content_for: The internal identifier for this group of achievements. The standard usage would be to have this be unique per add-on or per piece of content (campaign, modification, etc), however there is no limitation on how achievement groups are declared - an add-on can define as many achievement groups as it wants. If multiple achievements groups are defined with the same content_for value, then their achievements are merged into a single combined list.
- display_name: (translatable) The text to be displayed on the content dropdown of the achievements dialog.
- [achievement]: See below.
[achievement]
The following keys are recognized in [achievement] tags:
- id: (required) The internal ID to be used when identifying this achievement. Must be unique within an [achievements_group].
- name: (required) (translatable) The achievement name to display on the achievements dialog.
- name_completed: (translatable) (optional) The achievement name to display on the achievements dialog when this achievement has been completed.
- description: (required) (translatable) The achievement description to display on the achievements dialog.
- description_completed: (translatable) (optional) The achievement description to display on the achievements dialog when this achievement has been completed.
- icon: The image to display next to this achievement on the achievements dialog, scaled to be 60x60 pixels. This must be the full path to the image! For example -
data/core/images/icons/potion_green_small.png
(mainline) ordata/add-ons/YourAddon/images/icons/some_image.png
(add-on). - icon_completed: (optional) The image to display next to this achievement on the achievements dialog when this achievement has been completed, scaled to be 60x60 pixels. This must be the full path to the image! For example -
data/core/images/icons/potion_green_small.png
(mainline) ordata/add-ons/YourAddon/images/icons/some_image.png
(add-on). - hidden: (optional) When set to yes, the achievement is not shown in the achievements dialog until it is completed. Default: no.
- max_progress: (optional) The progress value at which this achievement is considered to be complete.
- sound: (optional) The path to a sound to play when the achievement is completed. This must be the full path to the image! For example -
data/core/sounds/dwarf-laugh.wav
(mainline) ordata/add-ons/YourAddon/sounds/some_sound.ogg
(add-on).