Screen not Closing [Solved]

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
Mutive
Veteran
Posts: 344
Joined: Tue Nov 21, 2017 2:23 am
Completed: Eidolon, Minion!, Love Furever, Epilogue
Contact:

Screen not Closing [Solved]

#1 Post by Mutive »

I'm programming a game in which, for a period of time a screen is pulled up and the player clicks on hot spots. There's an exit condition so that once the hot spots are clicked, the player jumps to a label that supposedly hides the screens + progresses on with the game.

So something like this...

Code: Select all

label canvas:

	show screen canvas
	pause

screen canvas:
    imagemap:
        ground "backgroundgraphic.png"
        if conditions == True:
            hotspot(0, 0, 1920, 1080) clicked Jump("exit_game")
        if stuff == False:
            hotspot (790, 50, 100, 100) clicked [SetVariable("activeStar", A), Jump ("panelcanvas")] hovered ShowTransient ("sparkleA") unhovered Hide("sparkleA")
            hotspot (1090, 200, 100, 100) clicked [SetVariable("activeStar", B), Jump ("panelcanvas")] hovered ShowTransient ("sparkleB") unhovered Hide("sparkleB")
            hotspot (980, 410, 100, 100) clicked [SetVariable("activeStar", C), Jump ("panelcanvas")] hovered ShowTransient ("sparkleC") unhovered Hide("sparkleC")
            hotspot (660, 440, 100, 100) clicked [SetVariable("activeStar", D), Jump ("panelcanvas")] hovered ShowTransient ("sparkleD") unhovered Hide("sparkleD")
            hotspot (550, 220, 100, 100) clicked [SetVariable("activeStar", E), Jump ("panelcanvas")] hovered ShowTransient ("sparkleE") unhovered Hide("sparkleE")
       
etc.

Then to close out of the many screens + hot spots, I created a hideScreens command like this...

Code: Select all

label hideScreens:
    hide screen canvas
    hide screen screenA
    hide screen screenB
	.
	.
	.
    return #required
Then to actually close them out I've had the game jump to the exit condition like this:

Code: Select all

label exit_game:

    n "You beat the game! Yay!!!!"
    call hideScreens
    jump story
Weirdly, the "You beat the game! Yay!!!!" message is appearing. But the screens are remaining and Renpy isn't jumping to the story.

I'm not sure what I'm doing wrong. (Clearly something???) If anyone can figure anything out, would they be kind enough to let me know? Pretty please????
Last edited by Mutive on Fri May 19, 2023 1:30 pm, edited 1 time in total.
Enjoy Eidolon, my free to play game at: https://mutive.itch.io/eidolon, Minion! at: https://mutive.itch.io/minion or Epilogue at: https://mutive.itch.io/epilogue

Mutive
Veteran
Posts: 344
Joined: Tue Nov 21, 2017 2:23 am
Completed: Eidolon, Minion!, Love Furever, Epilogue
Contact:

Re: Screen not Closing

#2 Post by Mutive »

I got it to work by using "hide canvas", etc. vs. "hide screen canvas", etc.

Not quite sure why that worked, but at least can move forward!
Enjoy Eidolon, my free to play game at: https://mutive.itch.io/eidolon, Minion! at: https://mutive.itch.io/minion or Epilogue at: https://mutive.itch.io/epilogue

Post Reply

Who is online

Users browsing this forum: Google [Bot]