Just thinking out loud, wondering if there might be some way to solve one of my own annoying dilemas in developing a rather lengthy game.
Is there, or could there be some way to turn on a "developer mode" that would allow one to access a special menu that would list all individual scenes in a game?
I'm currently using "label" to separate scenes. And it'd be nice if Ren'Py could evaluate all of those entries and allow me to load any one that I choose, at any point, so I could test code changes in that particular scene - rather than try to find an old saved game that MIGHT be located somewhere near the scene that I need to test.
New developer mode?
- Voight-Kampff
- Veteran
- Posts: 351
- Joined: Sat Sep 05, 2009 8:47 am
- Contact:
- PyTom
- Ren'Py Creator
- Posts: 15893
- 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: New developer mode?
The problem with jumping to an arbitrary label is that it only sometimes works. Jumping to an arbitrary label can fail if:
- The label isn't immediately followed by a scene statement. (Or in general, if it inherits the scene from a previous part of the program.)
- The game stores state in variables. These variables won't be set up at the time of the jump.
Ren'Py's warp system - which hasn't been used/promoted in quite some time, but seems to still work - tries to solve the first problem by going back to a previous scene statement from the line that is warped to. You can invoke warp using a command line like:
I think the most common way people have done this is to put together a secret menu, which lets them jump to an appropriate part of the game. This secret menu can also set up variables as necessary, so you might be able to make it through the rest of the game.
That being said, the ability to force a jump to a label isn't a horrible thing to have - if people think it will be useful despite the potential problems, I'll add it.
- The label isn't immediately followed by a scene statement. (Or in general, if it inherits the scene from a previous part of the program.)
- The game stores state in variables. These variables won't be set up at the time of the jump.
Ren'Py's warp system - which hasn't been used/promoted in quite some time, but seems to still work - tries to solve the first problem by going back to a previous scene statement from the line that is warped to. You can invoke warp using a command line like:
Code: Select all
renpy.exe tutorial/ --warp tutorial_sprite.rpy:80
That being said, the ability to force a jump to a label isn't a horrible thing to have - if people think it will be useful despite the potential problems, I'll add it.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom(When was the last time you backed up your game?)
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom
- Aleema
- Lemma-Class Veteran
- Posts: 2677
- Joined: Fri May 23, 2008 2:11 pm
- Organization: happyB
- Tumblr: happybackwards
- Contact:
Re: New developer mode?
I ... am ... going to second this proposal? I find myself making my own label directory for every one of my games, and if there was some way to do this, even with variables botched (these often don't matter if I'm just checking scripting with my SHIFT+R handy). I'm even a-ok with getting a blank screen if it inherited an image before it. That's something I knew when I made it a separate label and then linked to it.
I do the "secret menu" PyTom recommends, but I do it for every game, so I think a request for something like this seems as important to development as other things on the To Do list.
I do the "secret menu" PyTom recommends, but I do it for every game, so I think a request for something like this seems as important to development as other things on the To Do list.
- Spiky Caterpillar
- Veteran
- Posts: 253
- Joined: Fri Nov 14, 2008 7:59 pm
- Completed: Lots.
- Projects: Black Closet
- Organization: Slipshod
- Location: Behind you.
- Contact:
Re: New developer mode?
IIRC, there's already a command to get a list of all the labels in the game, so something like (pseudocode)
inside a scrolling pane is possible. (A bit impractical for any long project, though. Pagination, sorting, and filtration are left as an exercise for the implementor. If I were doing it, I'd have a text widget you can type partial label names into, and limit the buttons shown to only those containing whatever you've typed.)
Code: Select all
all_labels = renpy.labels() # I don't remember the real command.
ui.vbox()
for lbl in all_labels:
ui.textbutton(lbl,clicked=ui.jumps(lbl))
ui.close()
Nom nom nom nom nom LEAVES.
Who is online
Users browsing this forum: No registered users
