I don't see why it wouldn't work?sapiboonggames wrote:Will this code work if I change the shape of the bar?
I want to make it the shape of heart and has been wondering if this code will work as well.
Thanks!
[Tutorial]Adding a Love Meter Bar
Forum rules
Do not post questions here!
This forum is for example code you want to show other people. Ren'Py questions should be asked in the Ren'Py Questions and Announcements forum.
Do not post questions here!
This forum is for example code you want to show other people. Ren'Py questions should be asked in the Ren'Py Questions and Announcements forum.
- OokamiKasumi
- Eileen-Class Veteran
- Posts: 1779
- Joined: Thu Oct 14, 2010 3:53 am
- Completed: 14 games released -- and Counting.
- Organization: DarkErotica Games
- Deviantart: OokamiKasumi
- Location: NC, USA
- Contact:
Re: [Tutorial]Adding a Love Meter Bar
Ookami Kasumi ~ Purveyor of fine Smut.
Most recent Games Completed:
"No amount of great animation will save a bad story." -- John Lasseter of Pixar
Most recent Games Completed:
- The Walk[Psychological][NanoWinter] ~ PG New!
- Trap! [ModernFantasy][VN] ~ PG16
- The Adventures of Prince Ivan [Fant/Adv/VN] ~ PG
"No amount of great animation will save a bad story." -- John Lasseter of Pixar
- BlueJayGames
- Newbie
- Posts: 7
- Joined: Sat Jan 04, 2014 7:26 pm
- Organization: Blue Jay Games
- Contact:
Re: [Tutorial]Adding a Love Meter Bar
This is very helpful! Thank you. I'm making a transition from actionscript 3 over to ren'py/python and your tutorials are all very helpful.
- OokamiKasumi
- Eileen-Class Veteran
- Posts: 1779
- Joined: Thu Oct 14, 2010 3:53 am
- Completed: 14 games released -- and Counting.
- Organization: DarkErotica Games
- Deviantart: OokamiKasumi
- Location: NC, USA
- Contact:
Re: [Tutorial]Adding a Love Meter Bar
-- My pleasure. I love being helpful. ♥BlueJayGames wrote:This is very helpful! Thank you.
Renpy is far more user friendly than it looks!I'm making a transition from actionscript 3 over to ren'py/python and your tutorials are all very helpful.
-- The support is awesome too!
Ookami Kasumi ~ Purveyor of fine Smut.
Most recent Games Completed:
"No amount of great animation will save a bad story." -- John Lasseter of Pixar
Most recent Games Completed:
- The Walk[Psychological][NanoWinter] ~ PG New!
- Trap! [ModernFantasy][VN] ~ PG16
- The Adventures of Prince Ivan [Fant/Adv/VN] ~ PG
"No amount of great animation will save a bad story." -- John Lasseter of Pixar
Re: [Tutorial]Adding a Love Meter Bar
Hi again, I have question. I have two events going on and I wanted it to be depending how high or low you got the girl to be at, would trigger either of the two events. One being good the other being bad. Is there anyway to link it with the if statments?
Currently working on Dance With Me? - Danny Phantom Date Sim.
Link to our blog - http://dpdatesim.tumblr.com/
Currently looking for writers, and help with coding on the game. Please contact me or JaxxyLupei, on here or message on the blog.
Link to our blog - http://dpdatesim.tumblr.com/
Currently looking for writers, and help with coding on the game. Please contact me or JaxxyLupei, on here or message on the blog.
Re: [Tutorial]Adding a Love Meter Bar
Sure can - you can even have multiple levels too:Zalkyria wrote:Hi again, I have question. I have two events going on and I wanted it to be depending how high or low you got the girl to be at, would trigger either of the two events. One being good the other being bad. Is there anyway to link it with the if statments?
Code: Select all
if (person_love >= 75):
*EVENT ONE*
elif (person_love >= 50):
*EVENT TWO*
else:
*BAD EVENT*
- OokamiKasumi
- Eileen-Class Veteran
- Posts: 1779
- Joined: Thu Oct 14, 2010 3:53 am
- Completed: 14 games released -- and Counting.
- Organization: DarkErotica Games
- Deviantart: OokamiKasumi
- Location: NC, USA
- Contact:
Re: [Tutorial]Adding a Love Meter Bar
Renpy reads code from Top to Bottom; it will always check the Top event to see if it's False before it checks the next, so make sure you label the options in a way that they only pick One event not Two, or even Three.HB38 wrote:Sure can - you can even have multiple levels too... Super stripped down to the basics; but will get a different event depending on the love levels. Feel free to remove the 'elif' event too.Zalkyria wrote:Hi again, I have question. I have two events going on and I wanted it to be depending how high or low you got the girl to be at, would trigger either of the two events. One being good the other being bad. Is there anyway to link it with the if statments?
Code: Select all
Label Events_End:
if (person_love >= 75):
jump EVENT_ONE
elif (person_love >= 50):
jump EVENT_TWO
else:
jump BAD_EVENT
Ookami Kasumi ~ Purveyor of fine Smut.
Most recent Games Completed:
"No amount of great animation will save a bad story." -- John Lasseter of Pixar
Most recent Games Completed:
- The Walk[Psychological][NanoWinter] ~ PG New!
- Trap! [ModernFantasy][VN] ~ PG16
- The Adventures of Prince Ivan [Fant/Adv/VN] ~ PG
"No amount of great animation will save a bad story." -- John Lasseter of Pixar
- noeinan
- Eileen-Class Veteran
- Posts: 1153
- Joined: Sun Apr 04, 2010 10:10 pm
- Projects: Ren'Py QuickStart, Crimson Rue
- Organization: Statistically Unlikely Games
- Deviantart: noeinan
- Github: noeinan
- Location: Washington State, USA
- Contact:
Re: [Tutorial]Adding a Love Meter Bar
Thanks for the great tutorial, OokamiKasumi! After experimenting with this code, and looking at the code over here: http://lemmasoft.renai.us/forums/viewto ... 51&t=16273 I think I have figured out how to include a bar.
There was one thing I was curious about, though. What is the thumb.png for? When I tried incorporating thumb.png, I ended up with a bar that only increased by the tiniest sliver during love gain. I ran myself around in circles trying to figure out how to fix it, and what the thumbs.png/thumb_offset did before looking at another bar and realizing I could set thumb to None-- and then suddenly my bar started working perfectly.
The only thing I can think of is... The thumb might be a way of adding a different color or shadow onto the end of the bar, so it doesn't just cut off with a straight line of disappeared pixels? (I'm using a plain single color bar at the moment, so I didn't implement that kind of feature.)
There was one thing I was curious about, though. What is the thumb.png for? When I tried incorporating thumb.png, I ended up with a bar that only increased by the tiniest sliver during love gain. I ran myself around in circles trying to figure out how to fix it, and what the thumbs.png/thumb_offset did before looking at another bar and realizing I could set thumb to None-- and then suddenly my bar started working perfectly.
The only thing I can think of is... The thumb might be a way of adding a different color or shadow onto the end of the bar, so it doesn't just cut off with a straight line of disappeared pixels? (I'm using a plain single color bar at the moment, so I didn't implement that kind of feature.)
- Attachments
-
- bar_full.png (828 Bytes) Viewed 2863 times
-
- bar_hover.png (820 Bytes) Viewed 2863 times
-
- bar_empty.png (840 Bytes) Viewed 2863 times
-
- thumb.png (309 Bytes) Viewed 2863 times
- OokamiKasumi
- Eileen-Class Veteran
- Posts: 1779
- Joined: Thu Oct 14, 2010 3:53 am
- Completed: 14 games released -- and Counting.
- Organization: DarkErotica Games
- Deviantart: OokamiKasumi
- Location: NC, USA
- Contact:
Re: [Tutorial]Adding a Love Meter Bar
The thumb.png is the tiny graphic that moves on a Slider bar to allow the player to adjust the settings. Because I tend to use the same bars for Preferences --which use a thumb.png-- I tend to include it. Sorry if I confused you there.daikiraikimi wrote:Thanks for the great tutorial, OokamiKasumi! ...There was one thing I was curious about, though. What is the thumb.png for?
Ookami Kasumi ~ Purveyor of fine Smut.
Most recent Games Completed:
"No amount of great animation will save a bad story." -- John Lasseter of Pixar
Most recent Games Completed:
- The Walk[Psychological][NanoWinter] ~ PG New!
- Trap! [ModernFantasy][VN] ~ PG16
- The Adventures of Prince Ivan [Fant/Adv/VN] ~ PG
"No amount of great animation will save a bad story." -- John Lasseter of Pixar
-
- Regular
- Posts: 30
- Joined: Tue Apr 08, 2014 10:34 pm
- Projects: Dance With Me? (A date sim)
- Location: NY
Re: [Tutorial]Adding a Love Meter Bar
Okay, I keep looking this over and over but there's no explanation as to how to incorporate the actual frame image into the coding for it to show up. Can you explain that to me please?
- HimawariChiyako
- Newbie
- Posts: 22
- Joined: Thu Nov 27, 2014 6:35 am
- Completed: (Already have few, but all screwed.) --
- Projects: (Too Many.)
- Organization: --
- Deviantart: ChichinashiMizuko
- Contact:
Re: [Tutorial]Adding a Love Meter Bar
I did as you said, but i keep getting errors.
File "game/script.rpy", line 59: expected statement
show_giselle ->=True
File "game/script.rpy" , line 74: Line is indented, but the proceeding statement does not expect a block. Please check this line's indentation.
File "game/script.rpy", line 59: expected statement
show_giselle ->=True
File "game/script.rpy" , line 74: Line is indented, but the proceeding statement does not expect a block. Please check this line's indentation.
- OokamiKasumi
- Eileen-Class Veteran
- Posts: 1779
- Joined: Thu Oct 14, 2010 3:53 am
- Completed: 14 games released -- and Counting.
- Organization: DarkErotica Games
- Deviantart: OokamiKasumi
- Location: NC, USA
- Contact:
Re: [Tutorial]Adding a Love Meter Bar
The 'frame' used in the meter bar is the same frame used by the rest of the game.JaxxyLupei wrote:Okay, I keep looking this over and over but there's no explanation as to how to incorporate the actual frame image into the coding for it to show up. Can you explain that to me please?
You can change the frame by adding this in options.rpy:
Code: Select all
style.frame.background = Frame("ui/YourFrameImage.png",5,5)
Code: Select all
# custom frame
style.my_frame.background = Frame("ui/YourFrameImage.png",5,5)
Code: Select all
## ------------ Love Points Floater ----------------------
def stats_overlay():
# --- Giselle's Love Bar -------
if show_giselle:
ui.frame(
xalign = 0.5, #centered
ypos = 400, #400 px Down from the Top
style="my_frame")
ui.vbox(xalign = 0.5)
ui.text ("Giselle's Love Points: %d" %giselle_love,
xalign = 0.5)
ui.bar(max_love, giselle_love,
style="my_bar")
ui.close()
# --- Arthur's Love Bar -------
if show_arthur:
ui.frame(
xalign = 0.5,
ypos = 400,
style="my_frame")
ui.vbox()
ui.text ("Arthur's Love Points: %d" %arthur_love,
xalign = 0.5)
ui.bar(max_love, arthur_love,
style="my_bar")
ui.close()
# --- Shino's Love Bar -------
if show_shino:
ui.frame(
xalign = 0.5,
ypos = 400,
style="my_frame")
ui.vbox()
ui.text ("Shino's Love Points: %d" %shino_love,
xalign = 0.5)
ui.bar(max_love, shino_love,
style="my_bar")
ui.close()
config.overlay_functions.append(stats_overlay)
-- Make sure you pay close attention to your COMMAS!
Ookami Kasumi ~ Purveyor of fine Smut.
Most recent Games Completed:
"No amount of great animation will save a bad story." -- John Lasseter of Pixar
Most recent Games Completed:
- The Walk[Psychological][NanoWinter] ~ PG New!
- Trap! [ModernFantasy][VN] ~ PG16
- The Adventures of Prince Ivan [Fant/Adv/VN] ~ PG
"No amount of great animation will save a bad story." -- John Lasseter of Pixar
- OokamiKasumi
- Eileen-Class Veteran
- Posts: 1779
- Joined: Thu Oct 14, 2010 3:53 am
- Completed: 14 games released -- and Counting.
- Organization: DarkErotica Games
- Deviantart: OokamiKasumi
- Location: NC, USA
- Contact:
Re: [Tutorial]Adding a Love Meter Bar
This is an Indentation or Spacing error.HimawariChiyako wrote:I did as you said, but i keep getting errors.Code: Select all
File "game/script.rpy", line 59: expected statement show_giselle ->=True File "game/script.rpy" , line 74: Line is indented, but the proceeding statement does not expect a block. Please check this line's indentation.
-- According to this error, you've indented line 74 and you shouldn't have.
How the code should look:
Code: Select all
$ show_giselle=True
pause 0.5
$ giselle_love+=50
#The Announcement Text for the Love Bar
show expression Text("{color=ffffff}{font=fo/LHFmisterkookyREG_0.TTF}+50 Love Points{/font}{/color}",
size=50,
yalign=0.5,
xalign=0.5,
drop_shadow=(2, 2)) as text
with dissolve
$ show_giselle=True
$ renpy.pause() #This keeps the bar visible until the player hits a key.
hide text with dissolve
$ show_giselle=False
Ookami Kasumi ~ Purveyor of fine Smut.
Most recent Games Completed:
"No amount of great animation will save a bad story." -- John Lasseter of Pixar
Most recent Games Completed:
- The Walk[Psychological][NanoWinter] ~ PG New!
- Trap! [ModernFantasy][VN] ~ PG16
- The Adventures of Prince Ivan [Fant/Adv/VN] ~ PG
"No amount of great animation will save a bad story." -- John Lasseter of Pixar
- HimawariChiyako
- Newbie
- Posts: 22
- Joined: Thu Nov 27, 2014 6:35 am
- Completed: (Already have few, but all screwed.) --
- Projects: (Too Many.)
- Organization: --
- Deviantart: ChichinashiMizuko
- Contact:
Re: [Tutorial]Adding a Love Meter Bar
Okay, I'll check that out, Thank you.OokamiKasumi wrote:This is an Indentation or Spacing error.HimawariChiyako wrote:I did as you said, but i keep getting errors.Code: Select all
File "game/script.rpy", line 59: expected statement show_giselle ->=True File "game/script.rpy" , line 74: Line is indented, but the proceeding statement does not expect a block. Please check this line's indentation.
-- According to this error, you've indented line 74 and you shouldn't have.
How the code should look:Code: Select all
$ show_giselle=True pause 0.5 $ giselle_love+=50 #The Announcement Text for the Love Bar show expression Text("{color=ffffff}{font=fo/LHFmisterkookyREG_0.TTF}+50 Love Points{/font}{/color}", size=50, yalign=0.5, xalign=0.5, drop_shadow=(2, 2)) as text with dissolve $ show_giselle=True $ renpy.pause() #This keeps the bar visible until the player hits a key. hide text with dissolve $ show_giselle=False
- OokamiKasumi
- Eileen-Class Veteran
- Posts: 1779
- Joined: Thu Oct 14, 2010 3:53 am
- Completed: 14 games released -- and Counting.
- Organization: DarkErotica Games
- Deviantart: OokamiKasumi
- Location: NC, USA
- Contact:
Re: [Tutorial]Adding a Love Meter Bar
Also, make sure you actually have the font used in the announcement messages. That will cough up errors too.HimawariChiyako wrote:Okay, I'll check that out, Thank you.
Ookami Kasumi ~ Purveyor of fine Smut.
Most recent Games Completed:
"No amount of great animation will save a bad story." -- John Lasseter of Pixar
Most recent Games Completed:
- The Walk[Psychological][NanoWinter] ~ PG New!
- Trap! [ModernFantasy][VN] ~ PG16
- The Adventures of Prince Ivan [Fant/Adv/VN] ~ PG
"No amount of great animation will save a bad story." -- John Lasseter of Pixar
Who is online
Users browsing this forum: No registered users