Reset achievements for UMC campaign?

The place to post your WML questions and answers.

Moderator: Forum Moderators

Forum rules
  • Please use [code] BBCode tags in your posts for embedding WML snippets.
  • To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
User avatar
Spannerbag
Posts: 537
Joined: December 18th, 2016, 6:14 pm
Location: Yes

Reset achievements for UMC campaign?

Post by Spannerbag »

Apologies if |I've missed something but it seems to me that once an achievement is set, that's it?
I haven't tested this exhaustively but that's been my experience so far.

Is there a way to unset achievements - or are they auto-unset at some point?

I am working on adding achievements to my campaign Leafsea Burning and I also give the player an in-game bonus if they complete an achievement.
However whilst the WML code to monitor and provide (or not) said bonus will be executed every time the campaign is replayed, the achievements don't seem to reset, tho' I haven't actually yet been able to finish the campaign and re-test as it's a work in progress.

I can manually reset achievements by editing the preferences file and simply deleting the relevant entry:

Code: Select all

[achievements]
	content_for="LSB"
	ids="LCT"
	[in_progress]
		id="HItop"
		progress_at=1
	[/in_progress]
[/achievements]
so if all else fails would it be possible to write a lua routine to modify preferences (assuming it doesn't risk adding potential vulnerabilities to the game)?

In my case this could be called in the first scenario's preload event perhaps?

Any thought/comments greatly appreciated and if this can be done and I've missed it please enlighten me!

Thanks in advance,
-- Spannerbag
SP Campaigns: After EI (v1.14) Leafsea Burning (v1.17, v1.16)
I suspect the universe is simpler than we think and stranger than we can know.
Also, I fear that beyond a certain point more intelligence does not necessarily benefit a species...
User avatar
Pentarctagon
Project Manager
Posts: 5566
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: Reset achievements for UMC campaign?

Post by Pentarctagon »

It's not currently possible aside from manually editing the preferences file.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
User avatar
Spannerbag
Posts: 537
Joined: December 18th, 2016, 6:14 pm
Location: Yes

Re: Reset achievements for UMC campaign?

Post by Spannerbag »

Pentarctagon wrote: March 10th, 2024, 4:31 pm It's not currently possible aside from manually editing the preferences file.
Pity... oh well at least I know for sure.
Thanks for that, very helpful.

Cheers!
-- Spannerbag
SP Campaigns: After EI (v1.14) Leafsea Burning (v1.17, v1.16)
I suspect the universe is simpler than we think and stranger than we can know.
Also, I fear that beyond a certain point more intelligence does not necessarily benefit a species...
User avatar
Spannerbag
Posts: 537
Joined: December 18th, 2016, 6:14 pm
Location: Yes

Re: Reset achievements for UMC campaign?

Post by Spannerbag »

Further to my last post, does anyone know if there are any plans to add the capability to clear/reset/unset achievements - and if so, how (WML, lua etc.)?

Cheers!
-- Spannerbag
SP Campaigns: After EI (v1.14) Leafsea Burning (v1.17, v1.16)
I suspect the universe is simpler than we think and stranger than we can know.
Also, I fear that beyond a certain point more intelligence does not necessarily benefit a species...
User avatar
Pentarctagon
Project Manager
Posts: 5566
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: Reset achievements for UMC campaign?

Post by Pentarctagon »

A button or a command line option wouldn't be too hard. Doing it via WML/lua wouldn't be hard either, but I wouldn't want to add that functionality there due to the risk of achievements accidentally getting cleared when they shouldn't be due to a bug or someone deciding to intentionally try to wipe other players' achievements.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
User avatar
Spannerbag
Posts: 537
Joined: December 18th, 2016, 6:14 pm
Location: Yes

Re: Reset achievements for UMC campaign?

Post by Spannerbag »

Pentarctagon wrote: March 17th, 2024, 6:18 pm A button or a command line option wouldn't be too hard. Doing it via WML/lua wouldn't be hard either, but I wouldn't want to add that functionality there due to the risk of achievements accidentally getting cleared when they shouldn't be due to a bug or someone deciding to intentionally try to wipe other players' achievements.
Ah, understood.
I was talking about single player campaigns.
No idea which (if any) of the following are feasible but these thoughts come to mind:
  • Add to [achievement] the tag resettable that only allows that [achievement] to be reset.
    I assume undeclared variables always evaluate to false, so existing [achievement]s cannot be reset by default.
  • As above but for the whole campaign and set within [campaign] tag rather than [achievement].
    Could be restricted to type=sp and not mp or hybrid.
  • Alternatively (or as well as) the above, have another [achievement] tag; auto_reset which resets achievement(s) every time the campaign is replayed from the start (I assume this would happen regardless of difficulty).
    Again this could be implemented within [campaign] tag or [achievement].
    This option removes any player intervention and is setup by the campaign designer.
    (OK, a player could edit their local copy but without going into more exotic and complex ideas that would surely be more troublesome to code I'll stop here and get feedback on these suggestions first.)
I assume it's easier to reset all [achievement]s for a whole campaign rather than specify individual ones?
If so I, at least, would be very happy with that.
I.e. within a given campaign all [achievement]s can be reset or not; the same logic applies to them all.

I understand these are all WML based solutions, but do you think any are viable?

Cheers!
-- Spannerbag
SP Campaigns: After EI (v1.14) Leafsea Burning (v1.17, v1.16)
I suspect the universe is simpler than we think and stranger than we can know.
Also, I fear that beyond a certain point more intelligence does not necessarily benefit a species...
User avatar
Pentarctagon
Project Manager
Posts: 5566
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: Reset achievements for UMC campaign?

Post by Pentarctagon »

Is there a reason that it needs to be a WML-based solution?
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
User avatar
Ravana
Forum Moderator
Posts: 3011
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: Reset achievements for UMC campaign?

Post by Ravana »

Without WML, the solution is to show error message to user telling to delete the achievement, and [end_level] defeat at start. WML based deletion would provide better user experience.
gfgtdf
Developer
Posts: 1432
Joined: February 10th, 2013, 2:25 pm

Re: Reset achievements for UMC campaign?

Post by gfgtdf »

The main point here is that currently achievement are not supposed to be reset, for example neither steam nor playstation achievements reset when a player restarts a game, and some players would probably be really upset if they did.

If op wants to give the player a certain bonus during a run for doing something he can always just use a wml variable to remember whether something was achieved in that run or not (in particular for 1.18 which is feature frozen and won't get any changes to the achievements api anymore).
Scenario with Robots SP scenario (1.11/1.12), allows you to build your units with components, PYR No preperation turn 1.12 mp-mod that allows you to select your units immideately after the game begins.
User avatar
Spannerbag
Posts: 537
Joined: December 18th, 2016, 6:14 pm
Location: Yes

Re: Reset achievements for UMC campaign?

Post by Spannerbag »

Pentarctagon wrote: March 18th, 2024, 2:35 pm Is there a reason that it needs to be a WML-based solution?
Heh, only because your previous post gave me the impression WML/lua wasn't a favoured option. :)
Apologies if I misunderstood your post.

Pentarctagon wrote: March 17th, 2024, 6:18 pm ...Doing it via WML/lua wouldn't be hard either, but I wouldn't want to add that functionality there due to the risk of achievements accidentally getting cleared when they shouldn't be due to a bug or someone deciding to intentionally try to wipe other players' achievements.
Cheers!
-- Spannerbag
SP Campaigns: After EI (v1.14) Leafsea Burning (v1.17, v1.16)
I suspect the universe is simpler than we think and stranger than we can know.
Also, I fear that beyond a certain point more intelligence does not necessarily benefit a species...
User avatar
Spannerbag
Posts: 537
Joined: December 18th, 2016, 6:14 pm
Location: Yes

Re: Reset achievements for UMC campaign?

Post by Spannerbag »

gfgtdf wrote: March 18th, 2024, 3:29 pm The main point here is that currently achievement are not supposed to be reset, for example neither steam nor playstation achievements reset when a player restarts a game, and some players would probably be really upset if they did.
Ah, hadn't realised that Wesnoth's achievements had to be behaviourally compatible with other platforms. My bad.
However, what I'm proposing would not be compulsory, if campaign designers wanted that behaviour then that could be the default.
I wouldn't want to upset other players but by the same token I feel this could add something to game enjoyment.


gfgtdf wrote: March 18th, 2024, 3:29 pm If op wants to give the player a certain bonus during a run for doing something he can always just use a wml variable to remember whether something was achieved in that run or not (in particular for 1.18 which is feature frozen and won't get any changes to the achievements api anymore).

Yep, I've already put a note in the campaign description in _main.cfg:

Completing achievements in this campaign garners in-game bonuses.
At present there is no official way to reset achievements.
However, regardless of whether achievements are already completed or not, when playing this campaign the in-game bonuses will always be obtained when the corresponding achievement condition is satisfied.



So, as 1.18 is feature frozen I'll remove the struck-through text above.
Alternatively, would it be preferable to not portray these in-game bonuses as "achievements" because they can be obtained every time the campaign is played (and so aren't really achievements in the Wesnoth sense)?
For me, the important thing is the bonus repeatability, not completing the achievement.
Would appreciate some opinions here - I don't want to clash with player expectations.

Cheers!
-- Spannerbag
SP Campaigns: After EI (v1.14) Leafsea Burning (v1.17, v1.16)
I suspect the universe is simpler than we think and stranger than we can know.
Also, I fear that beyond a certain point more intelligence does not necessarily benefit a species...
gnombat
Posts: 710
Joined: June 10th, 2010, 8:49 pm

Re: Reset achievements for UMC campaign?

Post by gnombat »

Spannerbag wrote: March 19th, 2024, 10:21 am Alternatively, would it be preferable to not portray these in-game bonuses as "achievements" because they can be obtained every time the campaign is played (and so aren't really achievements in the Wesnoth sense)?
Maybe. There are some other campaigns which have something like "achievements" but which aren't actually achievements in the Wesnoth sense. You might want to take a look at how they handle things.

Some examples:
  • A New Order
  • A Sanguine Tale
User avatar
Pentarctagon
Project Manager
Posts: 5566
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: Reset achievements for UMC campaign?

Post by Pentarctagon »

Wesnoth doesn't actually have a concept of a specific playthrough for a campaign - it can't tell if you're playing a campaign for the first time or the eighth time, so if you want something that's specific just to the particular playthrough then you would need to implement that yourself.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
gfgtdf
Developer
Posts: 1432
Joined: February 10th, 2013, 2:25 pm

Re: Reset achievements for UMC campaign?

Post by gfgtdf »

Spannerbag wrote: March 19th, 2024, 10:21 am
gfgtdf wrote: March 18th, 2024, 3:29 pm The main point here is that currently achievement are not supposed to be reset, for example neither steam nor playstation achievements reset when a player restarts a game, and some players would probably be really upset if they did.
Ah, hadn't realised that Wesnoth's achievements had to be behaviourally compatible with other platforms. My bad.
However, what I'm proposing would not be compulsory, if campaign designers wanted that behaviour then that could be the default.
I wouldn't want to upset other players but by the same token I feel this could add something to game enjoyment.

I mean it doesn't have to be equivalent for technical reasons, but imo most players would simply expect them to behave the same way as they are used to from other platforms.
Scenario with Robots SP scenario (1.11/1.12), allows you to build your units with components, PYR No preperation turn 1.12 mp-mod that allows you to select your units immideately after the game begins.
User avatar
Spannerbag
Posts: 537
Joined: December 18th, 2016, 6:14 pm
Location: Yes

Re: Reset achievements for UMC campaign?

Post by Spannerbag »

Pentarctagon wrote: March 19th, 2024, 3:10 pm Wesnoth doesn't actually have a concept of a specific playthrough for a campaign - it can't tell if you're playing a campaign for the first time or the eighth time, so if you want something that's specific just to the particular playthrough then you would need to implement that yourself.
Heh, nothing that complicated. :)
All I'm exploring is whether the option exists to reset achievements each time a player selects a campaign.
(Yes there are considerations regarding whether or not the player is currently part way through the same campaign etc.)

But now I know this is unsupported I'll explore other options.
Thanks for your help.

Cheers!
-- Spannerbag
SP Campaigns: After EI (v1.14) Leafsea Burning (v1.17, v1.16)
I suspect the universe is simpler than we think and stranger than we can know.
Also, I fear that beyond a certain point more intelligence does not necessarily benefit a species...
Post Reply