Now that I've got that out of my system... I will ask for help.
I've been poking at a stat training feature, and I decided to make an autoplay feature, you click a button, and it automatically raises your stat after a set amount of time.
The thing is-- I love to lock renpy into a while loop that runs through an ingame menu. Here's where most of my problems begin.
All the same, I managed to make it function, the only problem I'm not sure how to approach, is that it doesn't show the changes on the screen until after I choose a menu option again.
Now before I jump onto any more serious techniques, I'd like to try and salvage this one, for the time being anyway.
Here's the actual screen:
Code: Select all
screen Training_Overlay(s, o, r, autoplay):
text "Training Overlay" at top
vbox:
yalign 0.1
xalign 0.05
$st="Strength: {:.2f} +{:.2f} {:.2%}".format(s, o, r/1)
text st
if autoplay:
timer 0.01 repeat True action If(timespan > 0, true=SetVariable('timespan', timespan - 0.01), false=[SetVariable('timespan', 1), SetVariable('strength', strength+1)])
bar value timespan range 1 xalign 0.5 yalign 0.9 xmaximum 300
Code: Select all
label Event_11:
python:
q= False
strength=1.0
m=1.01
o=0
r=0
autoplay=False
while q == False:
show screen Training_Overlay(strength, o, r, autoplay)
menu:
"Train":
$ r= 1
$ o=strength
$ m= 1 + 0.01* r
$ strength*=m
$ o=strength-o
"Auto-train":
$ r= renpy.random.random()
$ autoplay= not autoplay
$ timespan=1
"Stop training":
$ q= True
hide screen Training_Overlay