Jump to multiple possible labels because of the same choice?

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
NadOtavlas
Regular
Posts: 37
Joined: Sat Apr 21, 2018 3:46 am
Contact:

Jump to multiple possible labels because of the same choice?

#1 Post by NadOtavlas » Sat Jul 11, 2020 1:13 pm

How do I make an if statement for this kind of thing? I want there to be an different outcome from the exact same choice depending whether or not an variable is true or false.

jaydalyn
Newbie
Posts: 16
Joined: Sun Jun 23, 2019 7:02 pm
Completed: Ghost Flower Octopus, A Simple Date, text me your kink
itch: jaydalyn
Contact:

Re: Jump to multiple possible labels because of the same choice?

#2 Post by jaydalyn » Sat Jul 11, 2020 2:32 pm

I believe it would be something like:

Code: Select all

if thing == True:
	jump label_for_true
else:
	jump label_for_false
It would go right after you make the choice or wherever you want the choice to split.
'My candle burns at both ends;It will not last the night;But ah, my foes, and oh, my friends—It gives a lovely light!'

NadOtavlas
Regular
Posts: 37
Joined: Sat Apr 21, 2018 3:46 am
Contact:

Re: Jump to multiple possible labels because of the same choice?

#3 Post by NadOtavlas » Mon Jul 13, 2020 12:53 pm

There's been some problems when trying to run the game:

Code: Select all

if BP == 3:
    "WTF should I do?"
    menu:
        "Ask the lamp WTF is it's problem?":
            if thing == True:
                            jump labelfortrue
            else:
                jump labelforfalse
        "Kill the fucking lamp.":
            if jenimprove == True
                jump pattywinters
            else:
                jump infinitejest
else
    if jenimprove == True:
	        jump pattywinters
    else:
	        jump infinitejest

User avatar
RicharDann
Veteran
Posts: 284
Joined: Thu Aug 31, 2017 11:47 am
Contact:

Re: Jump to multiple possible labels because of the same choice?

#4 Post by RicharDann » Mon Jul 13, 2020 1:08 pm

You're missing a colon (:) after the outer else statement.

Code: Select all

if BP == 3:
    #I'll omit the menu to save some space
else: # <-- add a colon here
    if jenimprove == True:
	        jump pattywinters
The most important step is always the next one.

NadOtavlas
Regular
Posts: 37
Joined: Sat Apr 21, 2018 3:46 am
Contact:

Re: Jump to multiple possible labels because of the same choice?

#5 Post by NadOtavlas » Mon Jul 13, 2020 1:40 pm

https://i.imgur.com/QmGMWcg.png

Code: Select all

else:
    if jenimprove == True:
	            jump pattywinters #This is line 946
    else
	            jump infinitejest

User avatar
RicharDann
Veteran
Posts: 284
Joined: Thu Aug 31, 2017 11:47 am
Contact:

Re: Jump to multiple possible labels because of the same choice?

#6 Post by RicharDann » Mon Jul 13, 2020 2:17 pm

You probably added a Tab (four spaces automatically added by the Tabulation key on your keyboard) before that line.

Ren'Py needs to use spaces for identation instead of Tabs. You'll need to find that line in your text editor , delete all space before it and then press Space on your keyboard instead of using the Tab key to generate the necessary space. You can setup your editor so it uses spaces automatically when you press Tab. I don't know what editor you're using, but try and look for an option called "Convert Tab to Spaces" or something similar.

Also in the code you posted don't forget to add the colon after the second else. Ren'Py needs that or it will give another error.
The most important step is always the next one.

Post Reply

Who is online

Users browsing this forum: Bing [Bot], enaielei, Google [Bot]