I'm new here, but developing a project for a while now, and also enjoying the mostly well written documentation of Renpy.
But there is something I cannot really get my head around, and I didn't find sufficient information about it. Also I encountered strange behavior in one of my screens just by changing variable assignment.
Maybe you can answer some questions for me or give me hints.
Let's say we are inside some simple gameover screen and I know it can be more efficient, but it's about what's going on.
Code: Select all
default count = 0 default reason = 0 screen gameover(): vbox: if reason == 0: $ count += 1 text "You died, sorry." elif reason == 1: $ store.count += 1 text "You drowned." showif reason == 2: timer 0.1 action SetVariable("count", count+1) text "You were shot." elif reason == 3: $ count += 1 text "You had a heart attack." if reason == 4: $ store.count += 1 text "You burned to death." elif reason > 4: timer 0.1 action SetScreenVariable("count", count+1) text "I don't know how you died." text "You died [count] times already." if count > 3: text "You died quiet often, you idiot." null height 50 textbutton "Recover" action Return() textbutton "Die a random death" action SetVariable("reason", renpy.random.randint(0,10)) label start: $ reason = 1 "*drinkswater*" call screen gameover $ reason = 2 "*pewpew*" call screen gameover $ reason = 3 "*sugarintake*" call screen gameover return
1. What's the difference writing count += 1 and store.count += 1 -- it seems that store.count will get executed even when the reason is not 1. Or at least the screen is forced to update?
2. What's a screen variable? I guess a local variable that was not assigned outside of the screen? How would I even initialize it? Wouldn't it be reset every time the screen is loaded/checked (which according to the documentation can happen at random times, as Renpy needs it. Why would I need a screen variable?
3. What does predicting a screen really mean? In my project I create very non-static screens that have a lot of conditions inside of them, and sometimes things don't work as intended and don't make sense to me.
I probably have more questions, but that's it for now. Thank you!