Lemma Soft Forums

Supporting creators of visual novels and story-based games since 2003.


Visit our new games list, blog aggregator, IRC, and wiki.
Activation problem? Email [email protected]
It is currently Mon May 20, 2013 1:09 pm

All times are UTC - 5 hours [ DST ]


Forum rules


Ask questions about one topic per thread, and use a descriptive subject. "NotImplemented error in script.rpy" is a good subject, "Tom's problems" is not. Remember to include all of traceback.txt or error.txt when reporting a problem, as well as the relevant lines of script. Use the [code] tag to format scripts.



Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: Renpy Save File
PostPosted: Tue Jul 10, 2012 9:08 am 
Veteran
User avatar

Joined: Sat Mar 27, 2010 3:12 am
Posts: 314
Location: Antarctica
Projects: Project 2054: ~From Antarctica with Love~ Project 2056: ~In Disease, Delinquency, and in Disorder
I need to access and take a look on how and where ren'py stores the saves

also, I'm going to need some kind of database/storage file to put in user data (lvl, ID#, name).

to make it short, if ren'py has a database of sorts, I NEED TO ACCESS, EDIT AND VIEW IT. I ALSO NEED TO CONNECT REN'PY TO A DATABASE IF REN'PY DOESN'T HAVE A DATABASE AT ALL.

I seriously hope that the saves are in a database/database like file...

*if this is confidential stuff, I still need it, but I won't spill the information at all, or use is against Ren'Py and it's gamers.

*System Analysis and Design, me and my group mates decided to do a dating sim, and the professor wanted it to have a database, well not necessarily something like mysql and access, as long as data is saved onto a file, it's valid. If connecting renpy to a database is possible with python code.. it's okay.

*This dating sim requires players to register in-game, thus giving us something to record... aside from the problem of where to record registered users, there's also this problem of determining which savers are for the logged-in player, and which saves are not for the logged-in player, thus a database of user-saves is also required.

*If the items/codes that are required to achieve the following are confidential, then shoot me a pm.

_________________
In Delinquency, Discipline, and Disorder


Top
 Profile Send private message  
 
 Post subject: Re: Renpy Save File
PostPosted: Tue Jul 10, 2012 10:17 am 
Ren'Py Creator
User avatar

Joined: Mon Feb 02, 2004 10:58 am
Posts: 10772
Location: Kings Park, NY
Completed: Moonlight Walks
Projects: Ren'Py
Ren'Py stores its saves in a system-specific location. It doesn't use a database, so the saves are just zip files. We don't ship sqlite or another python database module.

