Query achievement unlocked

Place to get help with not working mods / modding interface.
Post Reply
Theis
Inserter
Inserter
Posts: 27
Joined: Tue Sep 13, 2022 9:57 am
Contact:

Query achievement unlocked

Post by Theis »

I want to query if a player has unlocked an achievement, but i can find very little information the api.
So maybe someone else knows more?

As far as i can see
There is a table of in game.achievement_prototypes.
There is a LuaAchievementPrototype where there isn't a field/method to indicate it has been unlocked.
There is a method unlock_achievement to unlock an achievement.

But i can't find a way to see if an achievement has actually been unlocked.

Bilka
Factorio Staff
Factorio Staff
Posts: 3123
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Query achievement unlocked

Post by Bilka »

This is not possible because the state of the achievements isn't deterministic (state depends on factors outside of current game) and not saved in the save file (to make it deterministic).
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

Post Reply

Return to “Modding help”