How to add "relationship meters" and "turns" to renpy...
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.
- laprimavera
- Newbie
- Posts: 15
- Joined: Mon Aug 08, 2011 6:27 pm
- Contact:
How to add "relationship meters" and "turns" to renpy...
Does anyone know how to add turns and relationship meters to renpy? For the turns, depending on which turn, there will be an event triggered (such as on turn 10 there will be an automatic event after finishing the turn and before the next turn starts). And does anyone know how to add relationship meters to renpy also? so depending on how much visits to the person, the meter will increase (or decrease if you offend the person). It is a map based game (that's what the visits mean) and i want the game to be that depending on how much time you visit the person, the meter will increase. And, if possible, I want there to be other things to affect another meter (this meter is about the main character's morale and health).
- Rewritten Ennui
- Veteran
- Posts: 279
- Joined: Thu Jul 14, 2011 1:50 pm
- Organization: TwinTurtle Games
- Contact:
Re: How to add "relationship meters" and "turns" to renpy...
Code: Select all
label start:
$ Bob = 0
$ Joe = 0
$ Tom = 0
Code: Select all
menu:
"What should you say to Bob?"
"\"I think you're really cool.\"":
$ Bob += 1
"Bob" "Thanks for the complement."
"\I totally hate your guts and stuff.\"":
$ Bob -= 1
"Bob" "I am suddenly feeling very offended!"Code: Select all
if Bob >= 5:
"Bob" "I kinda like you."
else:
"Bob" "Oh, so we meet again?"And that's about it for your relationship meter. As for health and morale, that sounds like something that the Dating Sim Engine could do. DSE is rather powerful though, so you shouldn't tinker with it unless your confident about your coding skills. I really can't help you with your map dilemma though; you'll have to give me an example of an existing game that has a feature like that before I can suggest anything. Hopefully I helped you a little bit, and good luck.
I've swapped accounts to CheeryMoya, so this account is no longer in use. Refer to the new account if you want to contact me.
Twinturtle Games Website
Twinturtle Games Website
- laprimavera
- Newbie
- Posts: 15
- Joined: Mon Aug 08, 2011 6:27 pm
- Contact:
Re: How to add "relationship meters" and "turns" to renpy...
Thanks so much for replying so fast! The information you provided was very helpful
.
What I mean by "turns" is that every time you visit someone on the map I'm talking about, the turn includes the visit and any event that happens in between.
For example, visiting person A 10 times is 10 turns. Visiting person A 8 times and person B 2 times is also 10 turns. I want, after a specific amount of turns, there is an event played.
So, for example, after visiting person person A on your 10th turn, and depending on your relationship level, an cg event is triggered with that person. I'd like to know how to do that
What I mean by "turns" is that every time you visit someone on the map I'm talking about, the turn includes the visit and any event that happens in between.
For example, visiting person A 10 times is 10 turns. Visiting person A 8 times and person B 2 times is also 10 turns. I want, after a specific amount of turns, there is an event played.
So, for example, after visiting person person A on your 10th turn, and depending on your relationship level, an cg event is triggered with that person. I'd like to know how to do that
- laprimavera
- Newbie
- Posts: 15
- Joined: Mon Aug 08, 2011 6:27 pm
- Contact:
Re: How to add "relationship meters" and "turns" to renpy...
I'm also wondering how to make a transparent menu in renpy, where the widgets are clear and you can see the background.
- Rewritten Ennui
- Veteran
- Posts: 279
- Joined: Thu Jul 14, 2011 1:50 pm
- Organization: TwinTurtle Games
- Contact:
Re: How to add "relationship meters" and "turns" to renpy...
Sorry, still stumped
The only thing I can think of right now is the imagemap function, which will let you use an image and hotspots. You can combine it with the points system I mentioned earlier, but you have to set up the imagemap first. I already answered a question like this earlier, so here's pretty much a copypasta of my code.
"imagemap_%s.jpg" saves you some space by referring to two files simultaneously; "imagemap_ground.jpg" and "imagemap_hover.jpg". The hover image should be the same as the ground image, except with something indicating a hotspot's presence. Notice the 4 numbers in parenthesis after hotspot. The first two numbers indicate the upper-lefthand corner, while the last two numbers indicate the lower-righthand corner. All the space in-between is the hotspot itself, which will reveal itself when you hover your mouse over it.
To implement the imagemap in the game, the code looks like this. I'll modify it so that way there are also points for turns.
Be sure to define the 'turn' variable first. So while this is a rather crude way of keeping track of visits, it should get the job done for you.
As for your transparent menus, I don't know >_> I have absolutely no idea how to do that, but maybe you should go search in some older topics. I had a lot of my questions answered that way, and you'd be surprised at how often the same types of questions are asked.
Code: Select all
screen Town:
imagemap:
auto "imagemap_%s.jpg"
hotspot (57, 81, 149, 194) action Return("Bob's house")
hotspot (207, 145, 310, 210) action Return(Joe's house")
hotspot (220, 25, 340, 90) action Return("Tom's house")To implement the imagemap in the game, the code looks like this. I'll modify it so that way there are also points for turns.
Code: Select all
window hide None
call screen Town
window show None
if _return == "Bob's house":
$ turn += 1
"You visited Bob."
elif _return == "Joe's house":
$ turn += 1
"You visited Joe."
elif _return == "Tom's house":
$ turn += 1
"You visited Tom."As for your transparent menus, I don't know >_> I have absolutely no idea how to do that, but maybe you should go search in some older topics. I had a lot of my questions answered that way, and you'd be surprised at how often the same types of questions are asked.
I've swapped accounts to CheeryMoya, so this account is no longer in use. Refer to the new account if you want to contact me.
Twinturtle Games Website
Twinturtle Games Website
- laprimavera
- Newbie
- Posts: 15
- Joined: Mon Aug 08, 2011 6:27 pm
- Contact:
Re: How to add "relationship meters" and "turns" to renpy...
Is there any way for a meter to be shown on the screen?
- laprimavera
- Newbie
- Posts: 15
- Joined: Mon Aug 08, 2011 6:27 pm
- Contact:
Re: How to add "relationship meters" and "turns" to renpy...
If you still don't understand what "turns" mean, if you are familiar with Heart no Kuni no Alice and other games of the like, then you would know what it is. In the game, every 10 turns is a cg. In each turn you talk to a person, and that is the turn. During the 10th turn, after talking to a person, you get a cg with the person you just talked to (if your relationship level is high enough with them).
Like I said earlier, I'd like to also know how to put a chart or meter on one of the menu buttons so players can keep track of relationship levels.
The imagemap definatly helps with the "turn" question I have, but I 'd like cg's to be shown every few turns depending on the relationship level.
I guess I'll explain it better now:
I have a good idea of how it should work, but I don't know how to implement it into Ren'Py.
I want to use a code like this:
But except for words, I want pictures. For the "else" part, I want it to be the Jump function, so it continues onward with the game, skipping the cg.
Like I said earlier, I'd like to also know how to put a chart or meter on one of the menu buttons so players can keep track of relationship levels.
The imagemap definatly helps with the "turn" question I have, but I 'd like cg's to be shown every few turns depending on the relationship level.
I guess I'll explain it better now:
I have a good idea of how it should work, but I don't know how to implement it into Ren'Py.
I want to use a code like this:
Code: Select all
if Bob >= 5:
"Bob" "I kinda like you."
else:
"Bob" "Oh, so we meet again?"- Rewritten Ennui
- Veteran
- Posts: 279
- Joined: Thu Jul 14, 2011 1:50 pm
- Organization: TwinTurtle Games
- Contact:
Re: How to add "relationship meters" and "turns" to renpy...
I haven't played Heart no Kuni no Alice, nor am I able to find any gameplay vids of it. If you can find one to show me, then I'll understand it better. As for showing those relationship levels, the easiest way to let the player see them would be to use the DSE framework. I've been trying to pull out the code and test it on a new template, but I can't seem to find the exact string of commands to show the meters that you want
Sorry, I'm still trying to learn advanced commands myself.
But showing a picture during an event is easy. Just use the 'scene' statement.
It's really simple stuff. It's mainly trying to keep the blocks in order and stuff. I suggest you familiarize yourself with the Ren'Py jargon some more by reading the tutorials, which are right here. Hopefully you'll find answers to most of your questions.
But showing a picture during an event is easy. Just use the 'scene' statement.
Code: Select all
if Bob >= 5:
scene Bob doing stuff
"Bob" "So... you want to go to the movies or something?"
else:
jump somewhereI've swapped accounts to CheeryMoya, so this account is no longer in use. Refer to the new account if you want to contact me.
Twinturtle Games Website
Twinturtle Games Website
- laprimavera
- Newbie
- Posts: 15
- Joined: Mon Aug 08, 2011 6:27 pm
- Contact:
Re: How to add "relationship meters" and "turns" to renpy...
I know a link to where you can download it. It's in japanese, and you can use the link I provided to translate it. Should I private message you the link?
- Camille
- Eileen-Class Veteran
- Posts: 1227
- Joined: Sat Apr 23, 2011 2:43 pm
- Completed: Please see http://trash.moe
- Projects: the head well lost
- Organization: L3
- Tumblr: narihira
- Deviantart: crownwaltz
- itch: lore
- Contact:
Re: How to add "relationship meters" and "turns" to renpy...
I added this page to the cookbook, which shows how to show points and meters and whatnot on the screen. For the turns, you'd just use a variable, right? Like make:
And then as you go through the game, keep adding +1 to turns. When you want a CG:
Something like that. It's not too hard.
Code: Select all
init:
$ turns = 0Code: Select all
if turns == 10 and bob_points > larry_points:
show image bob_cg- laprimavera
- Newbie
- Posts: 15
- Joined: Mon Aug 08, 2011 6:27 pm
- Contact:
Re: How to add "relationship meters" and "turns" to renpy...
thanks Camille! It helped a lot 
Do you know how to make the menu buttons transparent?
Do you know how to make the menu buttons transparent?
- Camille
- Eileen-Class Veteran
- Posts: 1227
- Joined: Sat Apr 23, 2011 2:43 pm
- Completed: Please see http://trash.moe
- Projects: the head well lost
- Organization: L3
- Tumblr: narihira
- Deviantart: crownwaltz
- itch: lore
- Contact:
Re: How to add "relationship meters" and "turns" to renpy...
There's a transform property called "alpha" that controls the opacity of a displayable. Alternately, if you're using image buttons, you could just make your image transparent.
- laprimavera
- Newbie
- Posts: 15
- Joined: Mon Aug 08, 2011 6:27 pm
- Contact:
Re: How to add "relationship meters" and "turns" to renpy...
for the init part, do you add that to the script, or another .rpy file?
- Camille
- Eileen-Class Veteran
- Posts: 1227
- Joined: Sat Apr 23, 2011 2:43 pm
- Completed: Please see http://trash.moe
- Projects: the head well lost
- Organization: L3
- Tumblr: narihira
- Deviantart: crownwaltz
- itch: lore
- Contact:
Re: How to add "relationship meters" and "turns" to renpy...
It doesn't really matter where you put it as long as you indent properly. More on that here.
Who is online
Users browsing this forum: Bing [Bot], Google [Bot], _ticlock_

