A "point" system
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.
-
VenatorUnum
- Newbie
- Posts: 8
- Joined: Sat Jan 14, 2012 11:34 am
- Contact:
A "point" system
I noticed the "if" statement being able to be used with a certain point system.
The code can make it so you get different endings depending on what your score is ex:
if points >= 10:
e "Congratulations! You're getting the best ending!"
elif points >= 5:
e "It's the good ending for you."
else:
e "Sorry, you're about to get the bad ending."
I'm wondering as to how this works, every attempt I've made so far at adding this sort of system resulted in a bunch of errors.
I've recently played the VN Katawa Shoujo where a similar system was deployed, you'd get points with a certain character for your choices and then new options would open up later.
Can anyone explain to me how this works, and what codes to use?
Thanks in advance!
The code can make it so you get different endings depending on what your score is ex:
if points >= 10:
e "Congratulations! You're getting the best ending!"
elif points >= 5:
e "It's the good ending for you."
else:
e "Sorry, you're about to get the bad ending."
I'm wondering as to how this works, every attempt I've made so far at adding this sort of system resulted in a bunch of errors.
I've recently played the VN Katawa Shoujo where a similar system was deployed, you'd get points with a certain character for your choices and then new options would open up later.
Can anyone explain to me how this works, and what codes to use?
Thanks in advance!
- DragoonHP
- Miko-Class Veteran
- Posts: 758
- Joined: Tue Jun 22, 2010 12:54 am
- Completed: Christmas
- IRC Nick: DragoonHP
- Location: Zion Island, Solario
- Contact:
Re: A "point" system
Maybe you have forgot to indent it properly.
Code: Select all
if points >= 10:
e "Congratulations! You're getting the best ending!"
elif points >= 5:
e "It's the good ending for you."
else:
e "Sorry, you're about to get the bad ending."
-
VenatorUnum
- Newbie
- Posts: 8
- Joined: Sat Jan 14, 2012 11:34 am
- Contact:
Re: A "point" system
[quote="DragoonHP"]Maybe you have forgot to indent it properly.
quote]
No I did that fine in the script itself, just had no idea how to do it here as it's my first forum post ^^
quote]
No I did that fine in the script itself, just had no idea how to do it here as it's my first forum post ^^
- DragoonHP
- Miko-Class Veteran
- Posts: 758
- Joined: Tue Jun 22, 2010 12:54 am
- Completed: Christmas
- IRC Nick: DragoonHP
- Location: Zion Island, Solario
- Contact:
Re: A "point" system
Use the code tag to post code.
And can you post a snippet of your code...
And can you post a snippet of your code...
- leon
- Miko-Class Veteran
- Posts: 554
- Joined: Sun Oct 09, 2011 11:15 pm
- Completed: Visual Novel Tycoon, Night at the Hospital, Time Labyrinth, The Buried Moon, Left of Center, Super Otome Quest
- Projects: Lemon Project, Porcelain Heart, Dream's Dénouement
- Organization: Team ANARKY
- Contact:
Re: A "point" system
The code looks fine. Maybe you forgot to declare variable points or character e? What errors are you getting?
-
VenatorUnum
- Newbie
- Posts: 8
- Joined: Sat Jan 14, 2012 11:34 am
- Contact:
Re: A "point" system
Code: Select all
I'm sorry, but an uncaught exception occurred.
While running game code:
File "game/script.rpy", line 75, in script
$ score += 5
File "game/script.rpy", line 75, in python
$ score += 5
NameError: name 'score' is not defined
-- Full Traceback ------------------------------------------------------------
Full traceback:
File "C:\Users\\Documents\RenPy Projects\renpy-6.13.7\renpy\execution.py", line 261, in run
File "C:\Users\\Documents\RenPy Projects\renpy-6.13.7\renpy\ast.py", line 630, in execute
File "C:\Users\\Documents\RenPy Projects\renpy-6.13.7\renpy\python.py", line 978, in py_exec_bytecode
File "game/script.rpy", line 75, in <module>
NameError: name 'score' is not defined
Windows-post2008Server-6.1.7601-SP1
Ren'Py 6.13.7.1646
A Ren'Py Game 0.0I'm sorry, but an uncaught exception occurred.
Code: Select all
While running game code:
File "game/script.rpy", line 75, in script
$ n += 5
File "game/script.rpy", line 75, in python
$ n += 5
TypeError: unsupported operand type(s) for +=: 'ADVCharacter' and 'int'
-- Full Traceback ------------------------------------------------------------
Full traceback:
File "C:\Users\\Documents\Projects\renpy-6.13.7\renpy\execution.py", line 261, in run
File "C:\Users\\Documents\RenPy Projects\renpy-6.13.7\renpy\ast.py", line 630, in execute
File "C:\Users\\Documents\RenPy Projects\renpy-6.13.7\renpy\python.py", line 978, in py_exec_bytecode
File "game/script.rpy", line 75, in <module>
TypeError: unsupported operand type(s) for +=: 'ADVCharacter' and 'int'
Windows-post2008Server-6.1.7601-SP1
Ren'Py 6.13.7.1646
A Ren'Py Game 0.0
Last edited by VenatorUnum on Thu Sep 16, 2021 12:45 pm, edited 1 time in total.
- DragoonHP
- Miko-Class Veteran
- Posts: 758
- Joined: Tue Jun 22, 2010 12:54 am
- Completed: Christmas
- IRC Nick: DragoonHP
- Location: Zion Island, Solario
- Contact:
Re: A "point" system
Try this...
Code: Select all
label start:
$ start = 0
-
VenatorUnum
- Newbie
- Posts: 8
- Joined: Sat Jan 14, 2012 11:34 am
- Contact:
Re: A "point" system
Thanks, that worked for a single point system but now the issue is that I'd like to assign points to invidual characters.DragoonHP wrote:Try this...
Code: Select all
label start: $ start = 0
For instance I have person A, B and C
You get a menu with three options, option 1 gives a point for person A, option 2 for B, etc..
Depending on the amount of points you have your story progresses with either A B or C depending on the amount of points you have with each character.
Any way to do this?
- DragoonHP
- Miko-Class Veteran
- Posts: 758
- Joined: Tue Jun 22, 2010 12:54 am
- Completed: Christmas
- IRC Nick: DragoonHP
- Location: Zion Island, Solario
- Contact:
Re: A "point" system
Code: Select all
menu:
"This is option 1" if gg == 1:
"hh"
"This is option 2" if gg == 2:
"hh"
Or were you asking for something else...
Re: A "point" system
Do you want to make it so that, for example, not only you have to have, say, 10 points in A, but also more points in A than in B and C for you go to A path?
http://www.renpy.org/wiki/renpy/doc/tut ... er_Choices - This article is really helpful in that case.
http://www.renpy.org/wiki/renpy/doc/tut ... er_Choices - This article is really helpful in that case.
-
VenatorUnum
- Newbie
- Posts: 8
- Joined: Sat Jan 14, 2012 11:34 am
- Contact:
Re: A "point" system
Yes that's exactly what I needed, thank you!Arcanum wrote:Do you want to make it so that, for example, not only you have to have, say, 10 points in A, but also more points in A than in B and C for you go to A path?
http://www.renpy.org/wiki/renpy/doc/tut ... er_Choices - This article is really helpful in that case.
Who is online
Users browsing this forum: Google [Bot]




