Page 1 of 1

Steam API functions other than achievements?

Posted: Fri Apr 26, 2024 7:40 am
by munni
I have successfully shipped games through Steam, with achievements correctly working thanks to the Steam libraries in Ren'py.

Now, I would like to use other functions that the Steam API can offer, such as GetSteamUILanguage and InstallDLC which seem to be part of the steamapi.py module. I have no idea how to call these functions inside Ren'py however.

The only documentation I could find on the matter was:
Steamworks API
When Steam is available, a ctypes-based binding to the Steamworks API is available as achievement.steamapi. The binding is an instance of the steamapi module, as found here, and represents a machine translation of the C++ Steamworks API to Python.
I tried the following:

Code: Select all

label splashscreen:
	$ achievements.steamapi.InstallDLC("2261480")
But it returned me a "NoneType" error.

Has anyone ever used the Steam API's fuctions?

Re: Steam API functions other than achievements?

Posted: Fri Apr 26, 2024 8:10 am
by Ocelot
Well, firstly you are doing it wrong. SteamAPI documentation states that
Member functions for ISteamApps are called through the global accessor function SteamApps().
https://partner.steamgames.com/doc/api/ISteamApps

So correct way to do that would be $ achievements.steamapi.SteamApps().InstallDLC("2261480")

Does it work? I have no idea, never used SteamAPI in RenPy.

Re: Steam API functions other than achievements?

Posted: Fri Apr 26, 2024 3:40 pm
by munni
Ocelot wrote: Fri Apr 26, 2024 8:10 am So correct way to do that would be $ achievements.steamapi.SteamApps().InstallDLC("2261480")

Does it work? I have no idea, never used SteamAPI in RenPy.
Ok, I had a try with your example. Unfortunately, I get the same error:

Code: Select all

AttributeError: 'NoneType' object has no attribute 'InstallDLC'
Unfortunately, I'm not savvy enough to figure out what's missing here.

Re: Steam API functions other than achievements?

Posted: Fri Apr 26, 2024 3:55 pm
by Ocelot
It is hard to tell what exactly happens here, but is the steam support installed? Was the Steam integrated properly? Do achievements work?

Re: Steam API functions other than achievements?

Posted: Sat Apr 27, 2024 5:55 am
by munni
Ocelot wrote: Fri Apr 26, 2024 3:55 pm It is hard to tell what exactly happens here, but is the steam support installed? Was the Steam integrated properly? Do achievements work?
I just checked: indeed the Steam libraries are installed. I'm using Ren'py 7.6.0 and 8.1.3, which I'm working with currently. Both versions were used to ship games whose achievements were working properly for Steam users.

Re: Steam API functions other than achievements?

Posted: Fri May 10, 2024 1:22 pm
by kamti
I would join the question.

Re: Steam API functions other than achievements?

Posted: Fri May 10, 2024 1:22 pm
by kamti
I would join the question.
Is there any way to use Steam API to check if the player has really got the achievement?