How to override a Ren'py dev 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
majdaddin
Newbie
Posts: 5
Joined: Sun Jun 06, 2021 9:09 am
Contact:

How to override a Ren'py dev screen?

#1 Post by majdaddin »

I'm trying to override a developer screen (`_variable_viewer`), but it keeps using the original one, even if I define mine in an `init 1100` block.

I've created a file in game/, and it's compiled, and it runs correctly (I put a `print` in the init block, above the `screen`), but the dev screen/menu still calls the original Variable Viewer screen from `renpy/common/_developer/developer.rpym`.

Are dev screens special? Can they not be overridden like 'normal' game screens?

The first bit of my `game/varsearch.rpy` file:

Code: Select all

init 1100:
    $ print "varsearch"
    screen _variable_viewer(all_entries, deleted_entries):

        zorder 1010
        modal True
I see a "varsearch" in the console, and no errors, so Ren'py understands the file and the screen, but it's not used when I try to open it with CTRL+D > Variable Viewer.

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: How to override a Ren'py dev screen?

#2 Post by PyTom »

Yes, the dev screens are special because they're loaded after everything else is. if you really want to do this, it would have to be at init 1701 or more.
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

majdaddin
Newbie
Posts: 5
Joined: Sun Jun 06, 2021 9:09 am
Contact:

Re: How to override a Ren'py dev screen?

#3 Post by majdaddin »

Oh wow, my 1100 was almost there! Not a bad guess IMO. I thought they were even more special, unoverridable special.

`init 1800` works perfectly. Excellent. Thanks.

(Can I close or resolve or something this topic?)

majdaddin
Newbie
Posts: 5
Joined: Sun Jun 06, 2021 9:09 am
Contact:

Re: How to override a Ren'py dev screen?

#4 Post by majdaddin »

Btw, where is that 1700 or 1701? Not in `developer.rpym`. That reads like it's all inited with order 0, since it's first-level/global/without init blocks.

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

Re: How to override a Ren'py dev screen?

#5 Post by Ocelot »

majdaddin wrote: Sun Jun 06, 2021 10:03 am Btw, where is that 1700 or 1701? Not in `developer.rpym`. That reads like it's all inited with order 0, since it's first-level/global/without init blocks.
.rpym files are not loaded automatically, they must be loaded explicitely by script somewhere else. And in this case that "somewhere else" is in 00library.rpy under init 1700 block.
< < insert Rick Cook quote here > >

Post Reply

Who is online

Users browsing this forum: Google [Bot], munni