little problem

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
Dre
Regular
Posts: 118
Joined: Tue Jan 25, 2005 8:55 pm
Location: Allugic.com
Contact:

little problem

#1 Post by Dre »

It's with the save and the load. I set a save point ever few events. Nothing different from what I see in the demo script. I test my game and save at certain points so I can continue with the story. But when I go to load the save it takes me back to the latest save set instead of where I exacltly saved at. I ran into a lot of problems, mostly with the actually scripting but I don't know whats provoking this. Any help, I'm boned. :cry:

User avatar
PyTom
Ren'Py Creator
Posts: 16096
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

#2 Post by PyTom »

I'm not sure what you mean by "latest save set".

Are you changing the script between the save and the load? If you're doing that, then the documented behavior is that it will revert back to the most recent label that is in both the save and the load.

Dre
Regular
Posts: 118
Joined: Tue Jan 25, 2005 8:55 pm
Location: Allugic.com
Contact:

#3 Post by Dre »

Well thats the thing. Whenever I save, exit the game, come right back and load a save. it takes me to the closes $ save_name. The parts where I do save at, I've done all the editing to them so no changes happen there.

User avatar
PyTom
Ren'Py Creator
Posts: 16096
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

#4 Post by PyTom »

Actually, just to be pedantic, it's taking you back to the label before the $ save_name. But since you probably place such a label before each $ save_name, the issue is moot.

The behavior in Ren'Py is correct, if inconvenient for developers. Unfortunately, I can't think of a good way to change the behavior to make it more convenient for developers.

The way that Ren'Py works, each statement is given a name. If the statement is a label, then the name of that statement is the label name. Otherwise, the name of the statement is automatically created based on the name of the file and the date it was last modified.

You say that you only changed one part of the script, and that's true, but there's no way for Ren'Py to know that. So when you change the script, Ren'Py has to go and give every line a new name (except for labels). Then, when loading, it looks for the last statement executed that's still in the script. Usually that's a label, so it will return to the label.

The good news is that saving and loading should work fine when the script is not modified. And since the end-player won't modify the script, it will work fine for them. I never intended loading and saving to be a development tool... It's too easy to make incompatible changes to your game over the course of development.

I should point out that if you break your script up into multiple .rpy files, only saves that are in a modified file will be lost when a file is modified.

Hopefully, this helps you to understand what's going on.

Dre
Regular
Posts: 118
Joined: Tue Jan 25, 2005 8:55 pm
Location: Allugic.com
Contact:

#5 Post by Dre »

I understand now, thanks for the reply!

Post Reply

Who is online

Users browsing this forum: No registered users