Screen, Map and Jumps

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
zabuzaeldemonio
Regular
Posts: 103
Joined: Sun Jan 08, 2017 7:24 pm
Projects: Call Me
Location: Spain
Contact:

Screen, Map and Jumps

#1 Post by zabuzaeldemonio »

Hi there.

As the title suggests I would like to know if you can combine these elements. I've tried it, but what usually happens is that the Jump is not permanent (returns when you open the screen), also, by using the right click you open the map. Therefore, if someone knows how to create, a screen (with imagemaps), whose function is to move through the different imagemaps, permanently I would appreciate it.
Here is the code:

Code: Select all

screen elevaciones:
    if cuartoacti:
         imagebutton idle "gui/mapa/slot2_idle.png" xpos 75 ypos 550
    else:
        imagebutton auto "gui/mapa/slot_%s.png" xpos 75 ypos 550 action [SetVariable("segundoacti", False), SetVariable("primeracti", False), SelectedIf(segundoacti), SetVariable("terceracti", False), SetVariable("cuartoacti", True)], If(renpy.get_screen("mapa2"), Hide("mapa2"), ShowTransient("mapa5")),  If(renpy.get_screen("mapa3"), Hide("mapa3"), ShowTransient("mapa5")), If(renpy.get_screen("mapa4"), Hide("mapa4"), ShowTransient("mapa5")),ShowMenu('mapa5') activate_sound ("musica/menu/Blip2.wav") hovered [ Play ("test_alz", "sfx/click.wav")]
    if terceracti:
         imagebutton idle "gui/mapa/slot2_idle.png" xpos 75 ypos 450
    else:
        imagebutton auto "gui/mapa/slot_%s.png" xpos 75 ypos 450 action  [SetVariable("segundoacti", False), SetVariable("cuartoacti", False), SelectedIf(segundoacti), SetVariable("primeracti", False), SetVariable("terceracti", True)], If(renpy.get_screen("mapa2"), Hide("mapa2"), ShowTransient("mapa4")),  If(renpy.get_screen("mapa3"), Hide("mapa3"), ShowTransient("mapa4")), If(renpy.get_screen("mapa5"), Hide("mapa5"), ShowTransient("mapa4")),ShowMenu('mapa4') activate_sound ("musica/menu/Blip2.wav") hovered [ Play ("test_alz", "sfx/click.wav")]
    if segundoacti:
         imagebutton idle "gui/mapa/slot2_idle.png" xpos 75 ypos 350
    else:
        imagebutton auto "gui/mapa/slot_%s.png" xpos 75 ypos 350 action [SetVariable("primeracti", False), SetVariable("terceracti", False), SelectedIf(segundoacti), SetVariable("cuartoacti", False), SetVariable("segundoacti", True)], If(renpy.get_screen("mapa2"), Hide("mapa2"), ShowTransient("mapa3")),  If(renpy.get_screen("mapa4"), Hide("mapa4"), ShowTransient("mapa3")), If(renpy.get_screen("mapa5"), Hide("mapa5"), ShowTransient("mapa3")),ShowMenu('mapa3')  activate_sound ("musica/menu/Blip2.wav") hovered [ Play ("test_alz", "sfx/click.wav")]
    if primeracti:
         imagebutton idle "gui/mapa/slot2_idle.png" xpos 75 ypos 250
    else:
        imagebutton auto "gui/mapa/slot_%s.png" xpos 75 ypos 250 action [SetVariable("segundoacti", False), SetVariable("terceracti", False), SelectedIf(segundoacti), SetVariable("cuartoacti", False), SetVariable("primeracti", True)], If(renpy.get_screen("mapa5"), Hide("mapa5"), ShowTransient("mapa2")),  If(renpy.get_screen("mapa3"), Hide("mapa3"), ShowTransient("mapa2")), If(renpy.get_screen("mapa4"), Hide("mapa4"), ShowTransient("mapa2")),ShowMenu('mapa2') activate_sound ("musica/menu/Blip2.wav") hovered [ Play ("test_alz", "sfx/click.wav")]

screen mapa:
        imagebutton auto "gui/mapa_%s.png" xpos 1710 ypos 200 action If(renpy.get_screen("mapa2"), Hide("mapa2"), ShowMenu("mapa2")) activate_sound ("musica/menu/Blip2.wav") hovered [ Play ("test_alz", "sfx/click.wav")]

                    
This is the part that does not work, I've tried both with call and with Jump

Code: Select all

screen mapa2:
    use elevaciones
    use mapa
    imagebutton idle "gui/mapa/primerpiso_idle.png" xpos 250 ypos 50
    imagebutton auto "gui/mapa/casillero_%s.png" xpos 800 ypos 690 action Jump("casillero") activate_sound ("musica/menu/Blip2.wav") hovered [ Play ("test_alz", "sfx/click.wav")]
    imagebutton auto "gui/mapa/enfermeria_%s.png" xpos 390 ypos 720 action Function(renpy.call, "enfermeria", from_current = True) activate_sound ("musica/menu/Blip2.wav") hovered [ Play ("test_alz", "sfx/click.wav")]
    imagebutton auto "gui/mapa/deportes_%s.png" xpos 1400 ypos 420 action Function(renpy.call, "deportes", from_current = True) activate_sound ("musica/menu/Blip2.wav") hovered [ Play ("test_alz", "sfx/click.wav")]
My personal Project:
Image

User avatar
Kia
Eileen-Class Veteran
Posts: 1040
Joined: Fri Aug 01, 2014 7:49 am
Deviantart: KiaAzad
Discord: Kia#6810
Contact:

Re: Screen, Map and Jumps

#2 Post by Kia »

you can use show and hide instead

Post Reply

Who is online

Users browsing this forum: Google [Bot]