## LoveDebug - A whole new way of debugging your game

s-ol
Party member
Posts: 1077
Joined: Mon Sep 15, 2014 7:41 pm
Location: Cologne, Germany
Contact:

### Re: LoveDebug - A whole new way of debugging your game

Sulunia wrote:So, i tried to use this nice script in my game. However...

For some odd reason, luafft now returns me an error, bragging about some debugging function not existing, when in fact it does.

With that error, the game splashcreen just stalls. I can hover at the button, but clicking it does nothing.

Actually, looking at the source code of both lovedebug and luafft i found the problem...

You guys use a variable named "msg" whilst luafft uses it as a "function"

What should i do? I really didn't plan on messing around with the source code of none of the external libs i used. I don't even know if i'm allowed to do so.
you are. thats what licenses are for.

s-ol.nu /blog  -  p.s-ol.be /st8.lua  -  g.s-ol.be /gtglg /curcur

Code: Select all

print( type(love) )
if false then
baby:hurt(me)
end

Sulunia
Party member
Posts: 202
Joined: Tue Mar 22, 2016 1:10 pm
Location: SRS, Brazil

### Re: LoveDebug - A whole new way of debugging your game

Allright, managed to get everything working. Using this in addiction to some debug helper stuff i made really looks neat now. Awesome!
Don't check my github! It contains thousands of lines of spaghetti code in many different languages cool software!
https://github.com/Sulunia

pgimeno
Party member
Posts: 2340
Joined: Sun Oct 18, 2015 2:58 pm

### Re: LoveDebug - A whole new way of debugging your game

Actually, that's a great example of what kind of problems arise when you don't define your variables and functions as local.

Looking at the code, it looks like an oversight in this case. Using strict.lua or static analysis can catch these problems.

beuz
Prole
Posts: 3
Joined: Thu Apr 28, 2016 2:17 am

### Re: LoveDebug - A whole new way of debugging your game

Hi. Awesome work on this, it's really great!
Tho... I'm having a problem with the background color on my game. no matter what I set it to be, it gets replaced by 0,0,0 by LoveDebug. How can I change this?

Ranguna259
Party member
Posts: 911
Joined: Tue Jun 18, 2013 10:58 pm
Location: I'm right next to you

### Re: LoveDebug - A whole new way of debugging your game

I'll try to fix this once I get home, it should be an easy fix.

There was a line in love.run that cleared the background color to the current background color in 0.9.2 but this was changed to clear to transparent black (0, 0, 0, 0) if no arguments are provided in LÖVE 0.10.0.
LoveDebug- A library that will help you debug your game with an on-screen fully interactive lua console, you can even do code hotswapping

beuz
Prole
Posts: 3
Joined: Thu Apr 28, 2016 2:17 am

### Re: LoveDebug - A whole new way of debugging your game

Hey, thank you for answering, that was fast!
So, the background color isn't changing now.
I'm not sure if I'm doing anything wrong but the overlay isn't being drawn anymore.
EDIT:
Nevermind, I got it, just needed to uncomment line 806/807. Thanks again!

Ranguna259
Party member
Posts: 911
Joined: Tue Jun 18, 2013 10:58 pm
Location: I'm right next to you

### Re: LoveDebug - A whole new way of debugging your game

Nice work fixing it, the next update will be in your name.
I'll update it in a few hours, you can make a pull request to the repo if you want
LoveDebug- A library that will help you debug your game with an on-screen fully interactive lua console, you can even do code hotswapping

Zireael
Party member
Posts: 139
Joined: Fri Sep 02, 2016 10:52 am

### Re: LoveDebug - A whole new way of debugging your game

Was the comment thing fixed or do I need to do it if I just downloaded the latest unofficial version?

Ranguna259
Party member
Posts: 911
Joined: Tue Jun 18, 2013 10:58 pm
Location: I'm right next to you

### Re: LoveDebug - A whole new way of debugging your game

Zireael wrote:Was the comment thing fixed or do I need to do it if I just downloaded the latest unofficial version?
The commented lines were uncommented on the latest unofficial version, 1.4.4 by beuz, just download it from the first page or from github.
LoveDebug- A library that will help you debug your game with an on-screen fully interactive lua console, you can even do code hotswapping