Ren'Py [Solved] Problem with screens when jump to the label?

Quintillian

Member
Apr 15, 2019
137
253
File "renpy/common/00action_menu.rpy", line 199, in __call__
renpy.jump_out_of_context(self.label)
JumpOutException: сhapter_1

It's crashing the game. But I've made changes to the code, which I'll describe later today.
Yeah, you get this error when using Show instead of ShowMenu.
 
  • Thinking Face
Reactions: Midzay

Midzay

Member
Game Developer
Oct 20, 2021
240
639
Hey, guys, hi again. I realized that I can do it easier and redesigned the script. All the code is in the script file and it is simple. If you notice any flaws, please point them out, I would appreciate it.

Python:
screen oglavlenie_button: # button
    imagebutton:
        xalign 1.0
        yalign 1.0
        idle "gui/button/oglavlenie_but.png"
        action Show ("oglavlenie") # name of Content screen
      

screen oglavlenie:
    modal True
    zorder 101
    # Fade the background:
    add Color((0, 0, 0, 125)) size (config.screen_width,config.screen_height)

    frame:
        background ("gui/oglavlenie.png")
        xalign .5
        yalign .5
        xsize 850
        ysize 1080
        padding(40,120,30,40) # text border

        imagebutton: # close button
            xalign 1.0
            yalign -0.1
            idle "gui/button/oglavlenie_close.png"
            hover "gui/button/oglavlenie_close_hover.png"
            action Hide("oglavlenie")

        vbox: # Content screen
            xalign .07
          
            hbox:
                text "Chapter 1"
                textbutton "{b}Title 1{/b} Description." action Jump("chapter_1") padding(15,0,10,20)

            hbox:
                text "Chapter 2"
                textbutton "{b}Title 2{/b} Description." action Jump("chapter_2") padding(15,0,10,20)
              
# The game starts here.
label start:
  
show screen oglavlenie_button

label chapter_1:
    scene image_001 with dissolve
    narrator "Text 1 here {nw}"
    narrator "Text 2 here"
    nvl clear

label chapter_2:
    scene image_002 with dissolve
    narrator "Text 1 here {nw}"
    narrator "Text 2 here"

    # This ends the game.
    return
1/ There is a bug that I don't know how to fix. I show it in the video. The error appears on the first page selected in the menu, and then the operation becomes correct. The error is related to the value of variable "define gui.nvl_list_length" in file gui.rpy. The error disappears only if the numeric value is equal to the number of rows on the transition page.

Python:
## NVL-Mode ####################################################################
##
## The NVL-mode screen displays the dialogue spoken by NVL-mode characters.
...
## The maximum number of NVL-mode entries Ren'Py will display. When more entries
## than this are to be show, the oldest entry will be removed.
define gui.nvl_list_length = 6 # <---
2/ It didn't work to make the table of contents window with a fade effect.

I liked having a table of contents. I especially missed it at the debugging stage.

View attachment Untitled Project.mp4
 

Midzay

Member
Game Developer
Oct 20, 2021
240
639
Problem with the table of contents has been solved. Key to success: put “nvl clear” at the beginning of the scene, not at the end.
This is an example of how the table of contents works in conjunction with character names:

 
  • Heart
Reactions: osanaiko