# Anyone managed to unlock a Steam achievement via code (not stats)?

**URL:** <https://forums.solar2d.com/t/anyone-managed-to-unlock-a-steam-achievement-via-code-not-stats/357577>\
**Category:** Win32 Desktop\
**Created:** [October 3, 2025, 8:53pm UTC](https://forums.solar2d.com/t/anyone-managed-to-unlock-a-steam-achievement-via-code-not-stats/357577 "2025-10-03T20:53:38Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![aclementerodrguez](https://forums.solar2d.com/user_avatar/forums.solar2d.com/aclementerodrguez/32/263_2.png) [@aclementerodrguez](https://forums.solar2d.com/u/aclementerodrguez)\
**Post date:** [October 3, 2025, 8:53pm UTC](https://forums.solar2d.com/t/anyone-managed-to-unlock-a-steam-achievement-via-code-not-stats/357577/1 "2025-10-03T20:53:38Z")

</div>

Has anyone been able to **unlock a Steam achievement from code**?  
Note: I’m **not** talking about achievements tied to stats, those unlock fine for me automatically when the stat hits the target value.

What I don’t get is why **steamworks.setAchievementUnlocked()** won’t unlock an achievement that’s **not** stat-based. My code looks solid (as far as I can tell), but it just won’t fire. Any ideas?

---

<div class="post-metadata">

**Author:** ![Il.Sui](https://forums.solar2d.com/user_avatar/forums.solar2d.com/il.sui/32/3223_2.png) [@Il.Sui](https://forums.solar2d.com/u/Il.Sui)\
**Post date:** [October 3, 2025, 10:46pm UTC](https://forums.solar2d.com/t/anyone-managed-to-unlock-a-steam-achievement-via-code-not-stats/357577/2 "2025-10-03T22:46:11Z")

</div>

Hi,  
The only extra care I take is save the unlocked achievements into a file so I can synchronize it with the server later even if the first unlock request will fail.

Since your stats successfully updates (and I guess they are multiple calls), I’m moved to think 1 call may fail for some reasons but a later attempt would succeed?

This or maybe the achievements aren’t configured/exposed properly.

Try to log it and see if it gives you a error or anything

---

<div class="post-metadata">

**Author:** ![aclementerodrguez](https://forums.solar2d.com/user_avatar/forums.solar2d.com/aclementerodrguez/32/263_2.png) [@aclementerodrguez](https://forums.solar2d.com/u/aclementerodrguez)\
**Post date:** [October 3, 2025, 11:25pm UTC](https://forums.solar2d.com/t/anyone-managed-to-unlock-a-steam-achievement-via-code-not-stats/357577/3 "2025-10-03T23:25:45Z")

</div>

> [@aclementerodrguez](#):
>
> steamworks.setAchievementUnlocked()

My issue is that achievements not tied to stats won’t unlock from my code, while the stat-based ones unlock just fine when the stat hits the configured value.

The code is straightforward (I’ve checked it multiple times) and I also keep variable references/flags for unlocked achievements to track them. Still, several users report that those non–stat-based achievements don’t unlock for them either. That’s why I’m starting to think **steamworks.setAchievementUnlocked()** might not be working perfectly, especially since it was added to the Steamworks plugin fairly recently.

---

<div class="post-metadata">

**Author:** ![Il.Sui](https://forums.solar2d.com/user_avatar/forums.solar2d.com/il.sui/32/3223_2.png) [@Il.Sui](https://forums.solar2d.com/u/Il.Sui)\
**Post date:** [October 4, 2025, 7:27am UTC](https://forums.solar2d.com/t/anyone-managed-to-unlock-a-steam-achievement-via-code-not-stats/357577/4 "2025-10-04T07:27:18Z")

</div>

Okay, but I do have non-stats achievements.

I only have non-stats achievements…

So maybe the issue is with having both types mixed together?

We can compare our set-up inside Steam if you want.

Just confirm those achievements have been 100% published and tell me what the log says about those calls, so we can exclude obvious reasons before we start

---

<div class="post-metadata">

**Author:** ![Il.Sui](https://forums.solar2d.com/user_avatar/forums.solar2d.com/il.sui/32/3223_2.png) [@Il.Sui](https://forums.solar2d.com/u/Il.Sui)\
**Post date:** [October 4, 2025, 9:12am UTC](https://forums.solar2d.com/t/anyone-managed-to-unlock-a-steam-achievement-via-code-not-stats/357577/5 "2025-10-04T09:12:39Z")

</div>

Here’s an example of my achievements:

 ![image](https://forums.solar2d.com/uploads/default/original/2X/b/b77e0e83dec17331456d306d0532d77fd4b06e47.png)

For this one I simply use:

```auto
steamworks.setAchievementUnlocked("1D")

```

---

<div class="post-metadata">

**Author:** ![aclementerodrguez](https://forums.solar2d.com/user_avatar/forums.solar2d.com/aclementerodrguez/32/263_2.png) [@aclementerodrguez](https://forums.solar2d.com/u/aclementerodrguez)\
**Post date:** [October 4, 2025, 2:30pm UTC](https://forums.solar2d.com/t/anyone-managed-to-unlock-a-steam-achievement-via-code-not-stats/357577/6 "2025-10-04T14:30:56Z")

</div>

Yes, that’s exactly how I’ve set up my achievements, and they’re already published. I’ll run some tests and post my results here.

---

<div class="post-metadata">

**Author:** ![famousdoggstudios](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/f/94ad74/32.png) [@famousdoggstudios](https://forums.solar2d.com/u/famousdoggstudios)\
**Post date:** [October 5, 2025, 11:29am UTC](https://forums.solar2d.com/t/anyone-managed-to-unlock-a-steam-achievement-via-code-not-stats/357577/7 "2025-10-05T11:29:23Z")

</div>

It’s been some time since I worked on the steam version of our apps but the achievements are still working fine and the code that I have is basically the same function call as yours:

```auto
--function that unlocks the specified achievement
function steamManager.unlockAchievement(achievementName)
	local hasSucceeded=steamworks.setAchievementUnlocked(achievementName)--returns true if the achievement is successfully unlocked
	
	if(hasSucceeded)then
		-- debugStmt.print("Steam Manager: Achievement Unlocked!!")
	else
		-- debugStmt.print("Steam Manager: Error!")
	end
end

```

I don’t know if the achievements have a name AND and ID but I should clarify that I am passing the full string name to the function and they unlock alright.

---

<div class="post-metadata">

**Author:** ![aclementerodrguez](https://forums.solar2d.com/user_avatar/forums.solar2d.com/aclementerodrguez/32/263_2.png) [@aclementerodrguez](https://forums.solar2d.com/u/aclementerodrguez)\
**Post date:** [October 5, 2025, 3:38pm UTC](https://forums.solar2d.com/t/anyone-managed-to-unlock-a-steam-achievement-via-code-not-stats/357577/8 "2025-10-05T15:38:13Z")

</div>

I see… thank you for posting it.
