Jump to content
  • 0
Russell

Achievements POPUP and RESET Achievements on Steam

Question

Hello team!! I'm not sure where can i ask this, for this reason i write the post on "Technical Assistance".

After read this helpful thread: How to set a Steam Achievement

I have managed to make my achievements work ok. But as the thread says, the achievements popup doesn't show up when you achieve one of them. They are displayed together when you close the game.

I have 2 questions that I don't know if someone can answer me:
FIRST - Anyone knows how make that popup appears when we achieve one of the achievements??? This is my code on Leadwerks, simple as the thread says:

--MAIN.LUA
--Initialize Steamworks
Steamworks:Initialize()
--Achievements.lua (script)
Script.LogroObtenido=""--string "Logro"

function Script:Logro()--in
	Steamworks:SetAchievement(self.LogroObtenido)
	sound = Sound:Load("Sound/MisSonidos/Logro.wav")
	sound:Play()
end

Works ok, but the POPUP on Steam doesn't appear when we achieve one of them. Only when we close the game.

 

SECOND - Anyone know how reset achievements on Steam to test them again??? I have used the commands says in the Steamworks SDK

To set or clear an achievement without adding code to your game, you can use the Steam client console. Run with steam.exe -console, then:
    achievement_set <appid> <achievement name>
    achievement_clear <appid> <achievement name>
    reset_all_stats <appid>

But commands don't work. After put my APPID and the Name of the acchievement in the console, says "command not found".

Reset_all_stats and my appid of my game, doesn't work neither. (I think these commands are no longer enabled on steam right now)

Anyone have exp with this topic in his game???

Thank you very much!!

Share this post


Link to post

5 answers to this question

Recommended Posts

  • 0

I played with this late last year and I use C/C++ so I don't know how much this will help; it may have broken since then.  Getting the achievements to show worked but it wasn't instant.  Sometimes it took a few seconds.  It was acting weird but it's supposed to be better when you actually release the game.  Resetting achievements worked fine.  I just called SteamUserStats()->ResetAllStats(true) for that.

  • Thanks 1

Share this post


Link to post
  • 0
8 hours ago, gamecreator said:

I played with this late last year and I use C/C++ so I don't know how much this will help; it may have broken since then.  Getting the achievements to show worked but it wasn't instant.  Sometimes it took a few seconds.  It was acting weird but it's supposed to be better when you actually release the game.  Resetting achievements worked fine.  I just called SteamUserStats()->ResetAllStats(true) for that.

Thanks for your answer gamecreator. This SteamUserStats()->ResetAllStats(true) is used inside my code in the game?

Is there a way to reset them using the Console on Steam??

Share this post


Link to post
  • 0
Just now, gamecreator said:

Yes, I did it through code.  I don't know anything about the console.

Thanks, i will try this.

With LUA and my code, achievements appear only when we close the game.

Reseting them, this give me a chance to try different lines of code.

If I make a successfull code with achievemens showed in the same moment or few seconds later, i will share it here.

Thanks again gamecreator.

Share this post


Link to post
  • 0

Finally, since I don't know how to make with LUA appear the Steam Popup when we achieve one of the achievements; i have make my own popup system...

This is my code...

Script.LogroObtenido=""--string "Logro"
local MostradoLogro="No"

function Script:Logro()--in
	Steamworks:SetAchievement(self.LogroObtenido)
	sound = Sound:Load("Sound/MisSonidos/ValidarTICKET.wav")
	sound:Play()
	--Cargamos la textura de logro introducida en la caja de texto del nombre del logro.
	TexturaLogro=Texture:Load("Materials/MisTexturas/HUD/Logros/"..self.LogroObtenido..".tex")
	--Como siempre textura vacía para quitar las imagenes en la pantalla.
	textureVacia = Texture:Load("Materials/MisTexturas/TexturaVacia.tex")
end

function Script:PostRender(context)
	--Para que se active el fondo transparente de las imagenes.
	context:SetBlendMode(Blend.Alpha)
	if MostradoLogro=="No" then
		context:DrawImage(textureVacia,0,0,0,0)
	end
	if MostradoLogro=="Si" then
		context:DrawImage(TexturaLogro,context:GetWidth()/2-TexturaLogro:GetWidth()/2,100,0,0)
	end
end

function Script:LogroVisible()--in
	MostradoLogro="Si"
end

function Script:LogroOculto()--in
	MostradoLogro="No"
end

Works OK in 3 levels and 6 achievements custom popup appears OK with this code.

But in the others 10 levels doesn't work and LEADWERKS give me "ASSERT FAILED" error without no more explanation of why...

Anyone knows anything about this??? I have tried to find the answer in the forum, but nothing worked for my case...

Thanks team!

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