Points System?

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.
Message
Author
User avatar
ShiroXIX
Regular
Posts: 50
Joined: Thu Sep 27, 2012 10:55 pm
Projects: deadlyS7NS
Organization: XIX
Location: Jacksonville, FL
Contact:

Points System?

#1 Post by ShiroXIX »

So, in my game, deadlyS7NS, I'd like for each character to rack up points during the opening chapter. IE:

When you get the option to follow Hawk or help Randy and you chose to follow Hawk, Hawk gets 1 point and you enter his first scene. When he asks you to smoke with him, choosing yes gets you 2 points in Hawk's favor. Choosing his final option down the road gets you 3 points in his favor, gaining you a maximum of 6 points for Hawk and launching you into Chapter Two as a contender for Hawk.

If you reach max points for Hawk, you enter Chapter 2: Hawk. If you don't get max points, but he still has more points than others you get Chapter Two: Hawk. However, if he ties with someone you get a scene in which a final question adds one more point to either character, gaining their favor.

My question is: How do I even begin coding this in Ren'py?
X I X
n i n e t e e n
current project:
Image
(20%)
check it out

User avatar
Ryouzanki
Regular
Posts: 31
Joined: Mon May 21, 2012 2:18 am
Projects: Sous le masque / Social shark
Organization: Bal masqué
Location: France
Contact:

Re: Points System?

#2 Post by Ryouzanki »

I don't really understand what you want... Is it something like that ?

Code: Select all

init:
    $ hawk_relationship = 0
    $ randy_relationship = 0
label start:
    "beginning of the story blablabla"
    menu:
        "Follow Hawk.":
            $ hawk_relationship += 1
            jump hawk_first_scene
        "Help Randy.":
            $ randy_relationship += 1
            jump randy_first_scene
label hawk_first_scene:
    "Hawk's first scene."
    menu:
        "Smoke with him ?"
        "Yes.":
            $ hawk_relationship += 2
            "You smoke with Hawk."
        "No.":
            "Nothing happen."

label chapter_1_end:
    if hawk_relationship > randy_relationship:
        jump hawk_story
    elif hawk_relationship < randy_relationship:
        jump randy_story
    else:
        "Last question."
        menu:
            "Potatoes or pineapple ?"
            "Potatoes.":
                 $ hawk_relationship += 1
            "Pineapple.":
                 $ randy_relationship += 1
    jump chapter_1_end

User avatar
ShiroXIX
Regular
Posts: 50
Joined: Thu Sep 27, 2012 10:55 pm
Projects: deadlyS7NS
Organization: XIX
Location: Jacksonville, FL
Contact:

Re: Points System?

#3 Post by ShiroXIX »

Yes, exactly like that! Down to the Potatoes and pineapples! I had forgotten how init worked, basically.

; A; You are a LIFE SAVER! <3

So when I get to the end, do I made an if/then statement?

If hawk_relationship = 6 then jump Chapter2_Hawk?

What about weighing the points against each other? Like...

randy_relationship = 2
hawk_relationship = 3

Since Hawk has more points, I want to jump to Chapter2_Hawk. How do I code that out?

What about if the points are tied and I want one more option?

hawk_relationship = 3
randy_relationship = 3

They're tied. Tie breaker question. Option 1 = Jump Chapter2_Hawk, Option 2 = Jump Chapter2_Randy.
X I X
n i n e t e e n
current project:
Image
(20%)
check it out

User avatar
Ryouzanki
Regular
Posts: 31
Joined: Mon May 21, 2012 2:18 am
Projects: Sous le masque / Social shark
Organization: Bal masqué
Location: France
Contact:

Re: Points System?

#4 Post by Ryouzanki »

ShiroXIX wrote:So when I get to the end, do I made an if/then statement?
The if/then statement is already at the beginning of the chapter_1_end label...
ShiroXIX wrote:If hawk_relationship = 6 then jump Chapter2_Hawk?

What about weighing the points against each other? Like...

randy_relationship = 2
hawk_relationship = 3

