Visible attraction points in dating game?
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Visible attraction points in dating game?
Hello! I've looked and looked, but I can't seem to find the answer for my question. I'm currently working on a dating sim (not using the DSE engine, just so you know, because I can't figure out how it would work the way I want it to), and so far I know how to increase and decrease certain points depending on your choices throughout the game. For example, the attraction points for a specific character might go up when you're nice towards them, or decrease if you do things they don't like.
Now, my question is, how do I make these points visible? My mind wanders to the beating hearts in some of the Harvest Moon games - the ones that also change colour and get bigger depending on how much attraction points you have. I'm not sure I would be able to pull that off since I'm not really an amazing coder, so otherwise I was thinking of showing a point bar. Much like health bars, except they increase or decrease depending on your attraction points for a certain character... Yeah, you get it. I'm just tired right now.
I can easily draw the images for these things, but the question is, how would I make this work properly? How can I put, for example, the bar, in a good position and how do I make it change depending on the points?
Now, my question is, how do I make these points visible? My mind wanders to the beating hearts in some of the Harvest Moon games - the ones that also change colour and get bigger depending on how much attraction points you have. I'm not sure I would be able to pull that off since I'm not really an amazing coder, so otherwise I was thinking of showing a point bar. Much like health bars, except they increase or decrease depending on your attraction points for a certain character... Yeah, you get it. I'm just tired right now.
I can easily draw the images for these things, but the question is, how would I make this work properly? How can I put, for example, the bar, in a good position and how do I make it change depending on the points?
-
- Eileen-Class Veteran
- Posts: 1686
- Joined: Mon Sep 21, 2009 8:03 pm
- Projects: E-mail me if you wanna rock the planet
- Location: USA
- Contact:
Re: Visible attraction points in dating game?
Uh, I saw it in the Cookbook at one point...
Was it covered in the DSE recipes, guys?
Was it covered in the DSE recipes, guys?
Don't worry, we can get through it together. I didn't forget about you! I just got overwhelmed.
https://cherylitou.wordpress.com
https://cherylitou.wordpress.com
-
- Eileen-Class Veteran
- Posts: 1265
- Joined: Fri Aug 31, 2007 7:02 am
- Projects: 0 completed game. Still haven't made any meaningfully completed games...
- Contact:
Re: Visible attraction points in dating game?
You can use ui.bar overlay like so:Crowley wrote:Much like health bars, except they increase or decrease depending on your attraction points for a certain character...
Code: Select all
init python:
max_love=100
current_love=50
show_stats=False
def stats_overlay():
if show_stats:
ui.frame()
ui.vbox()
ui.text("Love meter")
ui.bar(max_love,current_love, xmaximum=150)
ui.close()
config.overlay_functions.append(stats_overlay)
label start:
$ show_stats=True
"Game start"
$ current_love+=10
"Increase love point"
$ current_love-=10
"Decrease love point"
You can read about overlay here:http://www.renpy.org/wiki/renpy/doc/reference/Overlays
You can read about properties here:http://www.renpy.org/wiki/renpy/doc/ref ... Properties
I suspect somebody is stealing my internet identity so don't believe everything I tell you via messages. I don't post or send messages anymore so don't believe anything I tell you via messages or posts.
-
- Eileen-Class Veteran
- Posts: 1686
- Joined: Mon Sep 21, 2009 8:03 pm
- Projects: E-mail me if you wanna rock the planet
- Location: USA
- Contact:
Re: Visible attraction points in dating game?
Bookmark'd for future reference.
Don't worry, we can get through it together. I didn't forget about you! I just got overwhelmed.
https://cherylitou.wordpress.com
https://cherylitou.wordpress.com
Re: Visible attraction points in dating game?
Thank you kindly, I'll post again if there are any problems.
Re: Visible attraction points in dating game?
I went ahead and put that in my date sim, and i got these errors
I'm sorry, but errors were detected in your script. Please correct the
errors listed below, and try again.
File "game\script.rpy", line 2: python block expects a non-empty block.
init python:
^
File "game\script.rpy", line 4: expected statement.
max_love=100
^
File "game\script.rpy", line 5: expected statement.
current_love=50
^
File "game\script.rpy", line 6: expected statement.
show_stats=False
^
File "game\script.rpy", line 8: expected statement.
def stats_overlay():
^
File "game\script.rpy", line 16: expected statement.
config.overlay_functions.append(stats_overlay)
^
Ren'Py Version: Ren'Py 6.14.1.366
I'm sorry, but errors were detected in your script. Please correct the
errors listed below, and try again.
File "game\script.rpy", line 2: python block expects a non-empty block.
init python:
^
File "game\script.rpy", line 4: expected statement.
max_love=100
^
File "game\script.rpy", line 5: expected statement.
current_love=50
^
File "game\script.rpy", line 6: expected statement.
show_stats=False
^
File "game\script.rpy", line 8: expected statement.
def stats_overlay():
^
File "game\script.rpy", line 16: expected statement.
config.overlay_functions.append(stats_overlay)
^
Ren'Py Version: Ren'Py 6.14.1.366
Re: Visible attraction points in dating game?
nevermind i solved that.
- Ayutac
- Regular
- Posts: 150
- Joined: Thu Oct 18, 2012 2:23 pm
- Projects: Pokémon Dating Sim
- Organization: A Breeze Of Science
- Deviantart: Ubro
- Location: Mayence, Germany
- Contact:
Re: Visible attraction points in dating game?
The what? No, seriously, what Dating Sim Engine? Link it please. And oh, I hope it is not so good as mine or my work would be in vain...Crowley wrote:Hello! I've looked and looked, but I can't seem to find the answer for my question. I'm currently working on a dating sim (not using the DSE engine
Up next: An original, open source, text-based Dating Sim. Stay tuned ;)
Re: Visible attraction points in dating game?
Actually what do you do if you have 5 different girls. I'm making a date sim based on Danny Phantom, and I am using 5 bachlorettes. Please help.
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.
-
- Lemma-Class Veteran
- Posts: 2473
- Joined: Wed Sep 29, 2004 1:38 pm
- Contact:
Re: Visible attraction points in dating game?
Here you go. And here is the documentation on how the DSE works. Look it over to see if you understand it, and if you find the code useful. Keep in mind that it was created in 2007 and last updated in 2008.Ayutac wrote:The what? No, seriously, what Dating Sim Engine? Link it please. And oh, I hope it is not so good as mine or my work would be in vain...
- Ayutac
- Regular
- Posts: 150
- Joined: Thu Oct 18, 2012 2:23 pm
- Projects: Pokémon Dating Sim
- Organization: A Breeze Of Science
- Deviantart: Ubro
- Location: Mayence, Germany
- Contact:
Re: Visible attraction points in dating game?
Ohhhhh, that thing. Now I'm relieved since the concept (choose your actions for the day, then do them) is different from mine (DAYWDAYWDAYW do anything you want (as long as you have HP))
Up next: An original, open source, text-based Dating Sim. Stay tuned ;)
Re: Visible attraction points in dating game?
What about if you have more than one bachlorette?JQuartz wrote:You can use ui.bar overlay like so:Crowley wrote:Much like health bars, except they increase or decrease depending on your attraction points for a certain character...You can read about uis here:http://www.renpy.org/wiki/renpy/doc/ref ... _FunctionsCode: Select all
init python: max_love=100 current_love=50 show_stats=False def stats_overlay(): if show_stats: ui.frame() ui.vbox() ui.text("Love meter") ui.bar(max_love,current_love, xmaximum=150) ui.close() config.overlay_functions.append(stats_overlay) label start: $ show_stats=True "Game start" $ current_love+=10 "Increase love point" $ current_love-=10 "Decrease love point"
You can read about overlay here:http://www.renpy.org/wiki/renpy/doc/reference/Overlays
You can read about properties here:http://www.renpy.org/wiki/renpy/doc/ref ... Properties
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: Visible attraction points in dating game?
I had a previous game that used what you mentioned (the Harvest Moon heart thing) and the code's kind of disgusting to look at, but it might help as a springboard. I did a Button in the corner (Mine was an imagebutton but I'll just use Textbutton for simplicity)
and a screen for it to show:
These can be in their own separate file or screens.rpy. I like to put it in a separate one personally.
Like I said, kind of juryrigged (especially that big if...else block in the screen. Yuck.) but it works and displays one of six colors of throbbing (unpleasant word) hearts based on your affection with that character (I defined the heart images as Displayables at the beginning of the game to make them throb). The first variable I have there is the name [y], then their affection they have for you [Y_points] that can be added to or subtracted at any point in the game and finally the max affection they could get [aff_max]. All defined somewhere in the script.
If you want bars, it's much easier.
And to have this button show up simply have this
In the script at the very first instance of when you want the player to be able to check their relationship meters. Need to hide it?
and an example in script:
Hope that helps somehow. I'm sure it's not the best or classiest way to do it, but it works and if you just want a helping hand understanding how you could do this it gets the job done.
Code: Select all
screen love_button:
textbutton _("Relationships"):
xalign 1.0
yalign 0.0
action Show("Love_meters")
Code: Select all
screen Love_meters:
if Y_points < 101:
$ y_aff = "[y]: [Y_points]/[aff_max] {image=blueheart}"
elif Y_points in range(101,200):
$ y_aff = "[y]: [Y_points]/[aff_max] {image=greenheart}"
elif Y_points in range(201,300):
$ y_aff = "[y]: [Y_points]/[aff_max] {image=yellowheart}"
elif Y_points in range(301,400):
$ y_aff = "[y]: [Y_points]/[aff_max] {image=orangeheart}"
elif Y_points in range(401,499):
$ y_aff = "[y]: [Y_points]/[aff_max] {image=pinkheart}"
else:
$ y_aff = "[y]: [aff_max]/[aff_max] {image=redheart}"
#Rinse and repeat for additional love interests
vbox:
xalign .5
yalign .25
text y_aff:
size 50
null height 10
#Rinse and repeat for additional love interests
Like I said, kind of juryrigged (especially that big if...else block in the screen. Yuck.) but it works and displays one of six colors of throbbing (unpleasant word) hearts based on your affection with that character (I defined the heart images as Displayables at the beginning of the game to make them throb). The first variable I have there is the name [y], then their affection they have for you [Y_points] that can be added to or subtracted at any point in the game and finally the max affection they could get [aff_max]. All defined somewhere in the script.
If you want bars, it's much easier.
Code: Select all
screen Love_meters:
vbox:
xalign .5
yalign .25
text "[y]: [Y_points]/[aff_max]":
size 50
bar:
value Y_points
range aff_max
xmaximum 300
null height 10
#Rinse and repeat for additional love interests
Code: Select all
show screen love_button
Code: Select all
hide screen love_button
Code: Select all
label start:
$ Y_point = 0
$ aff_max = 500
$ y = "Erik"
show screen love_meters
Y "Love me, why won't you love me abloobloobloo."
$ Y_point += 5
-
- Newbie
- Posts: 14
- Joined: Sat Apr 12, 2014 3:56 pm
- Projects: Shifting Realities
- Contact:
Re: Visible attraction points in dating game?
I was so happy to have stumbled upon the code that you presented here, but when I incorporated it into my game there was an error.15nick wrote:
The error that the traceback.txt gives me is: "TypeError: 'ScreenLangScreen" object is not iterable"
I've tried looking up what this means -- it seems like something isn't being recalled by the engine, but I'm not sure how to fix that. Do you have any insights?
Re: Visible attraction points in dating game?
Maiden-of-Wolves wrote:I was so happy to have stumbled upon the code that you presented here, but when I incorporated it into my game there was an error.15nick wrote:
The error that the traceback.txt gives me is: "TypeError: 'ScreenLangScreen" object is not iterable"
I've tried looking up what this means -- it seems like something isn't being recalled by the engine, but I'm not sure how to fix that. Do you have any insights?
Can you post the code you were getting? Cuz mine worked perfectly. Although I used the bar one, not the hearts one ;o
Who is online
Users browsing this forum: Bing [Bot], Google [Bot], Sugar_and_rice