Steam API functions other than achievements?

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
User avatar
munni
Newbie
Posts: 20
Joined: Sun Mar 17, 2019 4:14 pm
Contact:

Steam API functions other than achievements?

#1 Post 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?

User avatar
Ocelot
Lemma-Class Veteran
Posts: 2411
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: Steam API functions other than achievements?

#2 Post 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.
< < insert Rick Cook quote here > >

User avatar
munni
Newbie
Posts: 20
Joined: Sun Mar 17, 2019 4:14 pm
Contact:

Re: Steam API functions other than achievements?

#3 Post 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.

User avatar
Ocelot
Lemma-Class Veteran
Posts: 2411
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: Steam API functions other than achievements?

#4 Post 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?
< < insert Rick Cook quote here > >

User avatar
munni
Newbie
Posts: 20
Joined: Sun Mar 17, 2019 4:14 pm
Contact:

Re: Steam API functions other than achievements?

#5 Post 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.

Post Reply

Who is online

Users browsing this forum: Google [Bot], NoFanru