Since Hawk has more points, I want to jump to Chapter2_Hawk. How do I code that out?
It's already in my if/then statement at the beginning of the chapter_1_end label...
ShiroXIX wrote:What about if the points are tied and I want one more option?

hawk_relationship = 3
randy_relationship = 3

They're tied. Tie breaker question. Option 1 = Jump Chapter2_Hawk, Option 2 = Jump Chapter2_Randy.
That Tie breaker question IS my "Potatoes or pineapple ?" question...

Geez... Did you actually read my example ? Just wondering since i already answer to all of your question...

User avatar
ShiroXIX
Regular
Posts: 50
Joined: Thu Sep 27, 2012 10:55 pm
Projects: deadlyS7NS
Organization: XIX
Location: Jacksonville, FL
Contact:

Re: Points System?

#5 Post by ShiroXIX »

Apparently not close enough, sorry. Thank you very much, though! I didn't know it was that simple. * u *

Now, is there any way I can display this somewhere, like in a menu with progress bars? How difficult would that be to make?
X I X
n i n e t e e n
current project:
Image
(20%)
check it out

User avatar
Ryouzanki
Regular
Posts: 31
Joined: Mon May 21, 2012 2:18 am
Projects: Sous le masque / Social shark
Organization: Bal masqué
Location: France
Contact:

Re: Points System?

#6 Post by Ryouzanki »


User avatar
ShiroXIX
Regular
Posts: 50
Joined: Thu Sep 27, 2012 10:55 pm
Projects: deadlyS7NS
Organization: XIX
Location: Jacksonville, FL
Contact:

Re: Points System?

#7 Post by ShiroXIX »

lol point taken.

Thank you so much for all of your help.
X I X
n i n e t e e n
current project:
Image
(20%)
check it out

peterah
Newbie
Posts: 6
Joined: Sat May 18, 2013 10:36 am
Contact:

Re: Points System?

#8 Post by peterah »

Awesome Ryouzanki, thanks for the recommendation, I need al the help I can get

User avatar
TheOneAndOnly-K
Regular
Posts: 78
Joined: Mon Apr 07, 2014 10:33 am
Contact:

Re: Points System?

#9 Post by TheOneAndOnly-K »

I just have a question;

How do I make it so I can do three or more people in a point system. like the ending lets say.

When you have the

if Randy_Relationship > Brady_Relationship:

How would I make it so say...Charlie's relationship is also included?

User avatar
WagashiTeam
Newbie
Posts: 19
Joined: Sun Apr 07, 2013 5:48 am
Projects: Heu Ryon
Deviantart: wagashientertainment
Contact:

Re: Points System?

#10 Post by WagashiTeam »

TheOneAndOnly-K wrote:I just have a question;

How do I make it so I can do three or more people in a point system. like the ending lets say.

When you have the

if Randy_Relationship > Brady_Relationship:

How would I make it so say...Charlie's relationship is also included?
This is kinda long and I don't know if there's an easier way to do this, but here's how I do mine:

Code: Select all

init:
    $ Israel = 0
    $ Gevon = 0
    $ Kerosche = 0
label start:
    o "Hello. What is your favorite food?"
    menu:
        "Anything sweet!":
                $ Kerosche += 1
                jump q2
        "I don't have a favorite.":
                $ Israel += 1
                $ Gevon += 1
jump q2

label q2:    
    o "What quality do you prefer?"
    menu:
        "Smart.":
                $ Israel += 1
                jump q3
        "Strong.":
                $ Gevon += 1
                $ Kerosche += 1
                jump q3
label q3:
    o "What do you go for?"
    menu: 
        "Looks.":
                $ Gevon += 1
                jump q4
        "Personality.":
                $ Kerosche += 1
                $ Israel += 1
                jump q4
