Paths/Choices

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
Deadpool209977
Newbie
Posts: 7
Joined: Sun Dec 26, 2021 3:29 pm
Completed: Experimental Life Intro
Projects: Experimental Life: Training
Organization: BenCo Studios
Contact:

Paths/Choices

#1 Post by Deadpool209977 » Mon Jul 18, 2022 7:18 pm

Done some searches and found some good stuff but not quite deep enough.

Here is my issue:
I have multiple choices for two characters I wrote like this:

What does MC 1 choose?
menu:
choice 1
choice 2
choice 3

What does MC 2 Choose?
menu:
choice 1
choice 2
choice 3

I would love for these choices to be able to be made at the same time but MC 1 can choose choice 3 while MC 2 can choose choice 1. They can never make the same choice as there is only one machine per choice.
I want the player to be able to choose what he/she wants to do but also be able to come back to the choices for the option to do all three choices but have something that leaves the already chosen choices unavailable when it comes back to the choices.
Does anyone follow what I am trying to say?
Guess my main issue right now is how to give the player a chance to select all the choices without having to scroll back.
I have an OK understanding of the coding but lack the tech(?) skills, maybe? Not sure if that makes sense.

User avatar
m_from_space
Veteran
Posts: 302
Joined: Sun Feb 21, 2021 3:36 am
Contact:

Re: Paths/Choices

#2 Post by m_from_space » Tue Jul 19, 2022 2:06 am

What do you mean you would "love for these choices to be able to made at the same time"? What do you mean by "one machine per choice"?

If you don't want a choice to be available after the player picked it, then use a variable to determine if it was already chosen. I like using lists, but you can also just use simple booleans or whatever.

Code: Select all

default choices = []

menu:
    "I want to do this." if "choice_1" not in choices:
        $ choices.append("choice_1")
        jump wherever
    "I want to do that." if "choice_2" not in choices:
        $ choices.append("choice_2")
        jump gameover
    ...
So for MC2 just check inside the same list. If MC1 did pick that choice, it won't be available to MC2 - but only if MC1 and MC2 are part of the same game of course. I assume you are talking about a parallel story. If you don't want PLAYERS playing different game having the same choice, then you need to use persistent data for that: https://www.renpy.org/doc/html/persistent.html

Regarding coming back to the menu: You can give a menu a name (like a label name), that you can jump to later on.

Code: Select all

label start:
    menu my_menu_1:
        "choice1":
            jump choice_1
        "choice2":
            jump choice_2
        "choice2":
            jump choice_3

label choice_1:
    "Here we are in choice_1"
    jump my_menu_1

...

Deadpool209977
Newbie
Posts: 7
Joined: Sun Dec 26, 2021 3:29 pm
Completed: Experimental Life Intro
Projects: Experimental Life: Training
Organization: BenCo Studios
Contact:

Re: Paths/Choices

#3 Post by Deadpool209977 » Tue Jul 19, 2022 1:36 pm

Awesomeness! These two code strings worked for the choices and to null after being selected.
Now I'm stuck in a loop and can't move on to the rest of the game lol! I did something wrong!

Deadpool209977
Newbie
Posts: 7
Joined: Sun Dec 26, 2021 3:29 pm
Completed: Experimental Life Intro
Projects: Experimental Life: Training
Organization: BenCo Studios
Contact:

Re: Paths/Choices

#4 Post by Deadpool209977 » Fri Jul 22, 2022 8:18 pm

Had a kool person help me with some code strings but I did something wrong cause it's not working.

I keep getting error:

Code: Select all

File "game/script.rpy", line 55: expected statement.
    do_susan = not do_susan
I am really new so I am trying to get a better grasp on this. To be honest I don't understand most of this. I am catching on though just a lil slow.

I know it's not complete but I got to get past the first line first.

Code: Select all

default choices = []
default do_susan = False

label start:
    # stay inside this loop as long as we didn't pick all the 3 choices (cell, electric torture, breaker bench)
    if len(choices) < 3:
        # alter between True and False
        do_susan = not do_susan
        if do_susan:
            "What would you like to train Susan on next?"
        else:
            "What would you like to train Chandra on now?"
        menu:
            "Train in cell." if "cell" not in choices:
                $ choices.append("cell")
                if do_susan:
                    call cell_susan
                else:
                    call cell_chandra
            "Train on Electric Torture." if "electric torture" not in choices:
                $ choices.append("electric torture")
                if do_susan:
                    call electrictorture_susan
                else:
                    call electrictorture_chandra
            "Train on Breaker Bench." if "breaker bench" not in choices:
                $ choices.append("breaker bench")
                if do_susan:
                    call breakerbench_susan
                else:
                    call breakerbench_chandra
            "Train on Water Board." if "water board" not in choices:
                $ choices.append("water board")
                if do_susan:
                    call waterboard_susan
                else:
                    call waterboard_susan
            "Train in Hot Box." if "hot box" not in choices:
                $ choices.append("hot box")
                if do_susan:
                    call hotbox_susan
                else:
                    call hotbox_chandra        
        jump start
    "Every choice was picked for every character."
    return

label cell_susan:
    "We are in the cell with Susan."
    return
label electrictorture_susan
    "We are torturing Susan"
    return
    

User avatar
m_from_space
Veteran
Posts: 302
Joined: Sun Feb 21, 2021 3:36 am
Contact:

Re: Paths/Choices

#5 Post by m_from_space » Sat Jul 23, 2022 7:06 am

Code: Select all

$ do_susan = not do_susan
The $ was missing there. It's a line of Python code.

Deadpool209977
Newbie
Posts: 7
Joined: Sun Dec 26, 2021 3:29 pm
Completed: Experimental Life Intro
Projects: Experimental Life: Training
Organization: BenCo Studios
Contact:

Re: Paths/Choices

#6 Post by Deadpool209977 » Sat Jul 23, 2022 11:03 am

This works now.
Thank you so much!
now back to basic stuff for a bit LOL!

Post Reply

Who is online

Users browsing this forum: Bing [Bot]