Page 7 of 11

Re: Debug - A whole new way of debugging your game

Posted: Fri Mar 22, 2013 7:45 am
by jack0088
why doesn't it work?
put the debug.lua into a directory and created inside the same a main.lua.
the main.lua has "require 'debug'" and "function love.load() print('hello') end" inside.
cannot activate cant see anything. whats wrong?

Re: Debug - A whole new way of debugging your game

Posted: Sat Mar 23, 2013 10:42 pm
by Qcode
I've updated this myself for 0.8.0, most of the problems were in love.run.
Installation is mostly the same, except you can't name it debug.lua anymore. The code require "debug" doesn't seem to work anymore, it may be because it tries requiring the debug library. I've changed it to lovedebug.lua.
I've also added a new variable that you can set to customize this. Originally, you had to hold shift/control and press f8. It still defaults to f8, but now you can set _lovedebugpresskey to your "press key". Just something to make it more convenient.
Anyway, enjoy this new working version.

Re: Debug - A whole new way of debugging your game

Posted: Sun Mar 24, 2013 1:33 pm
by jack0088
downloaded and tried, although I can't use it right now..
there are some errors appear, but looking into it.

would you mind uploading your .love project file, which is working for you?

Re: Debug - A whole new way of debugging your game

Posted: Sun Mar 24, 2013 3:05 pm
by Qcode
I think I've fixed the errors you are talking about. For some reason left and right keys were returning unicode values of around 6000. They couldn't be translated by string.char, so I added a unicode limit of 500.
I also added some extra functionality to it, pressing tab will auto complete that variable to the current proposal. Also, pressing up restores your last command.
I've added the new file, and my game lovedebug is running in.

Re: Debug - A whole new way of debugging your game

Posted: Sun Mar 24, 2013 8:05 pm
by jack0088
this is AWESOME. very useful!
PS: would be cool to have a repetitive keyboard behavior on pressed down keys. for example:
while love.keyboard.isDown("backspace") do
--delete command line
end

Re: Debug - A whole new way of debugging your game

Posted: Thu Aug 01, 2013 1:36 pm
by Ranguna259
I picked up Qcode's code and added some of my own (I've been adding stuff to this since I downloaded it)

There was one thing that I hated about this, it was when I had a lot of output in the console and I had to scroll all the way down to see the end, I've even spent MINUTES just scrolling and scrolling down and that sucked so I've added a new functionality:
  • You can now jump to the last output just by pressing the middle mouse button.



Let's make some changlogs for this:
Changelog
Version 1.2.2 (not official)
  • Added a new functionality that enables you to jump right to the bottom of the console by pressing the middle mouse button.
Version 1.2.1 (not official)
  • Fixed some bugs
  • Added a new functionality that autocompletes the variable to the current proposal by pressing tab
Version 1.2 (not official)
  • Converted to LÖVE 0.8.0
  • Added a new functionality that enables you to change the 'f8' key to what you want by changing the _lovedebugpresskey='the key you want'
Version 1.1.5
  • Added Shift + F8 console opening, the old one still remains (Thank you miko)
  • Everything except for settings (which has its own global table) is now put into the local table _Debug (Thank you tentus)
Version 1.1
  • Fixed the console to be hidden at the start
  • Added _OverlayColor to global settings (see _Settings() for a list of settings) Changed location as of 1.1.5 to _DebugSettings.Settings()
Version 1.0
  • Initial version

Re: Debug - A whole new way of debugging your game

Posted: Fri Aug 02, 2013 5:16 pm
by Walz.
Thanks for the unofficial update !
Here a little bug I found.
When I don't use a custom font, ex:

Code: Select all

require 'lovedebug'
function love.load()
end
function love.update(dt)	
end
function love.draw()
end
I get :
lovedebug.lua:175: Incorrect parameter type: expected userdata.
in function 'setFont'

I fixed it by replacing (line 175) :
love.graphics.setFont(font)
by :
if font then love.graphics.setFont(font) end

Re: Debug - A whole new way of debugging your game

Posted: Fri Aug 02, 2013 6:02 pm
by Ranguna259
Alright cool, so apperantly when you don't use a costum font the debugger crashes and thanks to Walz. that has now been fixed :awesome:




Let's make some changlogs for this:
Changelog
Version 1.2.3 (Not Official) by Walz.
  • Fixed a font related bug
Version 1.2.2 (Not Official) by Ranguna
  • Added a new functionality that enables you to jump right to the bottom of the console by pressing the middle mouse button.
Version 1.2.1 (Not Official) by Qcode
  • Fixed some bugs
  • Added a new functionality that autocompletes the variable to the current proposal by pressing tab
Version 1.2 (Not Official) by Qcode
  • Converted to LÖVE 0.8.0
  • Added a new functionality that enables you to change the 'f8' key to what you want by changing the _lovedebugpresskey='the key you want'
Version 1.1.5
  • Added Shift + F8 console opening, the old one still remains (Thank you miko)
  • Everything except for settings (which has its own global table) is now put into the local table _Debug (Thank you tentus)
Version 1.1
  • Fixed the console to be hidden at the start
  • Added _OverlayColor to global settings (see _Settings() for a list of settings) Changed location as of 1.1.5 to _DebugSettings.Settings()
Version 1.0
  • Initial version

Re: Debug - A whole new way of debugging your game

Posted: Fri Aug 02, 2013 11:19 pm
by bartbes
This is actually because the default font is only loaded upon first use, so getFont returns nil until after the first print (unless setFont is called manually, beforehand).

Re: Debug - A whole new way of debugging your game

Posted: Sat Aug 03, 2013 2:44 pm
by Ranguna259
bartbes wrote:This is actually because the default font is only loaded upon first use, so getFont returns nil until after the first print (unless setFont is called manually, beforehand).
Noted, so that's why checking the font before setting it fixed it