Please help me translate this Python code fragment to implement Steam Achievements

General discussion for topics related to the FreeBASIC project or its community.
MrSwiss
Posts: 3910
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: Please help me translate this Python code fragment to implement Steam Achievements

Post by MrSwiss »

Landeel wrote:
cannot find -lsteam_api
Hey dodicat, how do you compile that? Don't you need a "steam_api.a"?
No, because dodicat clearly states: DLL (.a whould be a static lib) while DLL referres to: dynamically linked lib.

What you may need is: libname.dll.a (a DLL import lib, only for compilation needed)
TeeEmCee
Posts: 375
Joined: Jul 22, 2006 0:54
Location: Auckland

Re: Please help me translate this Python code fragment to implement Steam Achievements

Post by TeeEmCee »

I found a copy of libsteam_api.so on my system from 2013 (shipped with Half Life) and interestingly it contains a SteamUserStats function, while a 2019 copy doesn't. (Note that the Python code you're referencing is from 2015). In fact the list of functions exported in the 2013 API looks very different. Throw that Python code away and do things the proper way: using a C wrapper.
Landeel
Posts: 777
Joined: Jan 25, 2007 10:32
Location: Brazil
Contact:

Re: Please help me translate this Python code fragment to implement Steam Achievements

Post by Landeel »

TeeEmCee wrote:I found a copy of libsteam_api.so on my system from 2013 (shipped with Half Life) and interestingly it contains a SteamUserStats function, while a 2019 copy doesn't. (Note that the Python code you're referencing is from 2015). In fact the list of functions exported in the 2013 API looks very different. Throw that Python code away and do things the proper way: using a C wrapper.
That explains it. Thanks!
So I will need either an older version or a c wrapper.
I will try both and see what's better.
Landeel
Posts: 777
Joined: Jan 25, 2007 10:32
Location: Brazil
Contact:

Re: Please help me translate this Python code fragment to implement Steam Achievements

Post by Landeel »

Version 1.35a seems to have everything I need.
Previous versions don't have "SteamAPI_ISteamUserStats_SetAchievement"
MrSwiss
Posts: 3910
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: Please help me translate this Python code fragment to implement Steam Achievements

Post by MrSwiss »

Seems to me that you concentrate on the wrong issue, the name of a procedure,
rather than the FUNCTIONALTY, it provides ...
I'm petty certain that, the functonality has either been removed (irrevocable) or,
is implemented under a new (different) name.

If doing something new, one should aim to be current, by using currend API.
(otherwise you are likely to do it again, soon)
Landeel
Posts: 777
Joined: Jan 25, 2007 10:32
Location: Brazil
Contact:

Re: Please help me translate this Python code fragment to implement Steam Achievements

Post by Landeel »

It seems the functionality have been reimplemented in a way that it only works on C++ now.
Well, older versions of the library should still work, because old games still ship with it.
The game I'm publishing on steam is like 7 years old, so nothing new around here. :)
If I can get it to do everything I need, I see no reason to use the latest version.
If it works I will post the results.
Landeel
Posts: 777
Joined: Jan 25, 2007 10:32
Location: Brazil
Contact:

Re: Please help me translate this Python code fragment to implement Steam Achievements

Post by Landeel »

aaaaand... it simply works! Yay!!!

Just had to add that to my previous code:

Code: Select all

type steam_stats_type as any ptr
dim shared steam_stats as steam_stats_type
steam_stats=SteamUserStats() 'steam_api version 1.35a
SteamAPI_ISteamUserStats_SetAchievement(steam_stats, "TEST") 'name of your achievement here
SteamAPI_ISteamUserStats_StoreStats(steam_stats)
Post Reply