Jump to content
  • 0
Phodex Games

How to set a Steam Achievement

Question

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.

Share this post


Link to post

4 answers to this question

Recommended Posts

  • 1

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 2

Share this post


Link to post
  • 0

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.

Share this post


Link to post
  • 0
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".

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   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.

×
×
  • Create New...