Hey All. so my game is coming on really nicely, but I have had some issues with persistent data.
A lot of my events are triggered based on criteria and flags in the manner outlined below:
Event.criteriaA is true if it is the correct time of day
Event.criteriaB is true if the relevant NPC is in the right location
Event.criteriaC is true if the player is in the right location
Event.isActive is true based on other things and switched to false once the event has ended to prevent it triggering again.
If all 4 are true the event triggers
The issue I am having is that somehow these variables seem to be persisting so when I am testing, i have to manually delete the files in the save folder otherwise the events dont trigger. Its a bit odd since i thought you had to tell renpy if you wanted specific things to persist.
Is there anyone who might have experience or insight into this problem?
Persistence and how to work with it
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.
- wyverngem
- Miko-Class Veteran
- Posts: 615
- Joined: Mon Oct 03, 2011 7:27 pm
- Completed: Simple as Snow, Lady Luck's Due,
- Projects: Aether Skies, Of the Waterfall
- Tumblr: casting-dreams
- itch: castingdreams
- Location: USA
- Contact:
Re: Persistence and how to work with it
Your using persistent variables for one game play through? That’s not their purpose. A persistent variable is used for variables set when the person unlocks something. For example unlocking an achievement you only ever see it once no matter who is playing.
You just need regular variables to set up if a, b, c, and d do this. When the player starts a new game it resets to the default state. It loads whatever state they’re in from the save.
You just need regular variables to set up if a, b, c, and d do this. When the player starts a new game it resets to the default state. It loads whatever state they’re in from the save.
- xavimat
- Eileen-Class Veteran
- Posts: 1461
- Joined: Sat Feb 25, 2012 8:45 pm
- Completed: Yeshua, Jesus Life, Cops&Robbers
- Projects: Fear&Love
- Organization: Pilgrim Creations
- Github: xavi-mat
- itch: pilgrimcreations
- Location: Spain
- Discord: xavimat
- Contact:
Re: Persistence and how to work with it
These variables should not persist, and probably your problem has another origin. Try using the console or "watch" the variables to test them.
Comunidad Ren'Py en español: ¡Únete a nuestro Discord!
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)
Who is online
Users browsing this forum: Alex, Google [Bot], Majestic-12 [Bot], piinkpuddiin