How do I move onto another route once chosen menu 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.
How do I move onto another route once chosen menu choice?
Here's my script so far. I'm using Jedit.
menu:
"Go for a stroll?":
jump goforastroll
"Stay here and admire the scenery.":
jump stayhere
label goforastroll:
b "I proceed to get up and go for a stroll..I wonder where it'll take me?"
return
^^this is the choice I want to progress with..so how do I go about doing so without choice 2 interfering?
label stayhere:
b "I can't help but feel somewhat disappointed..like I've missed a once in a lifetime encounter or something."
"Ben continues to stay positioned."
return
I am just wondering how I move onto another route (part of the game.) once I've chosen my choice from the choice menu?
I'm such a newbie at this, so please forgive my confusing wording. Lol
Go for a stroll is the right choice for the player. In other words, that's the choice I want to use in order to progress.
Hopefully I can get someone's feedback, and I hope it's not too confusing for ya'll.
Thanks..
menu:
"Go for a stroll?":
jump goforastroll
"Stay here and admire the scenery.":
jump stayhere
label goforastroll:
b "I proceed to get up and go for a stroll..I wonder where it'll take me?"
return
^^this is the choice I want to progress with..so how do I go about doing so without choice 2 interfering?
label stayhere:
b "I can't help but feel somewhat disappointed..like I've missed a once in a lifetime encounter or something."
"Ben continues to stay positioned."
return
I am just wondering how I move onto another route (part of the game.) once I've chosen my choice from the choice menu?
I'm such a newbie at this, so please forgive my confusing wording. Lol
Go for a stroll is the right choice for the player. In other words, that's the choice I want to use in order to progress.
Hopefully I can get someone's feedback, and I hope it's not too confusing for ya'll.
Thanks..
- xavimat
- Eileen-Class Veteran
- Posts: 1461
- Joined: Sat Feb 25, 2012 8:45 pm
- Completed: Yeshua, Jesus Life, Cops&Robbers
- Projects: Fear&Love
- Organization: Pilgrim Creations
- Github: xavi-mat
- itch: pilgrimcreations
- Location: Spain
- Discord: xavimat
- Contact:
Re: How do I move onto another route once chosen menu choice
First, maybe you have a problem with the indent. If you put your code between "[ code ]" tags, we'll see the indent:
Your code seems right. The game should jump to the label after the choice:
But, about choices and branches, the more important is to organize your story, before coding.
Your code seems right. The game should jump to the label after the choice:
Code: Select all
label start:
menu:
"Go for a stroll?":
jump goforastroll
"Stay here and admire the scenery.":
jump stayhere
label goforastroll:
b "I proceed to get up and go for a stroll..I wonder where it'll take me?"
return
label stayhere:
b "I can't help but feel somewhat disappointed..like I've missed a once in a lifetime encounter or something."
"Ben continues to stay positioned."
return
Comunidad Ren'Py en español: ¡Únete a nuestro Discord!
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)
Re: How do I move onto another route once chosen menu choice
So, what's the best thing I could do to solve this?
Thanks
Thanks
- xavimat
- Eileen-Class Veteran
- Posts: 1461
- Joined: Sat Feb 25, 2012 8:45 pm
- Completed: Yeshua, Jesus Life, Cops&Robbers
- Projects: Fear&Love
- Organization: Pilgrim Creations
- Github: xavi-mat
- itch: pilgrimcreations
- Location: Spain
- Discord: xavimat
- Contact:
Re: How do I move onto another route once chosen menu choice
First, you need to organize your story in parts and branches and invent a label for every part.
As you do, the "jump" statement is used to jump to your labels.
If you have a bad route you can simple jump to a former label to let the player choose again.
As I said in my first post, organize your story. If you want, you can put here the flow of your game (or a part of it) and we can help you.
As you do, the "jump" statement is used to jump to your labels.
If you have a bad route you can simple jump to a former label to let the player choose again.
As I said in my first post, organize your story. If you want, you can put here the flow of your game (or a part of it) and we can help you.
Comunidad Ren'Py en español: ¡Únete a nuestro Discord!
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)
Re: How do I move onto another route once chosen menu choice
So in order to transcend I use the "jump" label?
Re: How do I move onto another route once chosen menu choice
I've jumped to my next scene..
but the second choice interferes.
How do I manage this from happening?
but the second choice interferes.
How do I manage this from happening?
-
- Lemma-Class Veteran
- Posts: 2299
- Joined: Mon Feb 06, 2012 9:50 pm
- Completed: Icebound, Selenon Rising Ep. 1-2
- Projects: Selenon Rising Ep. 3-4
- Organization: Fastermind Games
- Deviantart: sundownkid
- Location: NYC
- Contact:
Re: How do I move onto another route once chosen menu choice
I don't get what you mean about interfering. You should probably post your current code for the scene (in code brackets so the indentation is preserved).
Re: How do I move onto another route once chosen menu choice
menu:
"Go for a stroll?":
jump goforastroll
"Stay here and admire the scenery.":
jump stayhere
label goforastroll:
b "I proceed to get up and go for a slight walk around the area..I wonder where it'll take me?"
jump nextscene
label goforastroll:
scene nature with fade
play music "[TOP 100 OST] Visual Novel Melancholic_Mysterious Music #22 - Narcissu - Scarlet.mp3"
b "Aaah, the fresh air really opens up my senses."
b "I guess when people say go for a walk when your stressed, it really does help."
b "I usually take those things forgranted."
^^This segment ends, and then the second choice interferes whilst playing, resulting in the game ending.
This is choice 2: which interferes with choice 1..
label stayhere:
b "I can't help but feel somewhat dissapointed..like I've missed a once in a lifetime encounter or something."
"Ben continues to stay positioned."
return
Sorry if this is confusing..I'm extremely knew to this, and coding exactly isn't my forte...(YET)
Re: How do I move onto another route once chosen menu choice
Finally figured out how to use code brackets on this site...!
There you go.
There you go.
Code: Select all
menu:
"Go for a stroll?":
jump goforastroll
"Stay here and admire the scenery.":
jump stayhere
label goforastroll:
b "I proceed to get up and go for a slight walk around the area..I wonder where it'll take me?"
jump nextscene
label goforastroll:
scene nature with fade
play music "[TOP 100 OST] Visual Novel Melancholic_Mysterious Music #22 - Narcissu - Scarlet.mp3"
b "Aaah, the fresh air really opens up my senses."
b "I guess when people say go for a walk when your stressed, it really does help."
b "I usually take those things forgranted."
label stayhere:
b "I can't help but feel somewhat dissapointed..like I've missed a once in a lifetime encounter or something."
"Ben continues to stay positioned."
return
-
- Regular
- Posts: 179
- Joined: Wed Mar 13, 2013 9:55 pm
- Completed: MazeSite01, Ponderings of Time
- Contact:
Re: How do I move onto another route once chosen menu choice
Ahh, indentations, how I loathe you. At least it's not as bad as C's constant pinky workout.
The labels should be outside of the menu, and need either a return function or jump to another label. Otherwise, Renpy reads your code like a book-- it goes through every single word, not something you want with choices and story branching.
There's actually an easier way to do this without jumping all over the place.
Hope this helped, good luck with your game!
The labels should be outside of the menu, and need either a return function or jump to another label. Otherwise, Renpy reads your code like a book-- it goes through every single word, not something you want with choices and story branching.
Code: Select all
menu:
"Go for a stroll?":
jump goforastroll
"Stay here and admire the scenery.":
jump stayhere
label goforastroll:
b "I proceed to get up and go for a slight walk around the area..I wonder where it'll take me?"
# Where are you jumping to? Label nextscene doesn't exist xD (jump nextscene)
# I don't really understand this part, you already defined the label, don't need to do it again (label goforastroll: )
scene nature with fade
play music "[TOP 100 OST] Visual Novel Melancholic_Mysterious Music #22 - Narcissu - Scarlet.mp3"
b "Aaah, the fresh air really opens up my senses."
b "I guess when people say go for a walk when your stressed, it really does help."
b "I usually take those things forgranted."
#either a "return" or a "jump continuestory" or something to continue the story. I'll go with return.
return
label stayhere:
b "I can't help but feel somewhat dissapointed..like I've missed a once in a lifetime encounter or something."
"Ben continues to stay positioned."
return
label continuestory:
#continue the story from where Ben decided to go for a stroll.
Code: Select all
menu:
"Go for a stroll?":
b "I proceed to get up and go for a slight walk around the area..I wonder where it'll take me?"
# Again, these parts aren't needed.(jump nextscene
# label goforastroll: )
scene nature with fade
play music "[TOP 100 OST] Visual Novel Melancholic_Mysterious Music #22 - Narcissu - Scarlet.mp3"
b "Aaah, the fresh air really opens up my senses."
b "I guess when people say go for a walk when your stressed, it really does help."
b "I usually take those things forgranted."
"Stay here and admire the scenery.":
jump stayhere
b "I can't help but feel somewhat dissapointed..like I've missed a once in a lifetime encounter or something."
"Ben continues to stay positioned."
return # Choosing to stay where he is will end the game for Ben ):
# Continue the story here!
Re: How do I move onto another route once chosen menu choice
Hi, thanks for your reply.
So in regards to your response..
I have followed mostly everything you pointed out for me, the second choice still interferes..
Is there a possibility you could fix up the mistakes for me, and copy in the coding so I can just paste it in straight from here?
That would really help..this is such a pain in the ass..haha.
So in regards to your response..
I have followed mostly everything you pointed out for me, the second choice still interferes..
Is there a possibility you could fix up the mistakes for me, and copy in the coding so I can just paste it in straight from here?
That would really help..this is such a pain in the ass..haha.
- xavimat
- Eileen-Class Veteran
- Posts: 1461
- Joined: Sat Feb 25, 2012 8:45 pm
- Completed: Yeshua, Jesus Life, Cops&Robbers
- Projects: Fear&Love
- Organization: Pilgrim Creations
- Github: xavi-mat
- itch: pilgrimcreations
- Location: Spain
- Discord: xavimat
- Contact:
Re: How do I move onto another route once chosen menu choice
Speeny, again, check your indentations.
every label must be in the level 0 of indentation, that means: NO spaces before the word "label"; just stick to the left.
For the "menu" I prefer to put them in a label and use "jump" to another label.
To avoid your problem, don't let any label unfinished; that means, at the end of every label put always a "jump" to another label or a "return".
Your label "goforastroll" doesn't have anything to jump at or to return when it reaches its end, and, logically, it continues with the nex line of code (the label "stayhere" and its lines).
As mjshi has said, use another label to "continue_story" (or "chapter2", or whatever).
every label must be in the level 0 of indentation, that means: NO spaces before the word "label"; just stick to the left.
For the "menu" I prefer to put them in a label and use "jump" to another label.
To avoid your problem, don't let any label unfinished; that means, at the end of every label put always a "jump" to another label or a "return".
Your label "goforastroll" doesn't have anything to jump at or to return when it reaches its end, and, logically, it continues with the nex line of code (the label "stayhere" and its lines).
As mjshi has said, use another label to "continue_story" (or "chapter2", or whatever).
Code: Select all
label chapter25:
menu:
"Option 1":
jump option1
"Option 2":
jump option2
label option1:
"TExt of the option 1"
jump chapter26 # YOU NEED THIS LINE, WITHOUT IT, THE PROGRAM WILL READ THE NEXT LINES
label option2:
"Text of the option 2"
"Bad ending"
return # This returns to the Main Menu
label chapter26:
"Here continues the story"
Comunidad Ren'Py en español: ¡Únete a nuestro Discord!
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)
Re: How do I move onto another route once chosen menu choice
Still confusing as ever for me, but I think I'll manage.
Thanks so much guys.
Thanks so much guys.
Re: How do I move onto another route once chosen menu choice
Take a look at 'Language Basics:Indentation and Blocks' in the Ren'py Docs:
Example:Indentation is very important to Ren'Py, and cause syntax or logical errors when it's incorrect.
- A block is open at the start of a file.
- A new block is started whenever a logical line is indented past the previous logical line.
- All logical lines inside a block must have the same indentation.
- A block ends when a logical line is encountered with less indentation than the lines in the block.
Code: Select all
"This statement, and the if statement that follows, is part of a block."
if True:
"But this statement is part of a new block."
"This is also part of that new block."
"This is part of the first block, again."
-
- Regular
- Posts: 179
- Joined: Wed Mar 13, 2013 9:55 pm
- Completed: MazeSite01, Ponderings of Time
- Contact:
Re: How do I move onto another route once chosen menu choice
Here would be a working example. You can copy/paste this bit, but I do recommend reading the documentation and quickstart, also the links that Karl suggested.
Code: Select all
# Please look through the code and read the lines with the # carefully
menu:
"Go for a stroll?":
b "I proceed to get up and go for a slight walk around the area..I wonder where it'll take me?"
scene nature with fade
play music "[TOP 100 OST] Visual Novel Melancholic_Mysterious Music #22 - Narcissu - Scarlet.mp3"
b "Aaah, the fresh air really opens up my senses."
b "I guess when people say go for a walk when your stressed, it really does help."
b "I usually take those things forgranted."
# Because the second choice is a menu choice, it only occurs when the player chooses it.
"Stay here and admire the scenery.":
jump stayhere
b "I can't help but feel somewhat dissapointed..like I've missed a once in a lifetime encounter or something."
"Ben continues to stay positioned."
return # Choosing to stay where he is will end the game for Ben ): Otherwise, you can add a jump to another label to continue the story.
# Continue the story here! The story here will have Ben choosing to take a stroll.
"Story continued..."
Who is online
Users browsing this forum: Ahrefs [Bot], Milkymalk, wizard_jpg