Hey all, like many of you, I made a game where relationships happen and relationship points are the key to progressing. I'm having trouble with the screen that's supposed to display these points kind of lagging I guess?
Here's the situation:
Every time there's an update in relationship points, it doesn't show up on the stats screen until I load it twice.
I.e. the protagonist gains +1 relationship point with character1. I open up the stats screen, it says the relationship with character1 is 0. I close the screen, open it up again and now it's 1.
If I first load a game where the relationship with character1 is 5, then decide to start a new game, I open the stats screen and it says the relationship is at 5. I close the screen, open it again and now it's 0, as it should be.
Here's the code for the screen (I took the idea from a game where the stats menu works):
This is how I defined the stat values at the beginning:
And this is what I use during the game to change them:
One more piece of possibly helpful information. I made a quick test screen that's visible throughout the game:
The values changed instantly here, but still didn't in the stats menu until I loaded it the second time.
It feels like there's some sort of loading priority or check moment that I'm missing, but I'm still too much of a beginner. I'd greatly appreciate any help.
Here's the situation:
Every time there's an update in relationship points, it doesn't show up on the stats screen until I load it twice.
I.e. the protagonist gains +1 relationship point with character1. I open up the stats screen, it says the relationship with character1 is 0. I close the screen, open it up again and now it's 1.
If I first load a game where the relationship with character1 is 5, then decide to start a new game, I open the stats screen and it says the relationship is at 5. I close the screen, open it again and now it's 0, as it should be.
Here's the code for the screen (I took the idea from a game where the stats menu works):
Python:
screen stats():
tag menu
use game_menu(_("Characters"), scroll="viewport"):
style_prefix "characters"
hbox:
style_prefix "stats"
text "{color=#ffffff}Character1 Trust: [character1_trust] {/color}"
text "{color=#ffeb3b}Character2 Trust: [character2_trust] {/color}"
text "{color=#ff8f00}Character3 Trust: [character3_trust] {/color}"
Python:
init:
$ character1_trust = 0
$ character2_trust = 0
$ character3_trust = 0
Python:
$ character1_trust += 1
Python:
screen say(who, what):
style_prefix "say"
frame:
xalign 1.0 yalign 0
xminimum 300
yminimum 55
ymaximum 55
text "[character1_trust]\n[character2_trust]\n[character3_trust]"
It feels like there's some sort of loading priority or check moment that I'm missing, but I'm still too much of a beginner. I'd greatly appreciate any help.