Code for improved save/load screens

The three save paths
The above image shows the alternate directories.
CLICK HERE TO DOWNLOAD A PRE-MADE FILE

This file is hosted at the above gitlab repo, link included just for ease of access. The below code WILL NOT be updated anymore (2025-05-31), check the gitlab.

##################
# HOW TO USE THIS
##################
# Copy the text from this page
# Open notepad
# Paste the text from this page into notepad
# Change the "Save as type" to All Files
# Save this file as anythingHere.rpy
# Move the .rpy file to your games "game" folder

# This assumes you play on windows, if not, 
# you should be smart enough to edit it yourself

##################################
# CHANGING THE SCREENSHOTS FOLDER
##################################
# There are three options for saving screenshots
# IF saveToPicturesWithSubfolder = True
# Screenshots will be saved to the pictures library
# Within a custom subfolder
# Within a game specific folder
# Pictures/CustomDir/GAME NAME/GAMENAME_screenshotNumber.png

# IF saveToGameFolder = True
# Screenshots will be saved to the game folder with a new Screenshots Folder
# GAME FOLDER/Screenshots/GAMENAME_screenshotNumber.png

# IF neither are true, screenshots are saved to
# Pictures/GAME NAME/GAMENAME_screenshotNumber.png

# The custom directory where all game folder are saved can be changed
# Edit the customDir

init 99999999 python:
    import os

    #This sets which filepath you want for the screenshots
    #See above for what to edit
    saveToPicturesWithSubfolder = True
    saveToGameFolder = True

    #Change the string to change the name of the folder
    #This folder holds all game specific folders, to prevent clutter
    customDir = "wegs" 

    #Sets the first part of the path to C:\Users\YOURUSER - Don't change this
    #Really, dont
    #On linux it should be /home/yourUser
    profilePath = os.path.expanduser("~") 
    gameName = config.window_title

    #If the game name is still incorrect try build.name
    if gameName == None:
        gameName = build.name
    if (gameName.lower().replace(" ", "").startswith("friendsinneed")):
        gameName = "Friends In Need"

    if saveToPicturesWithSubfolder == True:
        finalDir = os.path.join(profilePath, "Pictures", customDir, gameName)

    elif saveToGameFolder == True:
        finalDir = 'Screenshots'

    else:
        finalDir = os.path.join(profilePath, "Pictures", gameName)

    finalPath = os.path.join(finalDir, "{name}_%04d.png".format(name=gameName))
    if not os.path.exists(finalDir):
        try:
            os.makedirs(finalDir)
        except OSError as exc: # Guard against race condition
            if exc.errno != errno.EEXIST:
                raise

    config.screenshot_pattern = finalPath
Edit

Pub: 18 Feb 2025 16:49 UTC

Edit: 31 May 2025 07:36 UTC

Views: 380