Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Steam Achievements - Questions on Plugin usage

Author
Message
DavidAGK
AGK Developer
7
Years of Service
User Offline
Joined: 1st Jan 2014
Location:
Posted: 31st Mar 2021 14:12
Hi All,

I've got Aquillanto up on Steam (just internal now) and set up an achievement. I can set and clear the achievement via the game but I'm struggling to properly understand how it really works and therefor how to add error checking code and deal with any issues gracefully... I'm really not that techie so all help appreciated and extra appreciated if given at "Dummies Guide" level! The whole asynchronous part baffles me (I understand the concept but not really how Adam's plugin deals with it). Here's where I'm at and some questions...

I am currently setting the achievement like this... but not sure what I would do if I got an error result from steam...


I'm uploading the achievement to steam like this but again, not sure what to do if it fails - see my next code below...
Also not sure if I need to run Syn() and Steam.RunCallbacks() commands here? Not entirely sure what they do!


One idea I had for checking that achievements are recorded and uploaded is as follows (using the StoreStats() as an example)... so it tries until it succeeds or it's tried 50 times but not sure if this is spamming the server or just bad practice in general!
Again... do I need to run the Sync() and Steam.RunCallbacks() commands here?


I can see in the basic example on the Wiki that you can listen for errors but can't find the documentation to GetErrorOccurred() or GetLastError() Do all commands, for example Steam.StoreStats() and Steam.SetAchievement(), also set errors that can be called like this?


AQUILLANTO - A side-scrolling platformer with super tight controls, 3 worlds to explore, hordes of monsters and a quest... Inspired by games on the Amiga computer

FOLLOW ON TWITTER
SEE THE YOUTUBE CHANNEL

adambiser
AGK Developer
5
Years of Service
User Offline
Joined: 16th Sep 2015
Location: US
Posted: 31st Mar 2021 18:57
This would probably be best talked about at github since this is specific to the plugin, not AGK.

The only time the user stat/achievement methods return 0 is if they aren't set up properly in your Steamworks App Admin. ie: wrong achievement name, stat type doesn't match (float vs int).
So don't worry about that except during development. Popping up a message box should be enough for debugging.

First, don't set stats/achs until stats are initialized

Once any and all stats and achievements for a certain action are set, call StoreStats() and check for the response.

It's very important to call RunCallbacks each sync frame. This doesn't bombard the server, it runs the code to process responses from the server. Don't loop and wait for the response because that can cause your game to pause while it waits. Just call RunCallbacks each sync and check for responses.
DavidAGK
AGK Developer
7
Years of Service
User Offline
Joined: 1st Jan 2014
Location:
Posted: 31st Mar 2021 20:45
Hi Adam,

Thanks for jumping in - I'm too tired to understand this tonight (!) so will take a proper look tomorrow morning when I'm fresh! You're light years ahead of me on the techy front! I'll see about setting up a login for Github. I was going to post on the original plugin thread but it's locked but happy to move this to Github if you prefer.

AQUILLANTO - A side-scrolling platformer with super tight controls, 3 worlds to explore, hordes of monsters and a quest... Inspired by games on the Amiga computer

FOLLOW ON TWITTER
SEE THE YOUTUBE CHANNEL

adambiser
AGK Developer
5
Years of Service
User Offline
Joined: 16th Sep 2015
Location: US
Posted: 31st Mar 2021 21:22
No problem. Thanks for letting me know about the plugin thread being locked. I've unlocked it.

Login to post a reply

Server time is: 2021-04-11 18:49:20
Your offset time is: 2021-04-11 18:49:20