can I inherit overridden screen?

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
SONTSE
Regular
Posts: 95
Joined: Sun Nov 24, 2013 10:49 pm
Completed: 8 VN's so far
Contact:

can I inherit overridden screen?

#1 Post by SONTSE » Sun Jan 27, 2019 5:23 pm

I have a third party RenPy application and i want to mod it placing my .rpy file over it.
It will override a screen, which i know would be changed over time and i want my override to sustain the changes, so a rewrite of entire screen is not a preferable option. Instead i want to append some overlay, which will append into the existing screen without changing it.

Let's say the app has a screen.rpy with following code

Code: Select all

screen third_party_screen:
    window:
        vbox:
            text '[who]'
            text '[what]'
            #or whatewer the screen can be
My plan was to tweak it by append my zz_screen_override.rpy with:

Code: Select all

screen my_screen_override:
    frame:
        margin (5,5)
        padding (5,5)
        xsize 300
        ysize 300
        align (1.0,1.0)
        text 'This screen has been defaced!! LOL'

screen third_party_screen:
    use third_party_screen
    use my_screen_override
        
Unfortunately, my approach is not supported. Returns following error:

Code: Select all

I'm sorry, but an uncaught exception occurred.

After initialization, but before game start.
Exception: The following screens use each other in a loop: third_party_screen. This is not allowed.
Any ideas for this? Thanks!
Look! It's moving. It's alive. It's alive... IT'S ALIVE! Oh, in the name of God! Now I know what it feels like to be God!(@Henry_Frankenstein. Sums up my coding style)

Post Reply

Who is online

Users browsing this forum: Google [Bot]