New developer mode?

In this forum we discuss the future of Ren'Py, both bug fixes and longer-term development. Pre-releases are announced and discussed here.
Post Reply
Message
Author
User avatar
Voight-Kampff
Veteran
Posts: 351
Joined: Sat Sep 05, 2009 8:47 am
Contact:

New developer mode?

#1 Post by Voight-Kampff » Thu Mar 31, 2011 9:30 am

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.

User avatar
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?

#2 Post by PyTom » Thu Mar 31, 2011 9:52 am

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:

Code: Select all

renpy.exe tutorial/ --warp tutorial_sprite.rpy:80
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.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

User avatar
Aleema
Lemma-Class Veteran
Posts: 2677
Joined: Fri May 23, 2008 2:11 pm
Organization: happyB
Tumblr: happybackwards
Contact:

Re: New developer mode?

#3 Post by Aleema » Thu Mar 31, 2011 10:05 am

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.

User avatar
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?

#4 Post by Spiky Caterpillar » Sun Apr 10, 2011 10:14 am

IIRC, there's already a command to get a list of all the labels in the game, so something like (pseudocode)

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()
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.)
Nom nom nom nom nom LEAVES.

Post Reply

Who is online

Users browsing this forum: No registered users