mugenjohncel wrote:
Edit:
This is a very strange question but is it possible in Ren'py to dictate where the save data goes?...
Check:
config.save_directoryconfig.savedirAs I understand it:
- If you just want to make sure that your game's saves go in the same place (or don't go in the same place) as another game's saves, then you should be able to just use config.save_directory.
- If you want to be able to completely control exactly where the saves go, use config.savedir... but you have to do it in a 'python early' block:
Code:
python early:
config.savedir = '/Users/jake/saves'
... however, the problem with setting that variable is that paths are different on different operating systems, so if you write a Windows directory in there, it won't work on Mac or Linux. Localised versions of operating systems might also have slightly different paths (e.g. 'Programmi' instead of 'Program Files' on an Italian install of Windows).
For example, the default save path under Windows is "/RenPy/<game save dir>" under your user's Application Data directory. On Linux, it's "~/.renpy/<game save dir>". On the Mac, it's "~/Library/RenPy/<game save dir>". The code that Ren'Py uses to determine the default path looks a bit like this (adapted from the actual code, which is in the function starting on line 39 of renpy.py):
Code:
python early:
import os
import os.path
import platform
if platform.mac_ver()[0]:
p = "~/Library/RenPy/" + config.save_directory
path = os.path.expanduser(p)
elif sys.platform == "win32":
if 'APPDATA' in os.environ:
path = os.environ['APPDATA'] + "/RenPy/" + config.save_directory
else:
p = "~/RenPy/" + config.save_directory
path = os.path.expanduser(p)
else:
p = "~/.renpy/" + config.save_directory
path = os.path.expanduser(p)
config.savedir = path
(Except that possibly wouldn't exactly work because 'config.savedirectory' might not be set yet.)
So I guess if you wanted to set an existing path, you could copy the above code and change the bits that set the 'path' variable to the appropriate place on each OS, for example:
Code:
python early:
import os
import os.path
import platform
if platform.mac_ver()[0]:
p = "~/Library/Mugen/saves"
path = os.path.expanduser(p)
elif sys.platform == "win32":
if 'APPDATA' in os.environ:
path = os.environ['APPDATA'] + "/Mugen/saves"
else:
p = "~/Mugen/saves"
path = os.path.expanduser(p)
else:
p = "~/.mugen/saves"
path = os.path.expanduser(p)
config.savedir = path