how to save data with Archive ?

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
yoosir
Regular
Posts: 25
Joined: Thu Mar 09, 2017 10:09 am
Contact:

how to save data with Archive ?

#1 Post by yoosir »

I want to save some data when i go to archive!(the data and the archive are one-to-one correspondence)

of course ,when I want to load the archive, I would like to load the data corresponding to this archive。

So , what should i do ?

Because , I can't read and update the code of archive (eg: FileAction , FilePage )

My idea :


I save/ load the data(mine data) by the index of archive

define global variable

The global variable temporarily stores the current data

when go to save/load archive, i persistent the global variable


is it right ? (my English is poor ,sorry)

yoosir
Regular
Posts: 25
Joined: Thu Mar 09, 2017 10:09 am
Contact:

Re: how to save data with Archive ?

#2 Post by yoosir »

I can't get the index of archive :cry: :cry: :cry:
Attachments
save/load archive's code
save/load archive's code

yoosir
Regular
Posts: 25
Joined: Thu Mar 09, 2017 10:09 am
Contact:

Re: how to save data with Archive ?

#3 Post by yoosir »

In Game
Characters have some attributes (eg: intelligence's value, Intimacy’s value )

I want to save this data when i want to archive

the archive and the attribute's data are one-to-one correspondence
???

User avatar
Ocelot
Lemma-Class Veteran
Posts: 2401
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: how to save data with Archive ?

#4 Post by Ocelot »

All variables are saved and restored with the game. Ren'Py itself handles this.

There are ways to break it, but they are rare, and should be fixed by fixing your code, not manully saving it alongside savefile.

Only reason to add information to save manually, is if you want to retrieve it without loading file (for example, to display it on load icon)
< < insert Rick Cook quote here > >

yoosir
Regular
Posts: 25
Joined: Thu Mar 09, 2017 10:09 am
Contact:

Re: how to save data with Archive ?

#5 Post by yoosir »

Ocelot wrote:All variables are saved and restored with the game. Ren'Py itself handles this.

There are ways to break it, but they are rare, and should be fixed by fixing your code, not manully saving it alongside savefile.

Only reason to add information to save manually, is if you want to retrieve it without loading file (for example, to display it on load icon)

Ok, if i don't manully saving the data alongside savefile.

Can you give me a suggestion how to save the data ?

maybe this demand is crazy :( :(

yoosir
Regular
Posts: 25
Joined: Thu Mar 09, 2017 10:09 am
Contact:

Re: how to save data with Archive ?

#6 Post by yoosir »

@Ocelot has advised me not to do so (not manully saving data alongside savefile)

but ,i can't find other ways

Now question:

When I start the game, the dialog box is displayed immediately
Attachments
Step3.png
Step2.png
Step1.png
Step1.png (5.43 KiB) Viewed 748 times

Post Reply

Who is online

Users browsing this forum: No registered users