Jump to content

How to set a Steam Achievement


 Share

Go to solution Solved by Phodex Games,

Recommended Posts

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.

  • Thanks 1
Link to comment
Share on other sites

  • Solution

For all those facing the same problem, its actually pretty easy. Log into the steam backend and set up an achievement like so:

image.png.cf0a5661de425eef8b333782b04b4833.png

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 :)

  • Like 1
  • Thanks 4
Link to comment
Share on other sites

  • 10 months later...
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:

image.png.cf0a5661de425eef8b333782b04b4833.png

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!!! :):):):)

  • Like 2
  • Thanks 1
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...