[SOLVED] Call Screens

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
bokuman
Regular
Posts: 65
Joined: Tue May 23, 2017 1:08 pm
Projects: VN 789
Deviantart: bokuman
Contact:

[SOLVED] Call Screens

#1 Post by bokuman » Thu May 16, 2019 12:52 pm

Hello!

I have this navigation

Mainmenu > Your_name > Character_select > Character_chapter_script

I want to back to character_select when character_chapter_script is finished. i used this

Code: Select all

call screen character_select
on final of character_chapter_script, but the game stop and a screen error jump D:

Thanks in advance!
Last edited by bokuman on Mon May 20, 2019 4:06 pm, edited 1 time in total.

User avatar
Alex
Lemma-Class Veteran
Posts: 2981
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: Call Screens

#2 Post by Alex » Thu May 16, 2019 4:26 pm

It's not clear if Mainmenu > Your_name > Character_select > Character_chapter_script are screens or labels and how they called?
Could you provide your actual script (or shortened one) to see how it arranged.
And by the way whats the error you got (copy/paste it from error.txt in your project folder).

bokuman
Regular
Posts: 65
Joined: Tue May 23, 2017 1:08 pm
Projects: VN 789
Deviantart: bokuman
Contact:

Re: Call Screens

#3 Post by bokuman » Sat May 18, 2019 12:23 pm

Mainmenu screen

Code: Select all

screen main_menu:
    tag menu
    if not persistent.extra_unlocked:
        imagemap:
            ground 'gui/imagemap_main_menu_idle.jpg'
            hover 'gui/imagemap_main_menu_hover.jpg'
        
            hotspot (973, 168, 185, 68) action ShowMenu('playername') hovered [ Play ("test_one", "sfx/click.wav"), Show("gui_tooltip", my_picture="gui/tooltip_main_menu_start.png", my_tt_xpos=46, my_tt_ypos=518) ] unhovered [Hide("gui_tooltip")]
Your name screen

Code: Select all

screen playername:

    tag menu

    use game_menu(_("Your name")):

        vbox:
            text "What is your name?"
            input changed nameinput_func
            
    imagemap:
        ground 'gui/aaa.png'
        hover 'gui/bbb.png'
        
        hotspot (973, 168, 185, 68) action ShowMenu('select') hovered [ Play ("test_one", "sfx/click.wav"), Show("gui_tooltip", my_picture="gui/tooltip_main_menu_start.png", my_tt_xpos=46, my_tt_ypos=518) ] unhovered [Hide("gui_tooltip")]
Select character

Code: Select all

screen select:
    tag menu
    
    imagemap:
        ground 'gui/imagemap_select_idle.jpg'
        hover 'gui/imagemap_select_hover.jpg'
        
        hotspot (430, 33, 238, 213) action Start('cheelai_chapter') hovered [ Play ("test_one", "sfx/click.wav"), Show("image_float", my_picture="gui/cs_cheelai_clothes.png", my_tt_xpos=0, my_tt_ypos=0) ] unhovered [Hide("gui_tooltip")]

Character chapter, all characters works in same way.

Code: Select all

label cheelai_chapter:



label start_cheelai:


    "Here we are at another morning."
   
    p "Please come in."

    scene cheelai_stand_01
    with dissolve

    u "Hello!"

    p "Hi, how are you?"
    u "I'm doing very well! How about you?"

    c "Yes, well, thank you for having me."
    p "You're welcome. Shall we take our seats now?"
    c "Yes!"

    scene cheelai_sit_01
    with dissolve
    
    call screen select
    
they are short version of the code, i want to back to select screen, but when i select other character i received this error.

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/charscript/meiko_chapter.rpy", line 18, in script
    call screen select
  File "renpy/common/000statements.rpy", line 471, in execute_call_screen
    store._return = renpy.call_screen(name, *args, **kwargs)
  File "renpy/common/00action_menu.rpy", line 141, in __call__
    renpy.jump_out_of_context(self.label)
JumpOutException: meiko_chapter

-- Full Traceback ------------------------------------------------------------

