[SOLVED] "show" fails on the "overlay" layer (solution: use another layer)

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
opaopa13
Newbie
Posts: 13
Joined: Mon Nov 20, 2017 9:25 pm
Contact:

[SOLVED] "show" fails on the "overlay" layer (solution: use another layer)

#1 Post by opaopa13 »

Context: I have a little animation play out, and while it's playing out, I want the player character's side portrait to be visible, going through a few different emotions in response to the animation, even though the player character isn't speaking at that moment. For the most part, I can use "show" to create this effect. There's one instance where "show" doesn't work the way I want to it, and it's failing in bizarre ways. Here's the closest I've gotten:

Code: Select all

    show neon worried at lowerright onlayer overlay
    show jbar at offscreen onlayer screens
    show jbar at descend
    $ renpy.pause(1.50, hard='True')

    # THIS PORTRAIT FAILS TO APPEAR
    show neon eyesshut at lowerright onlayer overlay
    $ target_justice = 400.0 * 0.7
    play audio "audio/voice/objectionthwackonly.ogg"

    # COMMENTING OUT THIS hpunch LINE ELIMINATES THE PROBLEM OF THE PORTRAIT NOT APPEARING:
    show jbar with hpunch

    $ renpy.pause(1.50, hard='True')
    show neon vexed at lowerright onlayer overlay
This almost works, but the middle "show" statement fails to render the portrait: nothing appears instead. The side portrait area ends up blank until the third "show" statement. Bizarrely, if I change that "show" statement from "onlayer overlay" to "onlayer screens", the portrait appears, but behind the shaded text area of the UI. Also bizarrely, if I comment out the "show jbar with hpunch" line, the portrait appears normally. Finally, if I add a copy of that "show" statement below the "show jbar with hpunch" statement, the portrait DOES appear, but only after the hpunch animation finishes.

I have no idea what's going on. Why do two of the three show statement works normally? Why does the problem show statement only fail on the overlay layer? Why does the problem show statement start succeeding when I stop applying a transform to a different image? I'm baffled. Any ideas or advice?
Last edited by opaopa13 on Sun Feb 04, 2018 8:36 pm, edited 1 time in total.

User avatar
PyTom
Ren'Py Creator
Posts: 16096
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: "show" fails in one specific context

#2 Post by PyTom »

The overlay layer is an obsolete system layer that has some special uses.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

User avatar
Ocelot
Lemma-Class Veteran
Posts: 2405
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: "show" fails in one specific context

#3 Post by Ocelot »

In particular overlay layer is cleared if you are so much as sneeze near it. It is for RenPy to handle, not user.
< < insert Rick Cook quote here > >

opaopa13
Newbie
Posts: 13
Joined: Mon Nov 20, 2017 9:25 pm
Contact:

[SOLVED] "show" fails on the "overlay" layer (solution: use another layer)

#4 Post by opaopa13 »

D'oh! That's what I get for glancing at the documentation without actually reading it.

Solved the problem by adding a new layer between "screens" and "overlay" and using that instead:

Code: Select all

define config.layers = ['master', 'transient', 'screens', 'foreground', 'overlay']
Thank you!!

Post Reply

Who is online

Users browsing this forum: Google [Bot]