Question about choices

A place to discuss things that aren't specific to any one creator or game.
Forum rules
Ren'Py specific questions should be posted in the Ren'Py Questions and Annoucements forum, not here.
Post Reply
Message
Author
User avatar
IxIoN
Regular
Posts: 160
Joined: Sat Jan 16, 2010 12:51 pm
Projects: Thinking
Location: Venezuela
Contact:

Question about choices

#1 Post by IxIoN » Sat Apr 03, 2010 7:33 pm

Well I only want to ask... how can I make the choices sum up? Let me explain myself.

-Ending 1
-Ending 2

Example 1:
1. Run(Ending 1 +1)/Walk (Ending 2 +1) Chose Run. Ending 1 +1=> Ending 1= 1. Ending 2= 0
2. Eat(Ending 1 +2)/Don't eat (Ending 2 +1) Chose Eat. Ending 1 +1=> Ending 1= 3. Ending= 0
You get ending 1.

Example 2:
1. Run(Ending 1 +1)/Walk (Ending 2 +1) Chose Walk. Ending 2 +1=> Ending 1= 0. Ending 2= 1
2. Eat(Ending 1 +2)/Don't eat (Ending 2 +1) Chose Don't eat. Ending 2 +1=> Ending 1= 0. Ending= 2
You get ending 2.

Can someone explain how to do this? Thanks in advance.
This is my World.
Look forward to my game.
Thinking

User avatar
JQuartz
Eileen-Class Veteran
Posts: 1265
Joined: Fri Aug 31, 2007 7:02 am
Projects: 0 completed game. Still haven't made any meaningfully completed games...
Contact:

Re: Question about choices

#2 Post by JQuartz » Sun Apr 04, 2010 10:27 am

You mean something like this?:

Code: Select all

init:
    $ Ending1=0
    $ Ending2=0
label choice1:
    menu:
        "Run":
            $ Ending1+=1
        "Walk":
            $ Ending2+=1

label choice2:
    menu:
        "Eat":
            $ Ending1+=2
        "Don't Eat":
            $ Ending2+=1

label ending:
    if Ending1==3:
        jump ending1
    elif Ending2==2:
        jump ending2
    
I suspect somebody is stealing my internet identity so don't believe everything I tell you via messages. I don't post or send messages anymore so don't believe anything I tell you via messages or posts.

User avatar
Alex
Lemma-Class Veteran
Posts: 2416
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: Question about choices

#3 Post by Alex » Sun Apr 04, 2010 10:46 am

Well, exactly as you showed in your example...
1. Make variables to store the results (end1, end2 or smth)
2. Change the values during game process (like <$ end1 += 1>)
3. At the end compare the values to find what ending to show

Code: Select all

init:
    $ end1 = 0
    $ end2 = 0

label start:
    menu:
        "Run(Ending 1 +1)":
            $ end1 += 1
        "Walk (Ending 2 +1)":
            $ end2 += 1

    menu:
        "Eat(Ending 1 +2)":
            $ end1 += 2
        "Don't eat (Ending 2 +1)":
            $ end2 += 1
    if end1 > end2:
        jump "ending_1" # label names shouldn`t have spaces
    else:
        pass

# here you goes if ending 2 
    "Ending 2"
    jump "credits"

label ending_1:
    "Ending 1"
    jump "credits"

label credits:
    "Some credits"
You can read more here
http://www.renpy.org/wiki/renpy/doc/tut ... With_Menus
http://www.renpy.org/wiki/renpy/doc/tut ... er_Choices
http://www.renpy.org/wiki/renpy/doc/tut ... _the_Story

Late again...((

User avatar
IxIoN
Regular
Posts: 160
Joined: Sat Jan 16, 2010 12:51 pm
Projects: Thinking
Location: Venezuela
Contact:

Re: Question about choices

#4 Post by IxIoN » Sun Apr 11, 2010 11:44 am

Finally I made my first choice and it works perfect. Thanks you two.
This is my World.
Look forward to my game.
Thinking

Post Reply

Who is online

Users browsing this forum: No registered users