Full traceback:
  File "D:\renpy\renpy-6.99.11-sdk\renpy\bootstrap.py", line 277, in bootstrap
    renpy.main.main()
  File "D:\renpy\renpy-6.99.11-sdk\renpy\main.py", line 478, in main
    run(restart)
  File "D:\renpy\renpy-6.99.11-sdk\renpy\main.py", line 144, in run
    renpy.execution.run_context(True)
  File "D:\renpy\renpy-6.99.11-sdk\renpy\execution.py", line 734, in run_context
    context.run()
  File "game/charscript/meiko_chapter.rpy", line 18, in script
    call screen select
  File "D:\renpy\renpy-6.99.11-sdk\renpy\ast.py", line 1696, in execute
    self.call("execute")
  File "D:\renpy\renpy-6.99.11-sdk\renpy\ast.py", line 1714, in call
    return renpy.statements.call(method, parsed, *args, **kwargs)
  File "D:\renpy\renpy-6.99.11-sdk\renpy\statements.py", line 144, in call
    return method(parsed, *args, **kwargs)
  File "renpy/common/000statements.rpy", line 471, in execute_call_screen
    store._return = renpy.call_screen(name, *args, **kwargs)
  File "D:\renpy\renpy-6.99.11-sdk\renpy\exports.py", line 2496, in call_screen
    rv = renpy.ui.interact(mouse="screen", type="screen", roll_forward=roll_forward)
  File "D:\renpy\renpy-6.99.11-sdk\renpy\ui.py", line 278, in interact
    rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
  File "D:\renpy\renpy-6.99.11-sdk\renpy\display\core.py", line 2496, in interact
    repeat, rv = self.interact_core(preloads=preloads, **kwargs)
  File "D:\renpy\renpy-6.99.11-sdk\renpy\display\core.py", line 3172, in interact_core
    rv = root_widget.event(ev, x, y, 0)
  File "D:\renpy\renpy-6.99.11-sdk\renpy\display\layout.py", line 928, in event
    rv = i.event(ev, x - xo, y - yo, cst)
  File "D:\renpy\renpy-6.99.11-sdk\renpy\display\layout.py", line 928, in event
    rv = i.event(ev, x - xo, y - yo, cst)
  File "D:\renpy\renpy-6.99.11-sdk\renpy\display\layout.py", line 928, in event
    rv = i.event(ev, x - xo, y - yo, cst)
  File "D:\renpy\renpy-6.99.11-sdk\renpy\display\screen.py", line 646, in event
    rv = self.child.event(ev, x, y, st)
  File "D:\renpy\renpy-6.99.11-sdk\renpy\display\layout.py", line 928, in event
    rv = i.event(ev, x - xo, y - yo, cst)
  File "D:\renpy\renpy-6.99.11-sdk\renpy\display\layout.py", line 928, in event
    rv = i.event(ev, x - xo, y - yo, cst)
  File "D:\renpy\renpy-6.99.11-sdk\renpy\display\layout.py", line 928, in event
    rv = i.event(ev, x - xo, y - yo, cst)
  File "D:\renpy\renpy-6.99.11-sdk\renpy\display\behavior.py", line 868, in event
    return handle_click(self.clicked)
  File "D:\renpy\renpy-6.99.11-sdk\renpy\display\behavior.py", line 803, in handle_click
    rv = run(action)
  File "D:\renpy\renpy-6.99.11-sdk\renpy\display\behavior.py", line 302, in run
    return action(*args, **kwargs)
  File "renpy/common/00action_menu.rpy", line 141, in __call__
    renpy.jump_out_of_context(self.label)
  File "D:\renpy\renpy-6.99.11-sdk\renpy\exports.py", line 1570, in jump_out_of_context
    raise renpy.game.JumpOutException(label)
JumpOutException: meiko_chapter

Windows-7-6.1.7601-SP1
Ren'Py 6.99.11.1749
 
Thanks in advance

User avatar
Alex
Lemma-Class Veteran
Posts: 2981
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: Call Screens

#4 Post by Alex » Sat May 18, 2019 5:29 pm

