[Solved!] Jumping to a screen from a label

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
User avatar
lacrimoosa
Newbie
Posts: 23
Joined: Tue Jun 05, 2018 8:31 pm
Projects: Alice's Reverie
Organization: Red&Pink games
Tumblr: lacrimoosa, alicesreverie
itch: redpink-games
Contact:

[Solved!] Jumping to a screen from a label

#1 Post by lacrimoosa »

I want to add a character selection screen in the game but I'm having problems jumping to it. Does anyone know what action to put in script.rpy in order to jump to a screen in the middle of the game?

I've tried this:

Code: Select all

w "where do you intend to go?"
jump screen("select")
and this:

Code: Select all

w "where do you intend to go?"
ShowMenu("select")
I've already made a character selection screen in screens.rpy, but I can't find the right syntax in order to pull up the menu mid-game
Last edited by lacrimoosa on Mon Dec 10, 2018 11:27 pm, edited 1 time in total.
Image

An artist/writer/programmer working to get mine and my partner's ideas out into the world through Red & Pink Games!
"Oh geez, looks like the code just broke."

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3791
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: Jumping to a screen from a label

#2 Post by Imperf3kt »

show screen or call screen
I'd go with call screen personally, but it depends on how you made your screen
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

User avatar
lacrimoosa
Newbie
Posts: 23
Joined: Tue Jun 05, 2018 8:31 pm
Projects: Alice's Reverie
Organization: Red&Pink games
Tumblr: lacrimoosa, alicesreverie
itch: redpink-games
Contact:

Re: Jumping to a screen from a label

#3 Post by lacrimoosa »

Thank you, call does work the way I want it to! Is there a way to hide the screen with a transition statement once you use call? I had brought the screen up using "say" for a while and figured how to show and hide it with a transition, but I'm having trouble doing the same using "call"

This was my extreme workaround with say, but it is the only way I can get the dissolve

Code: Select all

scene black with Dissolve(1.0)
    $ renpy.pause(3.0)
    show screen select
    $ show_quick_menu = True
    $renpy.pause(3600.0)
    $ renpy.transition(dissolve)
label wendy:
    $ show_quick_menu = False
    $ renpy.transition(dissolve)
    hide screen select
    scene black
Image

An artist/writer/programmer working to get mine and my partner's ideas out into the world through Red & Pink Games!
"Oh geez, looks like the code just broke."

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3791
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: Jumping to a screen from a label

#4 Post by Imperf3kt »

If you give your screen an action that returns a _Return, the scren will automatically close itself, which is why I mentioned it depends on your screen.

This is just something I've read in the documentation/forums. I haven't actually ecperimented with it myself, so am unable to guide you in it.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

User avatar
lacrimoosa
Newbie
Posts: 23
Joined: Tue Jun 05, 2018 8:31 pm
Projects: Alice's Reverie
Organization: Red&Pink games
Tumblr: lacrimoosa, alicesreverie
itch: redpink-games
Contact:

Re: Jumping to a screen from a label

#5 Post by lacrimoosa »

Thank you for your help. Unfortunately, the action the screen does is purely start different routes, so I can't use the call statement I guess?

I'll be sure to remember it for the future though!
Image

An artist/writer/programmer working to get mine and my partner's ideas out into the world through Red & Pink Games!
"Oh geez, looks like the code just broke."

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3791
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: Jumping to a screen from a label

#6 Post by Imperf3kt »

You do this via buttons, right?
You can add a Hide("screen name") to the action. Just put a comma between actions.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

User avatar
lacrimoosa
Newbie
Posts: 23
Joined: Tue Jun 05, 2018 8:31 pm
Projects: Alice's Reverie
Organization: Red&Pink games
Tumblr: lacrimoosa, alicesreverie
itch: redpink-games
Contact:

Re: Jumping to a screen from a label

#7 Post by lacrimoosa »

Sorry for the long-overdue response, but adding Hide("screen name) did end up working! To get the dissolve to work though, I still had to do a small workaround of adding a renpy.transition before and after showing the screen. The end result was this:

Code: Select all

$ renpy.transition(dissolve)
show screen select
$ renpy.transition(dissolve)
Thank you for your help on this issue!
Image

An artist/writer/programmer working to get mine and my partner's ideas out into the world through Red & Pink Games!
"Oh geez, looks like the code just broke."

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], WladekProd