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. Supports Pango markup.
- name_completed: (translatable) (optional) The achievement name to display on the achievements dialog when this achievement has been completed. Supports Pango markup.
- description: (required) (translatable) The achievement description to display on the achievements dialog. Supports Pango markup.
- description_completed: (translatable) (optional) The achievement description to display on the achievements dialog when this achievement has been completed. Supports Pango markup.
- icon: The image to display next to this achievement on the achievements dialog, scaled to be 72x72 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). This will be automatically scaled to 72x72 pixels. If the achievement is incomplete it will be shown in greyscale. - icon_completed: (optional) Overrides icon when the achievement has been completed; defaults to the value of icon.
- 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 sound! For example -
data/core/sounds/dwarf-laugh.wav(mainline) ordata/add-ons/YourAddon/sounds/some_sound.ogg(add-on).
[sub_achievement]
(Version 1.17.17 and later only)
The following keys are recognized in [sub_achievement] tags:
- id: (required) The internal ID to be used when identifying this sub-achievement. Must be unique within an [achievement].
- description: (required) (translatable) The text to display when hovering over the sub-achievement's icon.
- icon: The image to display for to this sub-achievement on the achievements dialog, scaled to be 36x36 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).
A maximum of 28 sub-achievements can be defined for an achievement.
This page was last edited on 28 October 2026, at 08:14.