Specific choice/s to trigger to get into Ending 1
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.
- raeru
- Regular
- Posts: 28
- Joined: Fri Jun 17, 2016 7:45 am
- IRC Nick: ryle
- Deviantart: ryle-chan
- Location: Philippines
- Contact:
Specific choice/s to trigger to get into Ending 1
Been searching around for this solution here but laze came to me so I decided to ask now
I don't actually have much knowledge in ren'py so this "triggering Ending 1 with specific choice" is giving me a headache. I know this is a simple code but shame on me ;_;
So I actually have 2 choices(answers) to triggered to get into the Ending 1 but if fail to get the choices either the two of them, it'll be directed to Ending 2. Please help senpies ;_;
I don't actually have much knowledge in ren'py so this "triggering Ending 1 with specific choice" is giving me a headache. I know this is a simple code but shame on me ;_;
So I actually have 2 choices(answers) to triggered to get into the Ending 1 but if fail to get the choices either the two of them, it'll be directed to Ending 2. Please help senpies ;_;
Last edited by raeru on Thu Oct 06, 2016 1:23 am, edited 1 time in total.
- Divona
- Miko-Class Veteran
- Posts: 678
- Joined: Sun Jun 05, 2016 8:29 pm
- Completed: The Falconers: Moonlight
- Organization: Bionic Penguin
- itch: bionicpenguin
- Contact:
Re: Specific choice/s to trigger to get into Ending 1
Not sure if I understand what you meant, but is this what you're looking for?
Code: Select all
label decision_time:
"Here come first choice."
menu:
"Part 1 Choice 1":
$ part_1_correct_answer = True
"Part 1 Choice 2":
$ part_1_correct_answer = False
"Now, it's second choice."
menu:
"Part 2 Choice 1":
$ part_2_correct_answer = False
"Part 2 Choice 2":
$ part_2_correct_answer = True
if part_1_correct_answer == True and part_2_correct_answer == True:
jump ending_1
else:
jump ending_2
label ending_1:
......
label engine_2:
......
Last edited by Divona on Wed Oct 05, 2016 2:14 pm, edited 2 times in total.
- raeru
- Regular
- Posts: 28
- Joined: Fri Jun 17, 2016 7:45 am
- IRC Nick: ryle
- Deviantart: ryle-chan
- Location: Philippines
- Contact:
Re: Specific choice/s to trigger to get into Ending 1
Unlike the code you gave, first choice would jump to the continuing label, does this only applies to none jumpable choices? This is exactly what in my mind but the error ;_;Divona wrote:Not sure if I understand what you meant, but is this what you're looking for?Code: Select all
label decision_time: "Here come first choice." menu: "Part 1 Choice 1" $ part_1_correct_answer = True "Part 1 Choice 2" $ part_1_correct_answer = False "Now, it's second choice." menu: "Part 2 Choice 1" $ part_2_correct_answer = False "Part 2 Choice 2" $ part_2_correct_answer = True if part_1_correct_answer = True and part_2_correct_answer = True: jump ending_1 else: jump ending_2 label ending_1: ...... label engine_2: ......
Code: Select all
I'm sorry, but an uncaught exception occurred.
While running game code:
File "game/script.rpy", line 5041, in script
if deathend = True and deathend2 = True:
SyntaxError: invalid syntax (game/script.rpy, line 5041)
- NocturneLight
- Regular
- Posts: 162
- Joined: Thu Jun 30, 2016 1:20 pm
- Projects: Unsound Minds: The Clarevine Epoch
- Organization: Reminiscent 64
- Tumblr: Reminiscent64
- itch: Reminiscent64
- Location: Texas
- Contact:
Re: Specific choice/s to trigger to get into Ending 1
It's just a minor typo. Just changeraeru wrote:Unlike the code you gave, first choice would jump to the continuing label, does this only applies to none jumpable choices? This is exactly what in my mind but the error ;_;Divona wrote:Not sure if I understand what you meant, but is this what you're looking for?Code: Select all
label decision_time: "Here come first choice." menu: "Part 1 Choice 1" $ part_1_correct_answer = True "Part 1 Choice 2" $ part_1_correct_answer = False "Now, it's second choice." menu: "Part 2 Choice 1" $ part_2_correct_answer = False "Part 2 Choice 2" $ part_2_correct_answer = True if part_1_correct_answer = True and part_2_correct_answer = True: jump ending_1 else: jump ending_2 label ending_1: ...... label engine_2: ......
Code: Select all
I'm sorry, but an uncaught exception occurred. While running game code: File "game/script.rpy", line 5041, in script if deathend = True and deathend2 = True: SyntaxError: invalid syntax (game/script.rpy, line 5041)
Code: Select all
if deathend = True and deathend2 = True:Code: Select all
if deathend == True and deathend2 == True:The Old Guard is at His Limit. The time is near to usher in the New Guard.
The Great Horror is soon to be free.
Clarevine is the key.
"Unsound Minds: The Clarevine Epoch" is a yuri visual novel that shatters english visual novel norms and aims to blend Christianity and the Cthulhu Mythos to tell a deep and dark story that you'll enjoy. You can follow the Kickstarter here.
Stay sound and persist through the chaos,
NocturneLight
The Great Horror is soon to be free.
Clarevine is the key.
"Unsound Minds: The Clarevine Epoch" is a yuri visual novel that shatters english visual novel norms and aims to blend Christianity and the Cthulhu Mythos to tell a deep and dark story that you'll enjoy. You can follow the Kickstarter here.
Stay sound and persist through the chaos,
NocturneLight
- raeru
- Regular
- Posts: 28
- Joined: Fri Jun 17, 2016 7:45 am
- IRC Nick: ryle
- Deviantart: ryle-chan
- Location: Philippines
- Contact:
Re: Specific choice/s to trigger to get into Ending 1
New error came ;_;NocturneLight wrote:It's just a minor typo. Just changeraeru wrote:Unlike the code you gave, first choice would jump to the continuing label, does this only applies to none jumpable choices? This is exactly what in my mind but the error ;_;Divona wrote:Not sure if I understand what you meant, but is this what you're looking for?Code: Select all
label decision_time: "Here come first choice." menu: "Part 1 Choice 1" $ part_1_correct_answer = True "Part 1 Choice 2" $ part_1_correct_answer = False "Now, it's second choice." menu: "Part 2 Choice 1" $ part_2_correct_answer = False "Part 2 Choice 2" $ part_2_correct_answer = True if part_1_correct_answer = True and part_2_correct_answer = True: jump ending_1 else: jump ending_2 label ending_1: ...... label engine_2: ......
Code: Select all
I'm sorry, but an uncaught exception occurred. While running game code: File "game/script.rpy", line 5041, in script if deathend = True and deathend2 = True: SyntaxError: invalid syntax (game/script.rpy, line 5041)toCode: Select all
if deathend = True and deathend2 = True:
When you compare truth values, you use == to compare it with another truth value. You also use == when comparing strings and numbers as well.Code: Select all
if deathend == True and deathend2 == True:
Code: Select all
I'm sorry, but an uncaught exception occurred.
While running game code:
File "game/script.rpy", line 5038, in script
if deathend == True and death_end_two == True:
File "game/script.rpy", line 5038, in <module>
if deathend == True and death_end_two == True:
NameError: name 'deathend' is not defined
- Divona
- Miko-Class Veteran
- Posts: 678
- Joined: Sun Jun 05, 2016 8:29 pm
- Completed: The Falconers: Moonlight
- Organization: Bionic Penguin
- itch: bionicpenguin
- Contact:
Re: Specific choice/s to trigger to get into Ending 1
Sorry about the typo before in my code. It hasn't been tested, and it's very late at night here.
This mean that you have not define 'deathend' variable. Probably misspell the name of variable 'death_end'.
Code: Select all
NameError: name 'deathend' is not defined- raeru
- Regular
- Posts: 28
- Joined: Fri Jun 17, 2016 7:45 am
- IRC Nick: ryle
- Deviantart: ryle-chan
- Location: Philippines
- Contact:
Re: Specific choice/s to trigger to get into Ending 1
I also did tried to change the name but still error, it's also mid-night here I'll give this one a rest for today ;_; Hope you would test it out senpai ;_;
- Divona
- Miko-Class Veteran
- Posts: 678
- Joined: Sun Jun 05, 2016 8:29 pm
- Completed: The Falconers: Moonlight
- Organization: Bionic Penguin
- itch: bionicpenguin
- Contact:
Re: Specific choice/s to trigger to get into Ending 1
Post up your code, so we can actually see where it went wrong. Either me or someone else coming along would help out fixing and cleaning up, eventually.raeru wrote:I also did tried to change the name but still the error it's also mid-night here I'll give this one a rest for today ;_; Hope you would test it out senpie ;_;
- raeru
- Regular
- Posts: 28
- Joined: Fri Jun 17, 2016 7:45 am
- IRC Nick: ryle
- Deviantart: ryle-chan
- Location: Philippines
- Contact:
Re: Specific choice/s to trigger to get into Ending 1
You mean the script.py?
- Divona
- Miko-Class Veteran
- Posts: 678
- Joined: Sun Jun 05, 2016 8:29 pm
- Completed: The Falconers: Moonlight
- Organization: Bionic Penguin
- itch: bionicpenguin
- Contact:
Re: Specific choice/s to trigger to get into Ending 1
Just the 'menu' part you're working on should be fine.raeru wrote:You mean the script.py?
- raeru
- Regular
- Posts: 28
- Joined: Fri Jun 17, 2016 7:45 am
- IRC Nick: ryle
- Deviantart: ryle-chan
- Location: Philippines
- Contact:
Re: Specific choice/s to trigger to get into Ending 1
Here's the code (don't mind the indentation I did just copy paste on notepad). Please help me senpais ;_;
Didn't include the actual dialogues since it's unnecessary ;_;
Didn't include the actual dialogues since it's unnecessary ;_;
Code: Select all
menu:
"group with Rain.":
$ death_end = True
jump rain
"group with Illia.":
$ death_end = False
jump illia
label rain:
"...."
jump cont
label illia:
"...."
jump cont
label cont:
menu:
"We should look for him":
$ alter_end = True
jump lookiel
"He's probably roaming around.":
$ alter_end = False
jump roamkiel
label lookiel:
"....."
jump conto
label roamkiel:
"....."
jump conto
label conto:
"......"
if death_end == True and alter_end == True:
jump true
else:
jump false
label true:
"woooi"
label false:
"watanays"
- Divona
- Miko-Class Veteran
- Posts: 678
- Joined: Sun Jun 05, 2016 8:29 pm
- Completed: The Falconers: Moonlight
- Organization: Bionic Penguin
- itch: bionicpenguin
- Contact:
Re: Specific choice/s to trigger to get into Ending 1
Look like you have already fixed the script by change variable name 'deathend' to 'death_end'. It should no longer show:
Does it still give an error? What would be the traceback this time?
Oh and don't give label name as 'true' and 'false', just in case.
Code: Select all
NameError: name 'deathend' is not definedOh and don't give label name as 'true' and 'false', just in case.
- raeru
- Regular
- Posts: 28
- Joined: Fri Jun 17, 2016 7:45 am
- IRC Nick: ryle
- Deviantart: ryle-chan
- Location: Philippines
- Contact:
Re: Specific choice/s to trigger to get into Ending 1
already changed the label true and false here. Here's the full traceback ;_;Divona wrote:Look like you have already fixed the script by change variable name 'deathend' to 'death_end'. It should no longer show:Does it still give an error? What would be the traceback this time?Code: Select all
NameError: name 'deathend' is not defined
Oh and don't give label name as 'true' and 'false', just in case.
Code: Select all
I'm sorry, but an uncaught exception occurred.
While running game code:
File "game/script.rpy", line 5038, in script
if death_end == True and alter_end == True:
File "game/script.rpy", line 5038, in <module>
if death_end == True and alter_end == True:
NameError: name 'death_end' is not defined
-- Full Traceback ------------------------------------------------------------
Full traceback:
File "game/script.rpy", line 5038, in script
if death_end == True and alter_end == True:
File "C:\Users\acer\Desktop\OJT BRYLLE\None\New folder\renpy-6.99.11-sdk\renpy\ast.py", line 1647, in execute
if renpy.python.py_eval(condition):
File "C:\Users\acer\Desktop\OJT BRYLLE\None\New folder\renpy-6.99.11-sdk\renpy\python.py", line 1670, in py_eval
return py_eval_bytecode(code, globals, locals)
File "C:\Users\acer\Desktop\OJT BRYLLE\None\New folder\renpy-6.99.11-sdk\renpy\python.py", line 1665, in py_eval_bytecode
return eval(bytecode, globals, locals)
File "game/script.rpy", line 5038, in <module>
if death_end == True and alter_end == True:
NameError: name 'death_end' is not defined
Windows-8-6.2.9200
Ren'Py 6.99.11.1749
7th Day 0.5
- raeru
- Regular
- Posts: 28
- Joined: Fri Jun 17, 2016 7:45 am
- IRC Nick: ryle
- Deviantart: ryle-chan
- Location: Philippines
- Contact:
Re: Specific choice/s to trigger to get into Ending 1
Finally solved the problem. Thanks for helping me ;_;
This code is needed before label start
Code: Select all
init:
default death_end = 0
default alter_end = 0
Who is online
Users browsing this forum: Google [Bot]
