I'm new to Ren'py and i'm really sorry if the answer of my question is very obvious. I tried to find answers on several previous post, documentation and youtube tutorials but can't get my answer. Do not hesitate to redirect me on another existing topic.
Here is the thing. I'd like to create a stats system. Basically this system will store points of love, trust or lust the NPC will have toward the player character.
So I tried to create a class like this:
Code: Select all
init python:
class CharacterStats(object):
def __init__(self, mood, trust, love, lust):
self.mood = mood
self.trust = trust
self.love = love
self.lust = lustCode: Select all
define character.nina = DynamicCharacter("nina_name", color="#F4B1F9", who_xpos = 260)
define nina = CharacterStats("Neutral", 0, 0, 0)Then, when talking to Nina, I incremented trust points like this :
Code: Select all
menu:
"I'm so sorry for your loss !":
e "Poor thing ! I'm sure she's really proud of you from where she is..."
$ nina.trust += 2Code: Select all
nina "I don't know how to thank you !"
$ nina.trust += 3In deed, using the debug prompt using shif + O and typing nina.trust after loading a previous save when nina's trust was 2 for exemple, it turns 0 again when re-loading the game.
Same question for rollingback, when I increment 2 to nina's trust, then rollback before incrementing, it stays 2. I'd like the variable to decrement 2 when rollingback. I've read the https://www.renpy.org/doc/html/save_load_rollback.html page but it still a bit blurry
Maybe I'm doing all of these all wrong ? Again, I'm really sorry, my questions must be very stupid and easy to solve :/