I thought it would be terrifying if the player makes a decision, decides to choose something else, reloads the game, and an NPC still remembers the choice they made previously and says something about it.
To be clear, I'm not trying to block rollback--I'm just trying to find a way to increment and store variables in a place that won't be affected by loading saves.
Is there a way to do this?
Remembering variables even if the player reloads the game
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.
- OldNoEyes
- Newbie
- Posts: 14
- Joined: Wed Nov 20, 2019 7:20 pm
- Projects: Black Heaven
- itch: oldnoeyes.itch.io
- Location: Brooklyn, NYC
- Contact:
Remembering variables even if the player reloads the game
You opened the box, he came.
- zankizuna
- Veteran
- Posts: 416
- Joined: Fri May 04, 2012 2:20 am
- Completed: Monochrome Valentine
- Projects: Softwar
- Deviantart: raseru09
- itch: ZanKizuna
- Location: Manilaaaaaaaa
- Contact:
Re: Remembering variables even if the player reloads the game
look into persistent variables
https://www.renpy.org/doc/html/persiste ... 20variable
https://www.renpy.org/doc/html/persiste ... 20variable
- OldNoEyes
- Newbie
- Posts: 14
- Joined: Wed Nov 20, 2019 7:20 pm
- Projects: Black Heaven
- itch: oldnoeyes.itch.io
- Location: Brooklyn, NYC
- Contact:
Re: Remembering variables even if the player reloads the game
Zankizuna, you're a goddamn champion. I've been fiddling around for 2 hours trying to figure this out.
Thanks so much!
Thanks so much!
You opened the box, he came.
- Imperf3kt
- Lemma-Class Veteran
- Posts: 3794
- Joined: Mon Dec 14, 2015 5:05 am
- itch: Imperf3kt
- Location: Your monitor
- Contact:
Re: Remembering variables even if the player reloads the game
Note that persistent works across saves as well.
If the player begins a new game, it'll also have the sane variable.
You may need to think of a way to reset the variable on a new game (without resetting it in the existing game) depending on how your game works.
If the player begins a new game, it'll also have the sane variable.
You may need to think of a way to reset the variable on a new game (without resetting it in the existing game) depending on how your game works.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
Twitter
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
Who is online
Users browsing this forum: Bing [Bot], Google [Bot]