Lume & Lurker : Utility functions and auto-hotswapping

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
Puzzlem00n
Party member
Posts: 171
Joined: Fri Apr 06, 2012 8:49 pm
Contact:

Re: Lume & Lurker : Utility functions and auto-hotswapping

Post by Puzzlem00n »

I've literally read three separate things about hotswapping today without even trying or meaning to.

I think I'll take this as a sign.

EDIT: Now, the question is whether I use this or this, or some combination of the two.
I LÖVE, therefore I am.
User avatar
MGinshe
Prole
Posts: 31
Joined: Sun Apr 17, 2011 3:50 am
Location: New Zealand

Re: Lume & Lurker : Utility functions and auto-hotswapping

Post by MGinshe »

just be careful because there might be some conflicts between two error handlers. maybe rxi will add a console to his library at some point :)
rxi
Prole
Posts: 47
Joined: Sun Mar 02, 2014 10:22 pm

Re: Lume & Lurker : Utility functions and auto-hotswapping

Post by rxi »

Puzzlem00n wrote:Now, the question is whether I use this or this, or some combination of the two.
I believe lurker and lovedebug provide completely different functionality, I'd say give both of them a shot to see which one offers you what you want :) -- to get lurker up and running you just copy two files to your project and paste one line into the love.update() function. I have to agree with what @MGinshe said, though, if you run both of them at once you'll likely have a bad time.
MGinshe wrote:...maybe rxi will add a console to his library at some point :)
This is outside the scope of the project. Currently it serves its one purpose, it isn't trying to be a universal debugging system. If I do write some kind of console in the future it would likely be a separate (but compatible) module. Of course, this isn't to say you can't fork a version and add a console yourself, or use lurker as part of a larger debugging package you build.
MGinshe wrote:i really like the error screen. it works almost perfectly. the only way i found to break it was to introduce an error into the lurker.lua file, which i don't see being a problem in normal use. my only suggestion is to add a screen/warning for syntax errors, the console notification is nice but sometimes it's easy to miss. aside from that, this is easily my favorite lib now. thanks bro!
Thanks! What did you think of the animation on the horizontal lines? I was going for a sort of cylon feel. The thought about the error-screen-on-syntax-errors had occured to me! I was planning to add this in but I wasn't happy with how I was thinking of doing it at the time, so I figured I'd leave it and do it later -- no sense in rushing it and having to redo it. When I do add it i'll keep the option to chose between the two behaviours when a syntax error happens on a hotswap.

I also noticed the bug you mentioned when hotswapping the lurker file, and also came to the conclusion that it wouldn't be a problem for normal usage :). It was cool that it could originally hotswap itself, but I don't think it had much practical purpose.

I noticed your threaded fork and had a skim of it, it looks quite interesting. I'll definitely have to give it a proper look at some point, I'm unfamiliar with LÖVE's threading so I'll probably have to have to read up on that first.
User avatar
Puzzlem00n
Party member
Posts: 171
Joined: Fri Apr 06, 2012 8:49 pm
Contact:

Re: Lume & Lurker : Utility functions and auto-hotswapping

Post by Puzzlem00n »

rxi wrote: I believe lurker and lovedebug provide completely different functionality,
I guess neither of you read that LoveDebug has hotswapping too. It is kinda buried in the features list... :P
I LÖVE, therefore I am.
User avatar
adnzzzzZ
Party member
Posts: 305
Joined: Sun Dec 26, 2010 11:04 pm
Location: Porto Alegre, Brazil

Re: Lume & Lurker : Utility functions and auto-hotswapping

Post by adnzzzzZ »

This new version doesn't work on my project anymore. After using lurker.scan once another scan is never triggered whenever I press the key I set to scan.
rxi
Prole
Posts: 47
Joined: Sun Mar 02, 2014 10:22 pm

Re: Lume & Lurker : Utility functions and auto-hotswapping

Post by rxi »

adnzzzzZ wrote:This new version doesn't work on my project anymore. After using lurker.scan once another scan is never triggered whenever I press the key I set to scan.
Whoops. I was just about to head off to bed but I think I managed to find the bug, haven't tested this version out yet so I've not pushed it to the repo. I attached the file to this post; let me know if this fixes the problem, if it doesn't I'll take a look at it tomorrow :).
Attachments
lurker.lua
(5.2 KiB) Downloaded 107 times
User avatar
adnzzzzZ
Party member
Posts: 305
Joined: Sun Dec 26, 2010 11:04 pm
Location: Porto Alegre, Brazil

Re: Lume & Lurker : Utility functions and auto-hotswapping

Post by adnzzzzZ »

Thanks, this works now. I know this is maybe asking too much, but is there a way for you to add a call that reloads the entire project? This is super useful for testing things that happen in love.load or in objects' constructors. Usually when you're working on one type of object you always set things so that that object is the first thing you see on the screen, so the effects of reloading the entire project are usually similar as to just reloading like it works now (except it would work for things that mostly happen on constructors/initializers).

Sorry if there's already an easy way to do this but I couldn't figure it out from the calls that are on the readme.
User avatar
Puzzlem00n
Party member
Posts: 171
Joined: Fri Apr 06, 2012 8:49 pm
Contact:

Re: Lume & Lurker : Utility functions and auto-hotswapping

Post by Puzzlem00n »

adnzzzzZ wrote:I know this is maybe asking too much, but is there a way for you to add a call that reloads the entire project? This is super useful for testing things that happen in love.load or in objects' constructors.
The LoveDebug thing I linked before seems to handle this by hotswapping love.loads and constructors differently from everything else, so that whatever is changed in there is reconstructed (at least that's what it seems like).
I LÖVE, therefore I am.
User avatar
adnzzzzZ
Party member
Posts: 305
Joined: Sun Dec 26, 2010 11:04 pm
Location: Porto Alegre, Brazil

Re: Lume & Lurker : Utility functions and auto-hotswapping

Post by adnzzzzZ »

I've been using one (cupid) that does something similar (although I don't know the details, but it handles constructors pretty well), but it doesn't give me an easy way to disable watching for files like this one does, which means that on big projects it starts lagging everything pretty badly.
User avatar
MGinshe
Prole
Posts: 31
Joined: Sun Apr 17, 2011 3:50 am
Location: New Zealand

Re: Lume & Lurker : Utility functions and auto-hotswapping

Post by MGinshe »

adnzzzzZ wrote:I've been using one (cupid) that does something similar (although I don't know the details, but it handles constructors pretty well), but it doesn't give me an easy way to disable watching for files like this one does, which means that on big projects it starts lagging everything pretty badly.
i could try threading that one too, if you want :) if understood your last question correctly, you basically want to re-call love.load right after the hotswap? you might be able to do something like this:

Code: Select all

function love.load(args)
	-- make sure we don't redefine lurker
	if (lurker == nil) then
		lurker = require("lurker")
		lurker._args = args
		lurker.postswap = function() _G["love"]["load"](lurker._args) end
	end

	-- initialization
end
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests