alright thanks dude i'll try it
Honestly, what you asked will lead you on a journey down the rabbit hole, learning Ren'py screen actions and functions. I enjoy learning more and more, every day.
There's a ton of examples for different Stat Pages out there and some are simple and many are very complex for the novice programmer like myself. Those that use lists, arrays, etc. Here's an example of a very simple STAT function that you should be able to play with very easily and start learning how to expand it...
Python:
screen StatInfo():
vbox:
xalign 0.04
yalign 0
textbutton "STATS" action ToggleScreen( "StatDetails" )
screen StatDetails():
style_prefix "StatStyle"
if persistent.know_age:
text "Age: 21"
else:
text "Age: Unknown"
style StatStyle_text:
size 30
font "HeyMarch-MV0Or.ttf"
color "#ffff00"
xalign 0.04
yalign 0.30
define mc = Character("Main Character")
define li = Character("Love Interest")
default persistent.know_age = False
label start:
show screen StatInfo
scene black with dissolve
mc "Hey honey, what's your age?"
li "Wouldn't you like to know!" # Click Stats and you won't see her age
mc "Come on! I need to know if you are legal..."
li "Damn right I am legal! I'm 21!"
$ persistent.know_age = True
mc "Well then, want to come party with me?" # Click Stats now and it will show her age
mc "I don't have anything more to say."
return
This will display a simple textbutton named "STATS" in the upper left of your screen (same xalign as the stat data you wanted). You display it by using the
show screen StatInfo
. That will stay showing until it is hidden using
hide screen StatInfo
or until another screen is shown over top of it. Normal scene transisitons and images won't override it.
I'm assuming you don't want the Stats data on screen all the time, so having an unobtrusive button in one of the corners (I feel) is better. The
action ToggleScreen( "StatDetails" )
toggles showing the StatDetails screen. Also, instead of putting all that text formatting over and over again, I just put it in a style prefix. I also put the x and y alignments there as well. That's what the
style_prefix "StatStyle"
does in your StatDetails screen.
The
default persistent.know_age = False
creates that persistent variable for tracking if the MC knows the age of this character. Of course you can change the naming, but the
persistent.
prefix is what makes it a persistent variable that stands outside of the game saves and is carried over even when you start a new game.
Try it in a test project.... When you first run the game, click on the STAT textbutton and it will say "Age: Unknown". Then advance the dialogue and when she says she's 21, click it again and it will now say "Age: 21". Now exit the game and start a new game and click STATS right at the beginning and Ren'py remembers that persistent variable and will show "Age: 21"
When you are comfortable with the basics, you can really jazz things up with vbox's and hbox's to position elements and using imagebuttons instead of text, etc, etc... This is where Ren'py shines, IMO. It has a lot of functions that are easy for people without a programming background to grasp and use to make a good VN.
EDITED: to add the part about show screen