You see, the way you've made this select screen made it a kind of part of the main menu. So if you want to choose another player you need to end current game and return to main menu at first.
You could either send player back to main menu to let choose another name/chapter or rearrange your code to call character selection screen from ingame not from main menu.

bokuman
Regular
Posts: 65
Joined: Tue May 23, 2017 1:08 pm
Projects: VN 789
Deviantart: bokuman
Contact:

Re: Call Screens

#5 Post by bokuman » Sat May 18, 2019 8:04 pm

i dont want to choose another player, the select screen is for select another character story s thing similar to like Megaman select stage, for this reason i dont want to back to mainmenu.

User avatar
Alex
Lemma-Class Veteran
Posts: 2981
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: Call Screens

#6 Post by Alex » Sat May 18, 2019 8:29 pm

So you should start the game from main menu and only then show the select screen to choose chapter, and in this screen should have a Jump('cheelai_chapter') action instead of Start action.

bokuman
Regular
Posts: 65
Joined: Tue May 23, 2017 1:08 pm
Projects: VN 789
Deviantart: bokuman
Contact:

Re: Call Screens

#7 Post by bokuman » Sat May 18, 2019 9:45 pm

oh! works now thanks!, but a image that i use like image tooltip on select screen is showing on chapter part...

the thing show image float.

Code: Select all

screen select:
    tag menu
    
    imagemap:
        ground 'gui/imagemap_select_idle.jpg'
        hover 'gui/imagemap_select_hover.jpg'
        
        hotspot (430, 33, 238, 213) action Start('cheelai_chapter') hovered [ Play ("test_one", "sfx/click.wav"), Show("image_float", my_picture="gui/cs_cheelai_clothes.png", my_tt_xpos=0, my_tt_ypos=0) ] unhovered [Hide("gui_tooltip")]

User avatar
Andredron
Miko-Class Veteran
Posts: 535
Joined: Thu Dec 28, 2017 2:37 pm
Completed: Kimi ga nozomu renpy-port(demo), Albatross Koukairoku(demo)
Projects: Sisters ~Natsu no Saigo no Hi~(renpy-port)
Location: Russia
Contact:

Re: Call Screens

#8 Post by Andredron » Sat May 18, 2019 10:43 pm

I'm writing a Renpy textbook (in Russian). https://disk.yandex.ru/i/httNEajU7iFWHA (all information is out of date) Update 22.06.18

Help me to register in QQ International

Honest Critique

User avatar
Alex
Lemma-Class Veteran
Posts: 2981
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: Call Screens

#9 Post by Alex » Sun May 19, 2019 2:47 pm

Khm, your hotspot shows "image_float" screen while hovered, but tries to hide "gui_tooltip" screen when unhovered... That's why "image_float" screen remains onscreen.

bokuman
Regular
Posts: 65
Joined: Tue May 23, 2017 1:08 pm
Projects: VN 789
Deviantart: bokuman
Contact:

Re: Call Screens

#10 Post by bokuman » Mon May 20, 2019 2:51 pm

Thanks, but the image is there yet showing on chapters screen, i fixed those "image_float" on select screen. Maybe there is some way to hide the tootl tip image when i click the button??

User avatar
Alex
Lemma-Class Veteran
Posts: 2981
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: Call Screens

#11 Post by Alex » Mon May 20, 2019 3:46 pm

That's kind of strange...
bokuman wrote:
Mon May 20, 2019 2:51 pm
...Maybe there is some way to hide the tootl tip image when i click the button??
Yes, you can set a list of actions for the button/hotspot, try

Code: Select all

hotspot (430, 33, 238, 213) action [Hide("image_float", Start('cheelai_chapter')] hovered [ Play ("test_one", "sfx/click.wav"), Show("image_float", my_picture="gui/cs_cheelai_clothes.png", my_tt_xpos=0, my_tt_ypos=0) ] unhovered [Hide("image_float")]

bokuman
Regular
Posts: 65
Joined: Tue May 23, 2017 1:08 pm
Projects: VN 789
Deviantart: bokuman
Contact:

Re: Call Screens

#12 Post by bokuman » Mon May 20, 2019 4:05 pm

WORKS!!! Thanks a lot! :D

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Kia, span4ev