- Jun 10, 2017
- 11,107
- 16,588
To be fair, I started by verifying my guess. And it was way easier than trying to find it by looking at the code.So... took me a little while to catch up to where you both already were.
Same thought for me. Between the "nesting-like" approach of the screen, and the need of interaction from Ren'py, it will be difficult to maintain the accuracy of the data ; among other things.But the problem as I see it is due to the way the game progresses.
Perhaps is it the game mechanism that make me thinks this, but it looks like the code follow Flash logic ; basically, all the actions are linked to their hosting form. But if this works for a engine that rely on events, it's not the case for Ren'py that is naturally event free, and expect a procedural approach.
Lets say that it's a fix, but as you implied the screen handling a lot of variables by itself, I fear that a rewriting stay the best option. At some point the game will be so complicated that the screen will lost its stability, or it will be impossible to effectively update it.I think the answer, without rewriting your code from scratch is to exit the screen and then reshow it each time the action is to ONLY set a variable.
This approach is probably better:Python:label reshow_cg_greating: call screen Cg_Greating jump reshow_cg_greating
Code:
label reshow_cg_greating:
while True:
call screen Cg_Greating
Ren'py will have two interactions, theMy theory is that by having eachaction
ending in aReturn()
or aJump()
- the game will do at least one RenPy command (and all it's associated internal logic that updates variables and get things ready in case a save is done) before the screen is reshown.
jump
, then the call screen
, what would be enough to solve the variable update problem.Now, as I said, the whole "one screen to do everything" approach should probably be abandoned. While it's not really mandatory now, it will be at some time in the future.
There should be a screen dedicated to the UI (traits, map, etc), that basically looks like:
Code:
screen UI():
hbox:
textbutton "traits" action Show( "traitsScreen" )
textbutton "map" action Show( "mapScreen" )
screen traitsScreen():
modal True
[...]
textbutton "Close" action Hide( "traitsScreen" )
You must be registered to see the links
, with the help of the
You must be registered to see the links
for the actions embedded in the dialog.This would make the devel easier and more intuitive, reduce drastically the complexity of the code (and so the screen), offer more flexibility, and solve all possible variable related issue since there would be tons of interactions.