[SOLVED] Help with efficient jumping between screens and labels?
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.
[SOLVED] Help with efficient jumping between screens and labels?
Hi again Lemmasoft, I've run into a bit of a snag with my project.
Currently, I have a screen set up so the player can view extra events and scenes from it. I couldn't figure out how to make screens function in the same way as the actual game itself, if that makes sense (like with scene changes, dialogue, sprites, etc) so I settled for jumping to a label from a screen, using "action ui.callsinnewcontext('labelnamehere')". Though this technically works, it feels cumbersome and is a bit of a mess; the scenes within the labels lag like crazy, even on my good laptop, and there's no way to access the menu/quick menu while viewing these scenes for some reason; the only way to exit them is through finishing the entire scene, or closing the game out.
So, my questions are...
1. Is there an easier, more efficient way to jump from a screen to a label (preferably one that will be lag-free)?
2. How can I enable menus/quick menus in this way, if answer 1 doesn't cover that?
Any help would be greatly appreciated. Thank you!
Currently, I have a screen set up so the player can view extra events and scenes from it. I couldn't figure out how to make screens function in the same way as the actual game itself, if that makes sense (like with scene changes, dialogue, sprites, etc) so I settled for jumping to a label from a screen, using "action ui.callsinnewcontext('labelnamehere')". Though this technically works, it feels cumbersome and is a bit of a mess; the scenes within the labels lag like crazy, even on my good laptop, and there's no way to access the menu/quick menu while viewing these scenes for some reason; the only way to exit them is through finishing the entire scene, or closing the game out.
So, my questions are...
1. Is there an easier, more efficient way to jump from a screen to a label (preferably one that will be lag-free)?
2. How can I enable menus/quick menus in this way, if answer 1 doesn't cover that?
Any help would be greatly appreciated. Thank you!
Last edited by bluebat on Sun Dec 20, 2020 4:00 pm, edited 1 time in total.
So much code, so little time...
- hell_oh_world
- Miko-Class Veteran
- Posts: 777
- Joined: Fri Jul 12, 2019 5:21 am
- Contact:
Re: Help with efficient jumping between screens and labels?
i wouldn't use this `ui.callsinnewcontext` since this is very different from a normal jump or call.
https://www.renpy.org/doc/html/screen_actions.html#Jump
using normal actions should fix the 2nd issue.
https://www.renpy.org/doc/html/screen_actions.html#Jump
using normal actions should fix the 2nd issue.
Re: Help with efficient jumping between screens and labels?
Hi again, thanks for your reply.hell_oh_world wrote: ↑Fri Dec 18, 2020 5:27 am i wouldn't use this `ui.callsinnewcontext` since this is very different from a normal jump or call.
https://www.renpy.org/doc/html/screen_actions.html#Jump
using normal actions should fix the 2nd issue.
I've tried to replace "ui.callsinnewcontext" with both Jump and Call, but it's still impossible to access any kind of menus from the labels. I deleted persistent data to see if that would help, but no such luck. Any idea on what could be up with this?
So much code, so little time...
- hell_oh_world
- Miko-Class Veteran
- Posts: 777
- Joined: Fri Jul 12, 2019 5:21 am
- Contact:
Re: Help with efficient jumping between screens and labels?
can you confirm that `quick_menu` is enabled in your game?
while playing, hit `shift + o` then type `quick_menu` and enter and see if the value is True if not then you need to change it before the game starts.
while playing, hit `shift + o` then type `quick_menu` and enter and see if the value is True if not then you need to change it before the game starts.
Code: Select all
label start:
$ quick_menu = True
Re: Help with efficient jumping between screens and labels?
That's ok - click some more and you'll succeed in reaching the recursion depth.
Calling a label in new context means that you run it as a subroutine (like subprogram) and need to return from it to previous context. If you don't have return commands in your labels and keep calling label more and more, you going deeper and deeper... It seems that you need to jump to labels.
What's the code you are using? It's better to use screen Actions instead of ui. functions - https://www.renpy.org/doc/html/screen_actions.html
Re: Help with efficient jumping between screens and labels?
(that happen when people use YouTube or Reddit as a source).
One way to stage such extra scenes while a game is running is to
A) Add a new screen
B) Reference it to the navigation
C) Use the 'replay' functions to start the extra scenes. https://www.renpy.org/doc/html/rooms.html#replay
This way you can access extra scenes from the navigation menu ingame.
That "call in new context" thing worked in veeeeeeeery old renpy releases (and in fact was changed in the replay thing).
One way to stage such extra scenes while a game is running is to
A) Add a new screen
B) Reference it to the navigation
C) Use the 'replay' functions to start the extra scenes. https://www.renpy.org/doc/html/rooms.html#replay
This way you can access extra scenes from the navigation menu ingame.
That "call in new context" thing worked in veeeeeeeery old renpy releases (and in fact was changed in the replay thing).
If you want to debate on a reply I gave to your posts, please QUOTE ME or i'll not be notified about. << now red so probably you'll see it.
10 ? "RENPY"
20 GOTO 10
RUN
10 ? "RENPY"
20 GOTO 10
RUN
Re: Help with efficient jumping between screens and labels?
Yes, quick_menu is enabled. It works perfectly fine within the main game itself, but whenever a label is jumped to from a screen, there's no quick menu. I've tried using both Jump and Call thanks to the help in this thread, and that helped with my lag issue, but the problem of the quick menu being missing still persists.hell_oh_world wrote: ↑Fri Dec 18, 2020 9:16 am can you confirm that `quick_menu` is enabled in your game?
while playing, hit `shift + o` then type `quick_menu` and enter and see if the value is True if not then you need to change it before the game starts.Code: Select all
label start: $ quick_menu = True
Converting the scenes to be replays did help a little; it made it so you can now enter and exit the scenes freely, but you still can't save/load within them (which is understandable of course, given it's a replay.) That's totally fine for the short scenes, but I have one scene in particular that's essentially a whole extra route, so save/load functionality feels necessary given its length. If I really can't figure out what's gone wrong I can always have an optional jump to the extra route's label from the start label once the player's finished the game, but I would really like to have the jump be from the Extra screen if possible...!
Thank you to everyone who has offered insight so far, though! It's all been helpful in its own right. Thanks for being patient with me.
So much code, so little time...
Re: Help with efficient jumping between screens and labels?
So, what are you doing and what's the exact code you are using? Without this information it's hard to give you a proper answer...
Do you mean that you've used Replay-action to start a game instead of Start-action? If so, then everything works as it should (you unable to save game state while in replay mode).
Re: Help with efficient jumping between screens and labels?
Ah no, I'm not using replays to start the main game itself, that's still done through Start(). This is only for scenes meant to be extra unlockables after the player finishes the main game, so I've tried to do it through a screen via the main menu. But for some reason, whether I use Jump, Call or the old ui function, the new scenes start with no quick menu. Most of them are quite short so it's not a big deal, but as I mentioned in my previous post, there's one in particular that's basically a full second route, so that one could really benefit from having save/load functionality.Alex wrote: ↑Sun Dec 20, 2020 4:58 am So, what are you doing and what's the exact code you are using? Without this information it's hard to give you a proper answer...
Do you mean that you've used Replay-action to start a game instead of Start-action? If so, then everything works as it should (you unable to save game state while in replay mode).
This is a snippet of the code I'm currently using:
Code: Select all
(A basic ShowMenu function from the main menu brings us here.)
screen ExtraScenes():
tag menu
add "images/ExtraScreenBackground.png"
imagebutton:
hover_sound "Hover.mp3"
activate_sound "Ding.mp3"
idle "images/OtherSide_idle.png"
hover "images/OtherSide_hover.png"
xpos 500 ypos 500
focus_mask True
action Jump('the_other_side')
So much code, so little time...
Re: Help with efficient jumping between screens and labels?
Just use Start("second_route_label_name")-action instead of Jump("second_route_label_name").
https://www.renpy.org/doc/html/screen_a ... html#Start
Re: Help with efficient jumping between screens and labels?
That's fixed it! And to think the solution was so simple, haha. Thanks so much for your help, it's really appreciated!Alex wrote: ↑Sun Dec 20, 2020 2:17 pmJust use Start("second_route_label_name")-action instead of Jump("second_route_label_name").
https://www.renpy.org/doc/html/screen_a ... html#Start
So much code, so little time...
Who is online
Users browsing this forum: Amazon [Bot], FAST WebCrawler [Crawler], LuckyT