Tracking character approval of player
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.
-
- Newbie
- Posts: 9
- Joined: Sun Dec 01, 2019 12:47 pm
- Tumblr: https://arent-we-all-game.tumblr
- Contact:
Tracking character approval of player
If I want to track how much a character likes the player, do I have to use persistent variables to store that data? My idea is that I have a variable for each character and depending on which dialogue options you pick, I add a number to that variable. If the number is high enough, you get a bonus dialogue option in some menus or extra scenes. But I'm a bit unsure how to define variables like that so that the progress is saved between play sessions
- m_from_space
- Miko-Class Veteran
- Posts: 975
- Joined: Sun Feb 21, 2021 3:36 am
- Contact:
Re: Tracking character approval of player
I think I should maybe make a simple guide regarding variables in Renpy soon.MiaCorvere wrote: ↑Wed Jan 17, 2024 6:18 pm If I want to track how much a character likes the player, do I have to use persistent variables to store that data? My idea is that I have a variable for each character and depending on which dialogue options you pick, I add a number to that variable. If the number is high enough, you get a bonus dialogue option in some menus or extra scenes. But I'm a bit unsure how to define variables like that so that the progress is saved between play sessions
No, you don't have to use a persistent variable for that. Persistent variables are useful for stuff outside of a game, like a gallery or achievements in the main menu. They "persist" even if you are not inside a game and are shared by all games (even those of different players on one pc or phone). So for example with a persistent variable you could count how often your game was started since the player installed it.
As for your question, just create a variable using default and Renpy will automatically save changes you made throughout the game. It will also set this variable to this default value every time a new game begins. Just think of "default" variables as variables per-game (per-save).
Code: Select all
# how much Eileen trusts the player
default eileen_trust = 0
-
- Newbie
- Posts: 9
- Joined: Sun Dec 01, 2019 12:47 pm
- Tumblr: https://arent-we-all-game.tumblr
- Contact:
Re: Tracking character approval of player
Thank you, that helps a lot!
Who is online
Users browsing this forum: Majestic-12 [Bot]