Jump to multiple possible labels because of the same choice?
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.
-
NadOtavlas
- Regular
- Posts: 37
- Joined: Sat Apr 21, 2018 3:46 am
- Contact:
Jump to multiple possible labels because of the same choice?
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?
I believe it would be something like:
It would go right after you make the choice or wherever you want the choice to split.
Code: Select all
if thing == True:
jump label_for_true
else:
jump label_for_false'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?
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- RicharDann
- Veteran
- Posts: 284
- Joined: Thu Aug 31, 2017 11:47 am
- Contact:
Re: Jump to multiple possible labels because of the same choice?
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?
https://i.imgur.com/QmGMWcg.png
Code: Select all
else:
if jenimprove == True:
jump pattywinters #This is line 946
else
jump infinitejest- RicharDann
- Veteran
- Posts: 284
- Joined: Thu Aug 31, 2017 11:47 am
- Contact:
Re: Jump to multiple possible labels because of the same choice?
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.
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.
Who is online
Users browsing this forum: Bing [Bot], enaielei, Google [Bot]