label q4:
    if Israel > Gevon and Israel > Kerosche:
        jump israels
    elif Gevon > Israel and Gevon > Kerosche:
        jump gevons
    elif Kerosche > Israel and Kerosche > Gevon:
        jump kerosches    
    elif Israel == Gevon and Israel == Kerosche:
        menu:
            "Choose Israel.":
                jump israels
            "Choose Gevon.":
                jump gevons
            "Choose Kerosche.":
                jump kerosches
    elif Israel == Gevon and Israel > Kerosche:
        menu:
            "Choose Israel.":
                jump israels
            "Choose Gevon.":
                jump gevons
    elif Israel > Gevon and Israel == Kerosche:
        menu:
            "Choose Israel.":
                jump israels
            "Choose Kerosche.":
                jump kerosches
    else:
        menu:
            "Choose Gevon.":
                jump gevons
            "Choose Kerosche.":
                jump kerosches
                
                
label israels:
    o " I am going with Israel."
    return

label gevons:
    o "I am going with Gevon."
    return
    
label kerosches:
    o "I am going with Kerosche."
    return
I hope that helps.

User avatar
trooper6
Lemma-Class Veteran
Posts: 3712
Joined: Sat Jul 09, 2011 10:33 pm
Projects: A Close Shave
Location: Medford, MA
Contact:

Re: Points System?

#11 Post by trooper6 »

These questions really should be asked in the Renpy Questions thread.
A Close Shave:
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?)
Check out My Clock Cookbook Recipe: http://lemmasoft.renai.us/forums/viewto ... 51&t=21978

Loxxi
Newbie
Posts: 14
Joined: Thu Aug 15, 2013 7:17 pm
Projects: OPKHDS
Contact:

Re: Points System?

#12 Post by Loxxi »

WagashiTeam wrote:This is kinda long and I don't know if there's an easier way to do this, but here's how I do mine:

Code: Select all

init:
    $ Israel = 0
    $ Gevon = 0
    $ Kerosche = 0
label start:
    o "Hello. What is your favorite food?"
    menu:
        "Anything sweet!":
                $ Kerosche += 1
                jump q2
        "I don't have a favorite.":
                $ Israel += 1
                $ Gevon += 1
jump q2

label q2:    
    o "What quality do you prefer?"
    menu:
        "Smart.":
                $ Israel += 1
                jump q3
        "Strong.":
                $ Gevon += 1
                $ Kerosche += 1
                jump q3
label q3:
    o "What do you go for?"
    menu: 
        "Looks.":
                $ Gevon += 1
                jump q4
        "Personality.":
                $ Kerosche += 1
                $ Israel += 1
                jump q4
label q4:
    if Israel > Gevon and Israel > Kerosche:
        jump israels
    elif Gevon > Israel and Gevon > Kerosche:
        jump gevons
    elif Kerosche > Israel and Kerosche > Gevon:
        jump kerosches    
    elif Israel == Gevon and Israel == Kerosche:
        menu:
            "Choose Israel.":
                jump israels
            "Choose Gevon.":
                jump gevons
            "Choose Kerosche.":
                jump kerosches
    elif Israel == Gevon and Israel > Kerosche:
        menu:
            "Choose Israel.":
                jump israels
            "Choose Gevon.":
                jump gevons
    elif Israel > Gevon and Israel == Kerosche:
        menu:
            "Choose Israel.":
                jump israels
            "Choose Kerosche.":
                jump kerosches
    else:
        menu:
            "Choose Gevon.":
                jump gevons
            "Choose Kerosche.":
                jump kerosches
                
                
label israels:
    o " I am going with Israel."
    return

label gevons:
    o "I am going with Gevon."
    return
    
label kerosches:
    o "I am going with Kerosche."
    return
I hope that helps.

This. Is pure frickin' gold. Been needing something like this for the prologue of my game so bad-just thought too much on how to ask on the forums and eventually gave up because I couldn't seem to get it right. LOL.
#BOOKMARK.

baskervald
Newbie
Posts: 1
Joined: Sun Jan 24, 2016 7:55 pm
Tumblr: baskervald
Github: baskervald
Skype: iamjagman
Contact:

Re: Points System?

