Page 1 of 1

Debugging/Statistics Menu

Posted: Sun Dec 15, 2013 1:12 pm
by rabcor
I need to create an interface mostly for debugging purposes which will basically consist of a handful of buttons, many strings and many variables.

My goal with this currently is to test out different scenarios to see how my attributes/skills/stats code for an RPG will work out under different scenarios, and if i made any errors in my formulas, and i'm sure i'll find more uses for this in the future.

Here's an example of what i mean (roughly):
Image

How should i do this?

Re: Debugging/Statistics Menu

Posted: Sun Dec 15, 2013 1:59 pm
by Tsapas
A very crude and quick screen is the following

Code: Select all

screen debug_screen:
  frame:
    vbox:    
        hbox:
                textbutton "button" action SetVariable("variable", value)
                textbutton "button" action #some other action
                #etc.
        hbox:
                text "[variable]" #will show the variable value
                text "variable name : [variable]" #if you want to have a variable name as well
                #etc.
                textbutton "button" action SetVariable("variable", value)
                textbutton "button" action #some other action
        hbox:
                text "[variable]" #will show the variable value
                text "[variable]" 
                #etc.
                textbutton "button" action SetVariable("variable", value)
                textbutton "button" action #some other action
        hbox:
                text "[variable]" #will show the variable value
                text "[variable]" 
                #etc.
                textbutton "button" action SetVariable("variable", value)
                textbutton "button" action #some other action
    hbox:
            xalign 0.95
            yalign 0.95
            textbutton _("Return") action Return() # to go back
Then you just need to make a button in your game that calls that screen and you're done.

Re: Debugging/Statistics Menu

Posted: Sun Dec 15, 2013 4:24 pm
by rabcor
Thanks a lot! that was exactly what i needed :)

Re: Debugging/Statistics Menu

Posted: Thu Dec 19, 2013 6:39 am
by xavimat
While this screen serves your specific needs, you can also use the built-in console. Just press shift+O and you'll gain access to the console where you can check for variables, change them and use functions.

Re: Debugging/Statistics Menu

Posted: Thu Dec 19, 2013 12:38 pm
by rabcor
:O i had such a thing from the start? :roll:

Well still though, i think building a debugger is worth it for what i'm trying to make (which is an entire leveling system mechanic, it'll be a lot easier to test it out with buttons/gui than just raw code)