Jump to content
TeardownMods

2 Screenshots

About This File

This is a python script that I wrote that allows you to save and load quicksaves.

The process is pretty self explanatory and the program guides you through pretty well, but just make sure that when loading a save you first quicksave BEFORE you load the save and then you can load it in the program and then in the game. As of right now there is no ui, although I will most likely add it soon.

Although the program gives you simple explanations, if you find yourself confused I recommend you read the READ.txt in the zip.

How to install:

1. Extract the file anywhere you want.

2. Move the quicksaves folder to Documents\Teardown (The folder where your save files are). You can delete the txt in the quicksaves folder if you want; it is completely useless other then allowing me to put the folder into a zip file.

3. Run the script when you're ready and:

Enjoy!

Also make sure to check out another save manager made by MrAdhit that improves on the idea a lot!

 

 

If you would prefer not to download the zip, the code is below:

from shutil import copyfile
from os import remove
from getpass import getuser
def startSave():
    choose = input('save (s) or load/delete (l)? ')
    if choose == 's':
        print()
        save()
    else:
        if choose == 'l':
            print()
            loadChoose()
                    


def save():
    try:
        saveListTxt = loadlist()
    except:
        print('savelist.txt not found, creating new file')
        saveListTxt = loadlist('x')
        saveListTxt.close()
        saveListTxt = loadlist()
    saveName = input('What do you want to call your save? ')
    saveNameNl = saveName + '\n'
    saves = saveListTxt.readlines()
    count = 0
    for i in saves:
        count += 1
        if saveNameNl == i:
            print()
            print('you already have a save with this name :(')
            print()
            saveListTxt.close()
            break
        else:
            if count == len(saves):
                saveListTxt.close()
                saveListTxt = loadlist('a')
                copyfile(r'C:\Users\\' + username + r'\OneDrive\Documents\Teardown\quicksave.bin', r'C:\Users\\' + username + r'\OneDrive\Documents\Teardown\quicksaves\\' + saveName + '.bin')
                saveListTxt.write(saveNameNl)
                saveListTxt.close()
                print()
                print('Save created')
                print()
                break
    if len(saves) == 0:
        saveListTxt.close()
        saveListTxt = loadlist('a')
        copyfile(r'C:\Users\\' + username + r'\OneDrive\Documents\Teardown\quicksave.bin', r'C:\Users\\' + username + r'\OneDrive\Documents\Teardown\quicksaves\\' + saveName + '.bin')
        saveListTxt.write(saveNameNl)
        saveListTxt.close()
        print()
        print('Save created')
        print()

def loadlist(method = 'r'):
    resultlist = open(r'C:\Users\\' + username + r'\OneDrive\Documents\Teardown\quicksaves\savelist.txt', method)
    return resultlist
    
    
def loadChoose():
    saveTxt = loadlist('r')
    saveList = saveTxt.readlines()
    saveTxt.close
    saveTxt = loadlist('r')
    saveListOg = saveTxt.readlines()
    saveTxt.close
    if len(saveListOg) > 0:
        for i in range(len(saveList)):
            print(i + 1)
            print(saveList[i])
        print()
        saveNum = int(input('type the number of the save you want to load/delete '))
        print()
        if not saveNum > len(saveList) and not saveNum < 1:
            delOrLoad = input('delete (d) or load (l)? ')
            if delOrLoad == 'd':
                for i in range(len(saveList)):
                    saveList[i] = saveList[i].rstrip('\n')
                remove(r'C:\Users\\' + username + r'\OneDrive\Documents\Teardown\quicksaves\\' + saveList[saveNum - 1] + '.bin')
                print()
                print('deleted!')
                print()
                newTxt = loadlist('w')
                saveListOg.pop(saveNum - 1)
                newTxt.writelines(saveListOg)
            else:
                if delOrLoad == 'l':
                    for i in range(len(saveList)):
                        saveList[i] = saveList[i].rstrip('\n')
                    copyfile(r'C:\Users\\' + username + r'\OneDrive\Documents\Teardown\quicksaves\\' + saveList[saveNum - 1] + '.bin', r'C:\Users\ypier\OneDrive\Documents\Teardown\quicksave.bin')
                    print()
                    print('loaded!')
                    print()
    else:
        print()
        print('You don\'t have any saves! Input \'s\' to save!')
        print()

username = getuser()

debug = 'false'
while 'true':
    #debug = 'true'
    
    if debug == 'false':
        try:
            print()
            startSave()
        except:
            print()
            print()
            print('oops, something went wrong')
            print()
            print()
    else:
        startSave()

 

Edited by Gh0st

  • Thanks 1

User Feedback

Recommended Comments

There are no comments to display.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

How to Disable AdBlock - And why you should do it?

I have disabled AdBlocker. Refresh the page.