Commit Graph

10 Commits

Author SHA1 Message Date
rodolphecombe
f68c4e8163
Add [have_side] tag 2025-03-11 20:11:40 +01:00
Pentarctagon
ad3f1c95b0 Add support for distinct sub-achievements.
This adds support for having up to 28 distinct sub-achievements within a single achievement. This limit exists since wesnoth's layout isn't smart enough to tell a horizontal listbox to actually use its scrollbar instead of forcing a horizontal scrollbar on the whole window.

Additionally this adds the [set_sub_achievement] and [has_sub_achievement] WML tags and their respective lua functions. [has_sub_achievement] is unsafe for use in MP, for the same reasons that [has_achievement] is.
2023-05-17 23:54:16 -05:00
Pentarctagon
d1465a9eb9
Add basic achievements functionality. (#7237)
* Add basic achievements functionality.

This reads the mainline achievements.cfg and then all the achievements of each installed add-on.

This is intentionally handled separately from other WML loading so that:
a) All achievements and their status are able to be displayed on the main menu right after Wesnoth starts and regardless of which add-ons are active.
b) Add-ons can add additional achievements to other content, whether UMC or mainline. For example, a modification that adds more achievements for mainline campaigns.

Marking something as achieved is handled by the new [set_achieved] tag and whether an achievement has been completed can be checked via [has_achievement].

There is no attempt to prevent people from manually editing which achievements they've accomplished.

NOTE: These are *not* in any way related to Steam achievements!
2023-01-21 10:32:45 -06:00
Celtic Minstrel
6d3dd6a175 Support as_type=weapon in [variable]formula= 2022-12-06 01:52:38 -05:00
Celtic Minstrel
6876695e66 Support as_type=unit in [variable]formula= 2022-11-27 13:12:47 -05:00
Celtic Minstrel
516f043e89 Support name= in [lua] ConditionalWML 2022-11-27 13:10:41 -05:00
Celtic Minstrel
67ba27b8a3
Move the end level data accessors to wesnoth.scenario (#5861) 2021-06-17 20:41:48 -04:00
Celtic Minstrel
d2a465a126 Support formula= in [variable] ConditionalWML
(cherry-picked from commit 4e52d62963)
2018-10-07 03:18:12 +00:00
Charles Dang
0103959c36 Cleaned up deprecated API usage in core Lua
[ci skip]
2018-03-13 16:55:36 +11:00
Charles Dang
da3a0ed7cf Added [lua] conditional tag
Also made conditions fail if they encountered a syntax or runtime error. This seems the
more logical behavior than passing.

WML conditional tags were split into their own Lua file. The one in lua/wml/object.lua
relies on local variables so was left there.
2018-01-22 23:03:16 +11:00