Character love points

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
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.
Post Reply
Message
Author
briannavon
Miko-Class Veteran
Posts: 505
Joined: Mon Mar 26, 2012 6:51 pm
Location: Philadelphia
Contact:

Character love points

#1 Post by briannavon »

How do you give a character love points in a game? By love points I mean relationship points.

Also, how do change how many love points a character has based on what choices the player makes?
Join Me At LivingGame Productions!

http://livinggameproductions.blogspot.com/

User avatar
Darkmoonfire
Regular
Posts: 103
Joined: Mon Apr 25, 2011 6:41 am
Completed: Christmas Project
Organization: Lunarescent Wings
Tumblr: darkmoonfire
Contact:

Re: Character love points

#2 Post by Darkmoonfire »

Start by defining the variable.

Code: Select all

$ xlove = 0
This would be how to make it increase or decrease with different choices

Code: Select all

menu:
        "Choice X likes":
            $ xlove += 1
            "dialogue for this choice"
        "Choice X hates":
            $ xlove -= 1
            "dialogue for this choice"
Be sure to remember the $ at the front. You can increase or decrease points by whatever value you want, and not just 1.

briannavon
Miko-Class Veteran
Posts: 505
Joined: Mon Mar 26, 2012 6:51 pm
Location: Philadelphia
Contact:

Re: Character love points

#3 Post by briannavon »

One more question about this: How do you make that you can only have certain choices if the character has enogh love points?
Join Me At LivingGame Productions!

http://livinggameproductions.blogspot.com/

User avatar
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: Character love points

#4 Post by Camille »

Code: Select all

menu:
        "Choice X likes" if xlove >= 5:
            $ xlove += 1
            "dialogue for this choice"
        "Choice X hates":
            $ xlove -= 1
            "dialogue for this choice"
This makes it so that the first choice only shows up if the player has at least 5 points in xlove.

User avatar
Michiyo6918
Veteran
Posts: 262
Joined: Fri Nov 11, 2011 12:26 am
Projects: ╮(╯▽╰)╭
Location: Look behind you
Contact:

Re: Character love points

#5 Post by Michiyo6918 »

This tutorial and this one will help you better on these things.

Good luck on making your game :D
Tumblr | DA | Honest Critique
“如果那个人是神。
他想渎神。
——【黑匣子】”

Post Reply

Who is online

Users browsing this forum: No registered users