So i have a tile based battle engine, it runs on many many lists and works fine thus far.
One teensy weensy issue. All the lists seem to be persistent. If the player quits to main menu and starts a new game, instead of reverting to the lists set out in the init and init python blocks, they continue from the old playthrough.
My colleague who is working on the other half of the game tells me he is having a similar problem with all sorts of variables.
Any insight into this problem is greatly appreciated and any solutions sorely needed.
Thanks
Evildumdum
Lists are persistent?
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.
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.
- Evildumdum
- Regular
- Posts: 191
- Joined: Sun Jan 18, 2015 8:49 am
- Projects: ApoclypseZ
- Contact:
Lists are persistent?
"If at first you don't succeed, try hitting it with a shoe."
- papiersam
- Veteran
- Posts: 231
- Joined: Fri Aug 12, 2016 2:24 pm
- Completed: Gem Hunt Beta, 1/Probably, Animunch
- Projects: The Panda Who Dreamed
- Contact:
Re: Lists are persistent?
Really? I wish that was the case way back when I was just beginning Renpy coding and needed to utilise persistent data.All the lists seem to be persistent
That aside, I don't recall lists being persistent (under the assumption that 'persistent' means it saves without manually saving to file). Also;
I'm thinking that maybe these lists/variables are associated with a class/object/type of data that Renpy saves, causing the issue. So, something like:My colleague who is working on the other half of the game tells me he is having a similar problem with all sorts of variables.
Code: Select all
$var = ['hamster', 'panda', 'phoenix']
Code: Select all
$persistent.var = ['hamster', 'panda', 'phoenix']
Try deleting persistent data from the Renpy UI and testing it out, to get a clearer picture of what's going on.
Hope that helps.
- Evildumdum
- Regular
- Posts: 191
- Joined: Sun Jan 18, 2015 8:49 am
- Projects: ApoclypseZ
- Contact:
Re: Lists are persistent?
Yes, Most of the lists contain class instances. Many many class instances. However the problem occurs when the game is not saved and a new game is initiated. The game on both my side and my colleagues is almost entirely run with the use of OOP.
"If at first you don't succeed, try hitting it with a shoe."
- nyaatrap
- Crawling Chaos
- Posts: 1824
- Joined: Mon Feb 13, 2012 5:37 am
- Location: Kimashi Tower, Japan
- Contact:
Re: Lists are persistent?
Code: Select all
If the player quits to main menu and starts a new game, instead of reverting to the lists set out in the init and init python blocks, they continue from the old playthrough.
You should code either of:
1. Instantiate objects directly after start, not only in init.
2. Use the default statement instead of init.
Who is online
Users browsing this forum: Google [Bot]