Phodex Games Posted May 5, 2019 Share Posted May 5, 2019 Hi, I want to add steam achievements to my game, but I only found very old threads about the topic. I can't really get it running. I am trying to do this with lua by the way. So I set up a few achievements and published them in the steamworks backend, then after I called Steamworks:Initialize() in my game I just call Steamworks:SetAchievement(API Name as string) to unlock an achievement right? This does not work for me, and the function is also not documented. Am I doing something wrong? Thanks! EDIT: Ok solved, I think it does not work with my developer account and the achievement unlock message seems to only be displayed after I closed the game again. 1 Quote Link to comment Share on other sites More sharing options...
Solution Phodex Games Posted May 5, 2019 Author Solution Share Posted May 5, 2019 For all those facing the same problem, its actually pretty easy. Log into the steam backend and set up an achievement like so: Then in leadwerks, if you use lua, just call Steamworks:Initialize() in the main.lua at start. To set an achievement active do this: Steamworks:SetAchievement("STORY_COMPLETE") --And thats all :) Two things to keep in mind and which confused me are: 1. Steam may take a while to display your achievements after you published them, so wait until you see them displaying in the steam store, or when you click on the game in your library. 2. The achievement unlocked popup, will NOT show up while ingame, you only see after you closed the game and an achievement has been unlocked. There are also progressive achievements but the work pretty similar. Little tip: As those functions are not documented, activate auto complete for the Leadwerks IDE and type "Steamworks:" it will display all available functions. Good Luck 1 4 Quote Link to comment Share on other sites More sharing options...
gamecreator Posted May 6, 2019 Share Posted May 6, 2019 Any chance you want to share the code? I'm sure it's straightforward but I wouldn't mind seeing it here, especially since other people might come across this thread. 2 Quote Link to comment Share on other sites More sharing options...
Phodex Games Posted May 8, 2019 Author Share Posted May 8, 2019 On 5/6/2019 at 2:19 AM, gamecreator said: Any chance you want to share the code? I'm sure it's straightforward but I wouldn't mind seeing it here, especially since other people might come across this thread. Sure I will add it to the "best answer". 1 Quote Link to comment Share on other sites More sharing options...
gamecreator Posted May 8, 2019 Share Posted May 8, 2019 3 hours ago, Phodex Games said: Sure I will add it to the "best answer". Thank you. Quote Link to comment Share on other sites More sharing options...
Russell Posted March 19, 2020 Share Posted March 19, 2020 On 5/6/2019 at 12:04 AM, Phodex Games said: For all those facing the same problem, its actually pretty easy. Log into the steam backend and set up an achievement like so: Then in leadwerks, if you use lua, just call Steamworks:Initialize() in the main.lua at start. To set an achievement active do this: Steamworks:SetAchievement("STORY_COMPLETE") --And thats all :) Two things to keep in mind and which confused me are: 1. Steam may take a while to display your achievements after you published them, so wait until you see them displaying in the steam store, or when you click on the game in your library. 2. The achievement unlocked popup, will NOT show up while ingame, you only see after you closed the game and an achievement has been unlocked. There are also progressive achievements but the work pretty similar. Little tip: As those functions are not documented, activate auto complete for the Leadwerks IDE and type "Steamworks:" it will display all available functions. Good Luck I love you man!!! Thanks to this thread I have been able to make 2 things work: - The "Autocomplete" of the code. (Which I didn't know existed for the Script Editor y LE and it's a very welcome and needed feature for me.) - Works OK of my own achievements in my game. Thank you!!! Many thanks for this thread!!! 2 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.