That being said, for simple stuff, you might be able to get away with just using persistent as a database, and writing the queries by hands. (If you don't have a lot of data, or a lot of joins, this should be pretty easy.)

You could probably also copy the sqlite3 module out of an appropriate version of Python, stick it into the Ren'Py directory, and that would work.

_________________
Another Old-Fashioned Bishoujo Gamer
Supporting creators since 2004; Code > Drama
(When was the last time you backed up your game?)
"It is not the critic who counts; not the man who points out how the strong man stumbles, or where the doer of deeds could have done them better. The credit belongs to the man who is actually in the arena, whose face in marred by dust and sweat and blood; who strives valiantly; who errs, who comes short again and again, because there is no effort without error and shortcoming" - Theodore Roosevelt


Top
 Profile Send private message  
 
 Post subject: Re: Renpy Save File
PostPosted: Tue Jul 10, 2012 2:00 pm 
Veteran
User avatar

Joined: Sat Mar 27, 2010 3:12 am
Posts: 314
Location: Antarctica
Projects: Project 2054: ~From Antarctica with Love~ Project 2056: ~In Disease, Delinquency, and in Disorder
thanks sir....

May I ask where this system-specific location of save files is?.

also, am I going to choose between Python 1 and Python 2, or install each one and find ze sqlite module that is appropriate?
also, how am I going to use the persistent(data?)(is it a CLP?) and where do i get it's syntax?


UPDATE:
Installed 2.7 Python, copied sqlite3 module to ze root of the renpy directory.
Found the saves directory and persistent.file of some games.
awaiting further instructions.

_________________
In Delinquency, Discipline, and Disorder


Last edited by curry nochi rice on Tue Jul 10, 2012 2:22 pm, edited 1 time in total.

Top
 Profile Send private message  
 
 Post subject: Re: Renpy Save File
PostPosted: Tue Jul 10, 2012 2:20 pm 
Veteran

Joined: Mon Jun 18, 2012 12:16 pm
Posts: 236
You can look where the engine stores your saves in a .py file that you has in your game directory (not the "game" one, but the one where you have the executable), which has the same name as an executable.
You'll need to turn "view hidden files and folders" option on to view the Application Data directory, though.

Persistent data is just encoded in zlib, you can easily use any online decoder/encoder to look at its contents. If i remember correctly, python ships with decoder itself (maybe).

=======

By the way, since it seems like a good thread to ask this question, is there any way to rename the directory from "saves" to "userdata", if i have it right in the game folder? I tried to edit the mentioned .py file and some others, but that had no effect.

PyTom wrote:
The save directory is stored in config.savedir. You can change this (preferably in a python early block) to put the saves somewhere else.

Ah, thank you.
The line would be config.gamedir + "/userdata", if anyone is interested.
(The full one should be config.savedir = config.gamedir + "/userdata", in python early block of the options.rpy file, that is.)


Last edited by Levrex on Thu Jul 12, 2012 3:28 pm, edited 2 times in total.

Top
 Profile Send private message  
 
 Post subject: Re: Renpy Save File
PostPosted: Tue Jul 10, 2012 2:23 pm 
Ren'Py Creator
User avatar

Joined: Mon Feb 02, 2004 10:58 am
Posts: 10772
Location: Kings Park, NY
Completed: Moonlight Walks
Projects: Ren'Py
The save directory is stored in config.savedir. You can change this (preferably in a python early block) to put the saves somewhere else.

_________________
Another Old-Fashioned Bishoujo Gamer
Supporting creators since 2004; Code > Drama
(When was the last time you backed up your game?)
"It is not the critic who counts; not the man who points out how the strong man stumbles, or where the doer of deeds could have done them better. The credit belongs to the man who is actually in the arena, whose face in marred by dust and sweat and blood; who strives valiantly; who errs, who comes short again and again, because there is no effort without error and shortcoming" - Theodore Roosevelt


Top
 Profile Send private message  
 
 Post subject: Re: Renpy Save File
PostPosted: Tue Jul 10, 2012 2:34 pm 
Veteran
User avatar

Joined: Sat Mar 27, 2010 3:12 am
Posts: 314
Location: Antarctica
Projects: Project 2054: ~From Antarctica with Love~ Project 2056: ~In Disease, Delinquency, and in Disorder
@levrex

extracted the files on the .save(changed to .zip) are the files inside the .save/.zip encoded in zlib too?

_________________
In Delinquency, Discipline, and Disorder


Top
 Profile Send private message  
 
 Post subject: Re: Renpy Save File
PostPosted: Tue Jul 10, 2012 5:38 pm 
Ren'Py Creator
User avatar

Joined: Mon Feb 02, 2004 10:58 am
Posts: 10772
Location: Kings Park, NY
Completed: Moonlight Walks
Projects: Ren'Py
The encoding varies by file.

I'm trying to figure out what you're doing here. You really shouldn't need to use the Ren'Py save files directly to do this project. Instead, just use sqlite to make a new database in config.savedir to save your project-specific stuff.

Alternatively, just use a field in persistent to create an in memory database. SQL just embodies relational calculus, defined over sets of tuples. There's nothing preventing you from just implementing your own relational algorithms over sets of tuples. (If you don't care about performance, it's actually pretty easy.)

_________________
Another Old-Fashioned Bishoujo Gamer
Supporting creators since 2004; Code > Drama
(When was the last time you backed up your game?)
"It is not the critic who counts; not the man who points out how the strong man stumbles, or where the doer of deeds could have done them better. The credit belongs to the man who is actually in the arena, whose face in marred by dust and sweat and blood; who strives valiantly; who errs, who comes short again and again, because there is no effort without error and shortcoming" - Theodore Roosevelt


Top
 Profile Send private message  
 
 Post subject: Re: Renpy Save File
PostPosted: Wed Jul 11, 2012 12:20 am 
Veteran
User avatar

Joined: Sat Mar 27, 2010 3:12 am
Posts: 314
Location: Antarctica
Projects: Project 2054: ~From Antarctica with Love~ Project 2056: ~In Disease, Delinquency, and in Disorder
I just wanted to know where and view the save files.

so basically, i'll connect sqlite to the game by having to modify a line or two in config.savedir.
:3 okay imma try it out.

_________________
In Delinquency, Discipline, and Disorder


Top
 Profile Send private message  
 
 Post subject: Re: Renpy Save File
PostPosted: Wed Jul 11, 2012 2:33 pm 
Veteran
User avatar

Joined: Sat Mar 27, 2010 3:12 am
Posts: 314
Location: Antarctica
Projects: Project 2054: ~From Antarctica with Love~ Project 2056: ~In Disease, Delinquency, and in Disorder
Sir PyTom,

after copying the sqlite module to renpy, should i just encode the SQL queries/codes onto the config.savedir like it's a normal .py file?
e.g the sqlite module for python has example (test) codes, should I just code like that in the config.savedir file, or am I wrong and I should
code it just like in the python 2.73/11.13 sqlite documentation?

I'm yet to fully understand how should I make the appropriate connections between renpy and sqlite, and how do i code the database in the config.savedir.

_________________
In Delinquency, Discipline, and Disorder


Top
 Profile Send private message  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: Google [Bot], NoahSindri


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Protected by Anti-Spam ACP
Powered by phpBB® Forum Software © phpBB Group