#13 Post by baskervald »

Loxxi wrote:
WagashiTeam wrote:...

This. Is pure frickin' gold. Been needing something like this for the prologue of my game so bad-just thought too much on how to ask on the forums and eventually gave up because I couldn't seem to get it right. LOL.
Rather than

Code: Select all

if X > Y and X > Z
you can do

Code: Select all

if X > max(Y, Z)
It's not a huge difference, but it's much cleaner.

juliaa
Regular
Posts: 26
Joined: Fri Sep 16, 2016 7:10 pm
Contact:

Re: Points System?

#14 Post by juliaa »

Hi this topic was so helpful to me, But I have a question.
How do I display the points?
I want to create a score feature.
I want the score to be displayed permanently in the "quick menu" section.
I don't want a meter, I want the actual numbers displayed.
I don't want it to be clickable, it is just for display purposes.

M-77
Regular
Posts: 56
Joined: Tue Sep 04, 2018 7:58 am
Contact:

Re: Points System?

#15 Post by M-77 »

Hello I need some Help for an location marking system.
I have a Over map (imagemap with labels) from where player can chose to visit Stage 1, Stage 2, Stage 3 (each
Stage has its own imagemap as well with the rooms on it.
On each Stage are seperate single Rooms. 17 at all. Now i want to set a value to remember the game if one
room, and in the sum the other rooms were visited. And not one room was visited multiple times to get the
counter to 17. Also not visit a room again if already done, but then jump back to the submap label telling to visit
the other rooms.
If all rooms where seen the game should display an "text" and jump to "label storage" where the game story
continues then. I put this on the script beginning:
init -2 python:
all_rooms = 0 #The number of rooms visited on Start.
max_rooms = 17 #The maximum rooms she has to see.
$ Office_Room1 = 0
$ Communication_Room1 = 0
$ Escape_Pod´s1 = 0
$ Shuttle_Port1 = 0
$ Storage_Room1 = 0
$ Shower_Room1 = 0
$ Bridge_1 = 0
$ Mariahna_Room1 = 0
$ Inga_Room1 = 0
$ Princess_Nell_Room1 = 0
$ Faye_Room1 = 0
$ Urahna_Room1 = 0
$ Medical_Labor1 = 0
$ Latrine1 = 0
$ Cargo1 = 0
$ Kitchen1 = 0
$ Engine_Room1 = 0
And this inside the Over map:
if Office_Room1 > 1
if Communication_Room1 > 1
if Escape_Pod´s1 > 1
if Shuttle_Port1 > 1
if Storage_Room1 > 1
if Shower_Room1 > 1
if Bridge_1 > 1
if Mariahna_Room1 > 1
if Inga_Room1 > 1
if Princess_Nell_Room1 > 1
if Faye_Room1 > 1
if Urahna_Room1 > 1
if Medical_Labor1 > 1
if Latrine1 > 1
if Cargo1 > 1
if Kitchen1 > 1
if Engine_Room1 > 1
jump storage
And this is how i try to put it in on of the Locations to set a value:
label Communication_Room1:
show AShipStage1A002 with dissolve
if Communication_Room1 = 1:
jump Stage_1
n "Communication Room."
e "(Mariahna is standing here in her Duty Overall.)."
m "I thought i test our systems before i go on and deposit my equipment, wash, and get in the Bridge Room."
$ Communication_Room1 += 1
hide AShipStage1A002

But it do not work for now. get me some (:) missing error messager or "not expecting block" ect.
How to do a simple Point (location) remembering (collect/set all Points) system, that jumps (and telling
something like "I have visited all rooms, now let´s us go to the Storage Room." to my defined label if all rooms
were visited (and blocks you from revisit or get multiple points for the same room?
Or better use a "$ .... = True" variable in each room? Then if all are set on "True" after visit, get the "text to move on" info and get jump to "label storage".
How this has to look exactly?

Post Reply

Who is online

Users browsing this forum: Google [Bot], Kocker, Semrush [Bot], VESTED