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.
Alright, so I'm going to be reusing a screen several times during my VN, and obviously the screen will be called from a different label each time. But each time I call the screen, and the player clicks a certain button, I want them to be able to jump back to the label from where the screen was called that specific time.
I wrote a mockup code of what I'm trying to do here.
screen jumpback:
textbutton "Back to label" xalign 0.5 yalign 0.5 action # ... and here is where i am confused.
label start:
"Alright..."
"Let's go to a screen!"
$ renpy.call_screen("jumpback")
# when the user clicks the textbutton in screen jumpback, ideally, they would come back here.
"Now that you've clicked the text button, we're back to this point!"
jump start2
label start2:
"Let's do this one more time...."
"To screen jumpback we go!"
$ renpy.call_screen("jumpback")
# Now here we are, in a DIFFERENT label, and I once the user clicks 'Back to label' textbutton, they come back to this spot, not the spot in label start.
"Great job of clicking that textbutton! We're back to this label.."
return
As you can see, I don't really know what action to use, or if this is really even possible. I feel like maybe Return() would work but it might not nor I am sure how to go about it. If there's no way to do it in the way I'm thinking, I'm of course open to any alternatives.
Thanks in advance.
Last edited by meiri on Fri Oct 24, 2014 5:11 pm, edited 1 time in total.
What's in a loop? A loop iterated in any other way would output as sweet.
-- Have a look at my GxG kinetic novel, Movement, if you have the chance?
When you call a screen, the game stops at this point, player will be forced to interact with the screen untill it will return anything, then the game will continue, so the action should be Return("some_value").
If you need this value, you can store it like
xela wrote:What happens if you just hide the screen?
Well, for what I am actually trying to do, I have several screens layered on top of each other, and when I tried to hide them all at once, it gave me an error saying it can only take 3 parameters, not 6.
Alex wrote:When you call a screen, the game stops at this point, player will be forced to interact with the screen untill it will return anything, then the game will continue, so the action should be Return("some_value").
If you need this value, you can store it like