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.
-
DaveC64
- Newbie
- Posts: 6
- Joined: Sat Jun 26, 2010 11:41 am
-
Contact:
#1
Post
by DaveC64 » Sat Jun 30, 2012 6:19 am
Hi everyone
I would like to include a very simply points system in my game, but I just can't seem to figure it out...
Here is my code:
At the beginning of the game
Code: Select all
# The game starts here.
label start:
$ Jane_love_point = 0
$ Jess_love_point = 0
$ Jem_love_point = 0
scene bg door
with Dissolve(.5)
Where the love point comes in
Code: Select all
Jane "Wooh... what have you got in that bag boy, it weighs a ton!"
T "Just all of my stuff... Well at least you known I don't have it stuffed full of Blow-up Dolls"
$ Jane_love_point += 1
show Jane
"Janes smiles at Tom again"
Where I want that love point to have an affect
Code: Select all
if Jane_love_point +1:
Jane "Ye... He is seems like a nice lad."
Jess "Ye ye... but is he NICE NICE???"
else:
Jane "Well he seems ok I geuss..."
Jess "Just OK???..."
Any help would be great thanks guys.
Cheers
-
rinrin
- Veteran
- Posts: 211
- Joined: Thu Apr 16, 2009 9:18 am
- Completed: Several.
- Projects: Several.
-
Contact:
#2
Post
by rinrin » Sat Jun 30, 2012 6:31 am
It's this part:
It should be:
-
DaveC64
- Newbie
- Posts: 6
- Joined: Sat Jun 26, 2010 11:41 am
-
Contact:
#3
Post
by DaveC64 » Sat Jun 30, 2012 7:24 am
YES that works!!! thanks,
How would I do a range, say form 5 love points to 10 at activate a menu???
-
rinrin
- Veteran
- Posts: 211
- Joined: Thu Apr 16, 2009 9:18 am
- Completed: Several.
- Projects: Several.
-
Contact:
#4
Post
by rinrin » Sat Jun 30, 2012 8:04 am
Something like:
Code: Select all
if Jane_love_point >= 5 and Jane_love_point <= 10
I'm not entirely sure what you mean by the menu activation part? Adding an choice to the menu that only appears if the points are between 5 and 10?
-
DaveC64
- Newbie
- Posts: 6
- Joined: Sat Jun 26, 2010 11:41 am
-
Contact:
#5
Post
by DaveC64 » Sat Jun 30, 2012 11:11 am
rinrin wrote:Something like:
Code: Select all
if Jane_love_point >= 5 and Jane_love_point <= 10
Thanks again
Just to check we are on the right lines, if a player got 8 love points, would that activate that bit of code you gave?
rinrin wrote:I'm not entirely sure what you mean by the menu activation part? Adding an choice to the menu that only appears if the points are between 5 and 10?
I just mean really to turn on certain bits of text or other menus using the 'if' and 'else' code within the love points the player may have earn so far.
-
rinrin
- Veteran
- Posts: 211
- Joined: Thu Apr 16, 2009 9:18 am
- Completed: Several.
- Projects: Several.
-
Contact:
#6
Post
by rinrin » Sat Jun 30, 2012 11:23 am
DaveC64 wrote:Just to check we are on the right lines, if a player got 8 love points, would that activate that bit of code you gave?
Yes, that should work.
-
DaveC64
- Newbie
- Posts: 6
- Joined: Sat Jun 26, 2010 11:41 am
-
Contact:
#7
Post
by DaveC64 » Sat Jun 30, 2012 5:24 pm
Thanks for all your help Rinrin

-
rinrin
- Veteran
- Posts: 211
- Joined: Thu Apr 16, 2009 9:18 am
- Completed: Several.
- Projects: Several.
-
Contact:
#8
Post
by rinrin » Sun Jul 01, 2012 12:26 am
You're welcome

Users browsing this forum: Bing [Bot]