Adding stats and old saves
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.
Adding stats and old saves
Let's start off from marking that I'm a newbie when it comes down to coding. Game I'm working on is an VN but with few different paths. Now this is the question I've been struggling a lot lately: how to implement new stats to the code while not forcing players to have a fresh start. Recently, I found out about lambdas, I won't lie I have no idea what is that, been looking at the code like I'd be looking at some mystery dark magic. The premise seems really interesting, few people mentioned about a possibility to change a stat from the past and not causing any errors in the old saves. Also, you can add as many stats as you want even in the past code [by that I mean that if down the road you change your mind about some event that already took place in your game, for example to make it less crucial for the story, you can change its value or add some more stats to it if necessary].
I've been wondering about it, because I want to have some backup plan for the future. New update of my game will force players to start over, but this time I want to be prepared for any further changes in next updates. Mainly, I'm talking about the stats. Each new update introduces new character, which if players want, story might be developed. And now I'm really trying to find a solution and, as I mentioned, to be prepared for the future choices of the players. It's truly a real challenge for a newbie like me. I can't guess which characters will gain my players attention and which will not.
As a newbie I first thought about adding a ton of stats like this:
$ x_affection = 0
$ x2_affection = 0
$ x3_affection = 0
$ x4_affection = 0
$ x5_affection = 0
(...)
$ y_affection=0
$ y2_affection=0
(...)
But as you may see, it'll be really easy to get confused while working on a new update. I know, that a lot of you might find it silly, but I really have no clue how to solve this.
I've been wondering about it, because I want to have some backup plan for the future. New update of my game will force players to start over, but this time I want to be prepared for any further changes in next updates. Mainly, I'm talking about the stats. Each new update introduces new character, which if players want, story might be developed. And now I'm really trying to find a solution and, as I mentioned, to be prepared for the future choices of the players. It's truly a real challenge for a newbie like me. I can't guess which characters will gain my players attention and which will not.
As a newbie I first thought about adding a ton of stats like this:
$ x_affection = 0
$ x2_affection = 0
$ x3_affection = 0
$ x4_affection = 0
$ x5_affection = 0
(...)
$ y_affection=0
$ y2_affection=0
(...)
But as you may see, it'll be really easy to get confused while working on a new update. I know, that a lot of you might find it silly, but I really have no clue how to solve this.
- Angelo Seraphim
- Regular
- Posts: 32
- Joined: Tue May 21, 2019 8:00 am
- Completed: Enamored Risks (NaNoReNo 2020)
- Projects: 616 Charagma
- Organization: GLSUoA
- Deviantart: glsuoa
- itch: glsuoa
- Location: London, UK
- Discord: Just A Concept#9599
- Contact:
Re: Adding stats and old saves
These might be what you are looking for.
https://www.renpy.org/doc/html/persiste ... stent-data
https://www.renpy.org/doc/html/persiste ... ersistence
https://www.renpy.org/doc/html/persiste ... stent-data
https://www.renpy.org/doc/html/persiste ... ersistence
Re: Adding stats and old saves
This is probably it. But it brings another newbie question: how the hell I can built stats system on it?
- namastaii
- Eileen-Class Veteran
- Posts: 1350
- Joined: Mon Feb 02, 2015 8:35 pm
- Projects: Template Maker for Ren'Py, What Life
- Github: lunalucid
- Skype: Discord: lunalucid#1991
- Soundcloud: LunaLucidMusic
- itch: lunalucid
- Location: USA
- Contact:
Re: Adding stats and old saves
You would define your stat variables as persistent variables
Code: Select all
default persistent.x_affection = 0Re: Adding stats and old saves
Okay, and how to add points to it later?
like this?
adding new persistent later on in a new update will not crush the game, right?
like this?
Code: Select all
menu:
"HIDE":
$ x_hate += 1
$ y_hate += 1
jump hide
"DON'T HIDE":
$ x_affection += 1
$ y_affection += 1
jump donthide- namastaii
- Eileen-Class Veteran
- Posts: 1350
- Joined: Mon Feb 02, 2015 8:35 pm
- Projects: Template Maker for Ren'Py, What Life
- Github: lunalucid
- Skype: Discord: lunalucid#1991
- Soundcloud: LunaLucidMusic
- itch: lunalucid
- Location: USA
- Contact:
Re: Adding stats and old saves
I believe you still have to put persistent in front of the variable when you increment or call it
I don't know much about game updates and persistent
I don't know much about game updates and persistent
Who is online
Users browsing this forum: No registered users
