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.
so I am trying to create a file in a folder related to the game, and I am successful under Android and under Windows, and under some Linux installations. But I am having trouble under MacOS and some other Linux environments because config.gamedir seems to be write protected. Is there a general way to find a folder using Ren'py functions, methods, config or environment variables?
# Given a directory holding a Ren'Py game, this is expected to return
# the path to a directory that will hold save files.
def path_to_saves(gamedir, save_directory=None):
I haven't tested that to confirm, but I would assume that if you use this function to define your writable directory, you won't have to worry about what OS you're on.
colin r
➔ if you're an artist and need a bit of help coding your game, feel free to send me a PM
# Find the save directory.
if renpy.config.savedir is None:
renpy.config.savedir = __main__.path_to_saves(renpy.config.gamedir) # E1101 @UndefinedVariable
colin r
➔ if you're an artist and need a bit of help coding your game, feel free to send me a PM