[SOLVED] How to test your project effectively?

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
xxjes6
Newbie
Posts: 2
Joined: Sun Dec 24, 2017 4:27 am
IRC Nick: Jes
Contact:

[SOLVED] How to test your project effectively?

#1 Post by xxjes6 »

Hi I have a quick question about Ren'Py. I'm new to Ren'Py and I don't really know if this question has been answered before, but I couldn't find the answer after searching through the forum for an hour or so. If this question has been answered, please redirect me there.

My question is if I've written a long script in script.rpy. How can I test specific parts of the script without just launching the game and starting from the beginning?
I've tested using the Save and Load option and you would have to do a play through and save then you can load at that screen to test the script again.

I was just wondering if it was possible to start at a specific screen if you know the previous screens already function correctly.
It's not a problem for me to do the save and load option. I was curious if there was another or easier way to get to the specific screen I desire quicker.

I know this question may be trivial but it's been on my mind and I have no idea who to ask this question to.

Thank you for you'r time!
Last edited by xxjes6 on Sun Dec 24, 2017 1:50 pm, edited 1 time in total.
Thank you~ <3

User avatar
IrinaLazareva
Veteran
Posts: 399
Joined: Wed Jun 08, 2016 1:49 pm
Projects: Legacy
Organization: SunShI
Location: St.Petersburg, Russia
Contact:

Re: How to test your project effectively?

#2 Post by IrinaLazareva »

Code: Select all

##temporary screen
screen debugscreen():
    frame:
        align(.95, .01)
        has vbox
        textbutton "test 01" action Jump('myscene01')
        textbutton "test 02" action Jump('myscene02')        
        textbutton "test end" action Jump('finalend')          
       
        
init python:
    config.overlay_screens.append("debugscreen")
##temporary screen

label start:
    "Bla bla"
    
label myscene01:
    "This is scene 01"
    "Bla......"
label myscene02:
    "This is scene 02"
    "Bla..Bla...."
label finalend:
    "The end"
    return

xxjes6
Newbie
Posts: 2
Joined: Sun Dec 24, 2017 4:27 am
IRC Nick: Jes
Contact:

Re: How to test your project effectively?

#3 Post by xxjes6 »

Yes! Thank you so much for this debug screen. This is exactly what I was looking for.
Thank you~ <3

Apa
Regular
Posts: 103
Joined: Fri Dec 23, 2016 2:26 am
Location: NYC
Contact:

Re: How to test your project effectively?

#4 Post by Apa »

IrinaLazareva wrote: Sun Dec 24, 2017 6:03 am

Code: Select all

##temporary screen
screen debugscreen():
Out of curiosity, do you have a tool to auto-generate debugscreen with all game labels?
I guess, you can do it "on the fly" and even add a condition (a regex) which labels to include, right? :oops:

User avatar
IrinaLazareva
Veteran
Posts: 399
Joined: Wed Jun 08, 2016 1:49 pm
Projects: Legacy
Organization: SunShI
Location: St.Petersburg, Russia
Contact:

Re: [SOLVED] How to test your project effectively?

#5 Post by IrinaLazareva »

Well, this is very very very 'crude' code. Use on own risk :wink:

Press "ALT+ Q" for activation.

Code: Select all

default debugon = False
screen debugscreen():
    default seeenlabel = renpy.get_all_labels()
    default bugxz = .01
    if debugon:
        zorder 100
        frame:
            background "#000a"
            align(bugxz, .01)
            xysize(300, 270)            
            viewport id 'debugg':
                draggable True
                mousewheel True
                has vbox
                text "labels:" color "#0f0" 
                for i in seeenlabel:
                    if not "_" in i[:2] and not "screen" in i and not "main_menu" in i:
                        textbutton "[i]" action Jump(str(i)) background None
                label "_________"
                grid 2 2:
                    textbutton "top left" action SetScreenVariable('bugxz', .01)
                    textbutton "top right" action SetScreenVariable('bugxz', .99)            
                    textbutton "Hide()" action SetVariable('debugon', False)
                    textbutton "Stop Game()" action Quit(False)
                        
init python:
    config.overlay_screens.append("debugscreen")
    def overd():
            ui.keymap(alt_K_q=SetVariable("debugon", (not debugon)))
    config.overlay_functions.append(overd)

Apa
Regular
Posts: 103
Joined: Fri Dec 23, 2016 2:26 am
Location: NYC
Contact:

Re: [SOLVED] How to test your project effectively?

#6 Post by Apa »

I’ve moved labels definition to the top and changed it list comprehension.
If I need to change label filter criteria, it’s better to change definition, then code, IMO.
Thanks a lot for your code sample, it’s neat, really! :)

Code: Select all

default debugon = False
screen debugscreen():
    default labels = [i for i in renpy.get_all_labels()
        if not ("_" in i[:2] or "screen" in i or "main_menu" in i)]
    default bugxz = .01
    if debugon:
        zorder 100
        frame:
            background "#000a"
            align(bugxz, .01)
            xysize(300, 270)            
            viewport id 'debugg':
                draggable True
                mousewheel True
                has vbox
                text "labels:" color "#0f0" 
                for i in labels:
                    textbutton "[i]" action Jump(str(i)) background None
                label "_________"
                grid 2 2:
                    textbutton "top left" action SetScreenVariable('bugxz', .01)
                    textbutton "top right" action SetScreenVariable('bugxz', .99)            
                    textbutton "Hide()" action SetVariable('debugon', False)
                    textbutton "Stop Game()" action Quit(False)
                        
init python:
    config.overlay_screens.append("debugscreen")
    def overd():
        ui.keymap(alt_K_q=SetVariable("debugon", (not debugon)))
    config.overlay_functions.append(overd)

User avatar
IrinaLazareva
Veteran
Posts: 399
Joined: Wed Jun 08, 2016 1:49 pm
Projects: Legacy
Organization: SunShI
Location: St.Petersburg, Russia
Contact:

Re: [SOLVED] How to test your project effectively?

#7 Post by IrinaLazareva »

Apa wrote: Mon Dec 25, 2017 6:29 pm I’ve moved labels definition to the top and changed it list comprehension.
If I need to change label filter criteria, it’s better to change definition, then code, IMO.
Great Idea :)

Post Reply

Who is online

Users browsing this forum: 3N16M4, Ocelot