Devlog 0.9: Ren'Py Project Backups
Devlog 0.9: Ren'Py Project Backups
Backstory:
So recently, When I was making Start Chapter 5, atom NULL'ed my files, meaning OOF. So I decided to create a backup system that wouldn't place the backup files in the build.
Code:
Backup Exclusion
So basically, you want to go into options.rpy, and go to the archiving section. Once there, paste the first section of the code on the bottom of this post. Change the directory to wherever you are placing your backup files. You can remove any of the file types that you aren't using in your project. This piece of code is to exclude the backups in the build distributions.
Python
Next, we are going to make a file in the "game" folder, name it whatever you want. In there, paste in the 2nd section of the code. What this does is gets a list of files in the game directory, and excludes the subdirectories and the desktop.ini file. Once it has said list, it will create another file in a text format in the backup directory. If you are using a Mac, remove the desktop.ini exclusion. (I use shitk as a variable cause I dont like using x). Remove any of these that you aren't using in your project, as it will literally take the entire folder or make a new folder in the backup area.
Screen Implementation
Finally, we will implement said Python Code into a screen. It doesn't matter what screen you put it in, as long as you put it in a screen that is inaccessable to the player. Paste in the final piece of code. This is simply a text button that calls the backup_files() function we defined earlier in python blocks.
Congrats!
You just saved yourself alot of remaking in atom. :D
## Backup Exclusion ######################################################## build.classify('game/admin/backups/**.rpy.txt', None) build.classify('game/admin/backups/**.sc.txt', None) build.classify('game/admin/backups/**.html.txt', None) build.classify('game/admin/backups/**.vbs.txt', None) build.classify('game/admin/backups/**.rpyc.txt', None) build.classify('game/admin/backups/**.txt.txt', None) build.classify('game/admin/backups/**.png.txt', None) ## Python ################################################################## init python: import os def backup_files(): game_shitk = os.listdir(config.basedir + "/game") game_shitk.remove("admin") game_shitk.remove("gui") game_shitk.remove("images") game_shitk.remove("saves") game_shitk.remove("cache") game_shitk.remove("sfx") game_shitk.remove("ext") game_shitk.remove("desktop.ini") for filenames in game_shitk: try: renpy.file("../game/admin/backups/" + filenames + ".txt") except: open(config.basedir + "/game/admin/backups/" + filenames + ".txt", "wb").write(renpy.file(filenames).read()) ## Screen Implementation #################################################### textbutton "Run Backup" action Function(backup_files)
Start Chapter 5
Where is he?
Status | In development |
Author | DaWinnerIsHere |
Genre | Visual Novel, Adventure |
Tags | Anime, dawinnerishere, Horror, Psychological Horror, Ren'Py, Singleplayer, start-ch-5, xxfnafxserverxx |
Languages | English |
Accessibility | Subtitles |
More posts
- Log 0.1Apr 08, 2020
- Devlog 1.0: Ren'Py MovementMar 21, 2020
- Devlog 0.8Mar 14, 2020
- I CALL CHALLENGEMar 02, 2020
- Devlog 0.7Dec 16, 2019
- Devlog 0.6Nov 25, 2019
- Features / Checklist 0.1Oct 14, 2019
- Devlog 0.4Oct 12, 2019
- Devlog 0.3Aug 02, 2019
Leave a comment
Log in with itch.io to leave a comment.