Show change in UI meter automatically [Solved]
Posted: Tue Nov 04, 2014 9:17 pm
I have a UI code I figured out the basics for a little while ago, where I based it on another user's tutorial code, but expanded upon it a litle.
Now, the way they had it set up I would need to input this entire block of code to show whenever the points go up in-game.
Now, this is a bit of a pain to put in at every single menu choice that changes the amount of points you have. (There are 66 of these in one route alone, not counting the extra/present scenes or other routes. Altogether, there would be at least 500.)
Does anyone have any idea what kind of code I'd need to put in to make it so that:
1) It shows UI bar like above
2) Show the change from before the points were added to after, without having to manually input the points like above
3) Make the change dissolve without having to show the text expression
This is a scenario that takes place in the game:
As you can see, the menu happens, points are added accordingly, and the bar is shown at the very end of the event before it returns. For the code to work as-is, I would have to make the bar show up immediately after the choice, which I feel would disrupt the flow. Otherwise, I would have to go in and do
or something like that. Slightly less tedious, but still a bit much since I'd have to make it 'if specific menu choice' for each menu. I feel like there has to be some better way to do this, right?
To put it simply: I just want to have the love meter show up at the end of an event, show what points you had prior to that event, and then show what points you have now with a dissolve transition.
Now, the way they had it set up I would need to input this entire block of code to show whenever the points go up in-game.
Code: Select all
$ show_mi_meter = True
# This makes the Meter appear.
pause 0.5
# This makes the meter sit there for half a second, so that when the points
# are added, the player can actually 'see' the meter extend.
$ mi_pts += 8
#This adds points to the meter.
show expression Text("Affection Up!",
size=50,
yalign=0.5, # Centers the text -- Toward Bottom.
xalign=0.5, # Centers the text -- Toward Right.
drop_shadow=(2, 2)) as text
with dissolve
# This is the Announcement Text for the Love Meter, including a specific font, and font color.
# This states how many points Giselle is being awarded.
# Note the FONT! If you use this code without replacing the font Name with one In Your Game,
# you will get an error message.
$ show_mi_meter = True
# This is a Refresh that shows the increase in points ON the meter.
$ renpy.pause()
#This keeps the bar visible until the player hits a key.
hide text with dissolve
# This hides the Text.
$ show_mi_meter = False
# This hides the Meter.
Does anyone have any idea what kind of code I'd need to put in to make it so that:
1) It shows UI bar like above
2) Show the change from before the points were added to after, without having to manually input the points like above
3) Make the change dissolve without having to show the text expression
This is a scenario that takes place in the game:
Code: Select all
menu:
"\(Take a drink.\)":
$ mi_pts += 8
"Well, maybe this won't be so bad. It's not like she'd lie about that kind of thing too, right?"
"I grabbed the cup and took a long sip, letting the flavor wash down me."
"\(Eat the cinnamon roll.\)":
$ mi_pts += 6
"...That cinnamon roll looks pretty good. I'll just nibble on that for now."
mi "Not thirsty? Suit yourself."
"\(Do nothing.\)":
$ mi_pts += 4
"This whole situation bothered me. It just felt... awkward. I didn't know what to do."
mi "Ah... are you alright?"
"She and I spent a little while together, but it didn't feel like we connected that well."
# --- MORI LOVE METER CODE ---
$ show_mi_meter = True
# This makes the Meter appear.
$ show_mi_meter = True
# This is a Refresh that shows the increase in points ON the meter.
$ renpy.pause()
#This keeps the bar visible until the player hits a key.
hide text with dissolve
# This hides the Text.
$ show_mi_meter = False
# This hides the Meter.
# --- MORI LOVE METER CODE ---
return
Code: Select all
# --- MORI LOVE METER CODE ---
$ show_mi_meter = True
# This makes the Meter appear.
if "\(Take a drink.\)":
$ mi_pts += 8
[repeat for other choices]
$ show_mi_meter = True
# This is a Refresh that shows the increase in points ON the meter.
$ renpy.pause()
#This keeps the bar visible until the player hits a key.
hide text with dissolve
# This hides the Text.
$ show_mi_meter = False
# This hides the Meter.
# --- MORI LOVE METER CODE ---
To put it simply: I just want to have the love meter show up at the end of an event, show what points you had prior to that event, and then show what points you have now with a dissolve transition.


