[SOLVED] How can I go back in the same screen and situations 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
deltadidirac
Regular
Posts: 123
Joined: Fri Nov 30, 2018 5:00 am
Projects: Artworks and Comics
Tumblr: deltadidirac
Deviantart: Deltadidirac67
Location: Europe
Contact:

[SOLVED] How can I go back in the same screen and situations from a label?

#1 Post by deltadidirac » Tue Oct 29, 2019 12:48 pm

hi,
it's all the day that I try to find a solution but now I'm exausted...

I'm in my gallery screen... after some scenes, appear a new slot in the gallery, cliking on it I jump to a label that repeat, reload or replay, some actions, images or animation...

- 1° problem is that when I jump in this label , it not appear....
- 2° problem if I write return at the end of the label, after some seconds will apear the main _menu.....

here all my scripts::

the SCREEN

Code: Select all

screen gallery_1:
    modal True
    zorder 102
    add "glassgal_1" at zoommov
    imagebutton:
        idle "butx3-id"
        hover "butx3-ho"
        action [Hide ("gallery_1", transition=dissolve), Show ("info")]
        xpos 793
        ypos 642
    imagebutton:
        idle "arrow_id"
        hover "arrow_sxho"
        action [Hide ("gallery_1", transition=dissolve), Show ("info")]
        xpos 683
        ypos 541
    imagebutton:
        idle "arrow_id"
        hover "arrow_dxho"
        action NullAction () 
        xpos 735
        ypos 579
    imagebutton:  #1                                                          
        idle "thumb1"
        hover "bgsprite-id"
        action [Hide ("interface"), Hide ("gallery_1"), Jump ("gallerylab_1")]  ############ here the Jump command
        xpos 165
        ypos 152
THE LABEL with her ATL::

Code: Select all

label gallerylab_1:
    scene bg black with dissolve
    show prova1
    hide prova1
    scene bg black with dissolve

    $ galleryval +=1
    return


transform prova1:
    "int3" with dissolve
    pause 02
    "int10" with dissolve
    pause 02
    "int11" with pushright
    pause 02
    "int12" with pushleft
    pause 02
    "int13" with dissolve
    pause 02
    "int7" with dissolve
    pause 02
    "int8" with pushleft
    pause 02
    "int9" with pushright
    pause 02
anyone have some ides?
thanks
Last edited by deltadidirac on Wed Oct 30, 2019 8:05 am, edited 1 time in total.

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

Re: after a day of tests.... How can I go back in the same screen and situations from a label?

#2 Post by Alex » Tue Oct 29, 2019 7:02 pm

deltadidirac wrote:
Tue Oct 29, 2019 12:48 pm
...
I assume that you show the gallery from the main menu, so jumping to label and returning from it will bring you back to main menu. Try to call this label - https://www.renpy.org/doc/html/screen_actions.html#Call

Code: Select all

label gallerylab_1:
    scene bg black with dissolve
    show prova1
    hide prova1
    scene bg black with dissolve

    $ galleryval +=1
    return
This code will show black screen, then sh.. hide the image, show black screen again, change the value and return.
Try to add pause between the lines that show/hide prova1.

User avatar
deltadidirac
Regular
Posts: 123
Joined: Fri Nov 30, 2018 5:00 am
Projects: Artworks and Comics
Tumblr: deltadidirac
Deviantart: Deltadidirac67
Location: Europe
Contact:

Re: after a day of tests.... How can I go back in the same screen and situations from a label?

#3 Post by deltadidirac » Tue Oct 29, 2019 7:15 pm

hi alex,
no it's wrong,

I show the gallery from my custom "User Interface", this is the problem...

I can open my UI when I'm at home , or around another location, in one button of the UI there is the show command for the gallery screen.
In conclusion, when i finish to view my gallery scenes, at the end of it I would like to return where I was before open the gallery (at home, or in a room , or in the town etc... )

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

Re: after a day of tests.... How can I go back in the same screen and situations from a label?

#4 Post by Alex » Tue Oct 29, 2019 8:07 pm

Well..., then you could try not to show the gallery, but call a label that will show gallery screen and will have a line with return statement to return from gallery to the point from where it was called. Like (this not tested code)

Code: Select all

screen my_ui():
    textbutton "Gallery" action [Hide("my_ui", Call("gallery_lbl")] align(0.05, 0.05)

screen gallery_scr():
    modal True
    vbox:
        align(0.5, 0.05)
        textbutton "Some more" action [Hide("gallery_scr"), Call("another_lbl")]
        textbutton "Done" action [Hide("gallery_scr"), Return()]

label gallery_lbl:
    show screen gallery_scr
    $ renpy.pause()
    show screen my_ui 
    return
label another_lbl:
    scene bg some_img
    "!!!"
    return

label start:
    show screen my_ui
    "..."
    "... ..."
    "?!"

User avatar
deltadidirac
Regular
Posts: 123
Joined: Fri Nov 30, 2018 5:00 am
Projects: Artworks and Comics
Tumblr: deltadidirac
Deviantart: Deltadidirac67
Location: Europe
Contact:

Re: after a day of tests.... How can I go back in the same screen and situations from a label?

#5 Post by deltadidirac » Wed Oct 30, 2019 5:36 am

Alex wrote:
Tue Oct 29, 2019 8:07 pm
Well..., then you could try not to show the gallery, but call a label that will show gallery screen and will have a line with return statement to return from gallery to the point from where it was called. Like (this not tested code)

Code: Select all

screen my_ui():
    textbutton "Gallery" action [Hide("my_ui", Call("gallery_lbl")] align(0.05, 0.05)

screen gallery_scr():
    modal True
    vbox:
        align(0.5, 0.05)
        textbutton "Some more" action [Hide("gallery_scr"), Call("another_lbl")]
        textbutton "Done" action [Hide("gallery_scr"), Return()]

label gallery_lbl:
    show screen gallery_scr
    $ renpy.pause()
    show screen my_ui 
    return
label another_lbl:
    scene bg some_img
    "!!!"
    return

label start:
    show screen my_ui
    "..."
    "... ..."
    "?!"
thanks for the availability,
I solved all with 1 new simple screen

in conclusion, when appear a new slot in the gallery, this one call directly a new related screen that have a simple bg with an ATL and a textbutton to "return", Done!
the big mistake I did is that Icreated too much things and I didn't wrote Hide and Show correctly and I let all screens labels and so on, opened, so renpy doesn't understoond what to do

Post Reply

Who is online

Users browsing this forum: Ocelot