Steam API for GLBasic -> achievements, leaderboards for Your game ;-)

Previous topic - Next topic

bigsofty

Thank you Dreamerman, this will come in very handy the closer I get to a Steam release!  :good:
Cheers,

Ian.

"It is practically impossible to teach good programming style to students that have had prior exposure to BASIC.  As potential programmers, they are mentally mutilated beyond hope of regeneration."
(E. W. Dijkstra)

loftcat

Sounds like you're progressing really well with this and definitely something I'd love to see up and running in your game!

spacefractal

Im actuelly used this for only one thing for some of my games: Checking if Steam Deck is used. The reasons is some of my games is default set to a windowred mode. This is a no go on the Steam deck, where im wanted full screen mode...... Actuelly got to work fine.

Code (glbasic) Select

?IFDEF WIN32
LOCAL mySteam AS stats_manager_object, i1%
LOCAL isok%=mySteam.Init%(1)
IF isok%<>0
STEAMDECK=Steam_API_Utils_IsSteamRunningOnSteamDeck()
ENDIF
?ENDIF


also if you dont check the steam was init or not and user launch the exe outside steam, then its will crash. Hence im checking for that.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

MrPlow

Hi Guys,
I want to add achievements to my zen blocks game - so this should be straightforward then ?

Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

MrPlow

Hi Dreamerman!
My AV BitDefender doesnt like the steam gbas files when trying to compile...
strip.exe fails on output.obj
Any ideas?
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

hardyx

Quote from: MrPlow on 2023-May-15Hi Dreamerman!
My AV BitDefender doesnt like the steam gbas files when trying to compile...
strip.exe fails on output.obj
Any ideas?
This may be a problem with your AV because new exe files are generated. Try to add an exception in the folder where you have the GLB projects or the output folder.
P.S. strip.exe is the compiler tool that removes debug info in executables.

dreamerman

Sorry, I didn't notice your posts.
That AV thing is mostly caused by heuristic module in BitDefender or it scanned your app and saw references to steam_api.dll so it blocked that. I would advise to add GLB compiler and possible project *exe to the white list.
And answering to your question, yes this is the best way to add Steam achievement to GLB games at this moment. Leaderboards/rankings also work, yet they require a little more work to implement.
To start, enable achievements for your game in the Steamworksnd admin page (not store page), add some achievements (names, descriptions, graphic) to steam list, and publish update (still only steamworks page, not store page). Now you are ready to add code in your game, just like in first post, init 'stats_manager_object' object, add achievements info, and use them with updateUserStat or unlockAchievement. If you will have any questions or problem don't hesitate to ask, preferably by PM as lately I visit forum not to often :/
Check my source code editor for GLBasic - link Update: 20.04.2020