Using the player's Steam name?

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
pfranzen
Regular
Posts: 42
Joined: Fri Apr 01, 2016 2:39 pm
Completed: Cat President 1+2, Internet Court, Too Many Santas, The Awkward Steve Duology, The Pizza Delivery Boy Who Saved the World, Francy Droo & Friends
Organization: Oh, a Rock! Studios
itch: oharock
Contact:

Using the player's Steam name?

#1 Post by pfranzen »

Hello! Does anyone know if it's possible for Ren'py to read/display the user's Steam name? (Assuming they're playing the game on Steam, of course).

i.e., would it be possible to display "Hi, [steamuser]!" (Kind of like how Doki Doki Literature Club uses the player's Windows login name.)

User avatar
plaster
Regular
Posts: 89
Joined: Thu Jul 11, 2013 1:03 am
Tumblr: plasterbrain
Soundcloud: plasterbrain
Location: Chicago
Contact:

Re: Using the player's Steam name?

#2 Post by plaster »

Just from glancing at how the achievement API is set up, it looks like you'd have to do something like

Code: Select all

try:
        import _renpysteam as steam
        $ player_name = steam.get_persona_name()
except:
        $ player_name = _("Player")
I haven't tested this, but _renpysteam will only be importable if the Steamworks API is integrated, which I think involves having the steamworks sdk downloaded and the RENPY_STEAM_SDK environment variable set to find it but idk ¯\_(ツ)_/¯

pfranzen
Regular
Posts: 42
Joined: Fri Apr 01, 2016 2:39 pm
Completed: Cat President 1+2, Internet Court, Too Many Santas, The Awkward Steve Duology, The Pizza Delivery Boy Who Saved the World, Francy Droo & Friends
Organization: Oh, a Rock! Studios
itch: oharock
Contact:

Re: Using the player's Steam name?

#3 Post by pfranzen »

I'll give this a shot, thank you!!

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Semrush [Bot]