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.
Lume & Lurker : Utility functions and auto-hotswapping
- Puzzlem00n
- Party member
- Posts: 171
- Joined: Fri Apr 06, 2012 8:49 pm
- Contact:
Re: Lume & Lurker : Utility functions and auto-hotswapping
I LÖVE, therefore I am.
Re: Lume & Lurker : Utility functions and auto-hotswapping
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
Re: Lume & Lurker : Utility functions and auto-hotswapping
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.Puzzlem00n wrote:Now, the question is whether I use this or this, or some combination of the two.
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:...maybe rxi will add a console to his library at some point
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.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!
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.
- Puzzlem00n
- Party member
- Posts: 171
- Joined: Fri Apr 06, 2012 8:49 pm
- Contact:
Re: Lume & Lurker : Utility functions and auto-hotswapping
I guess neither of you read that LoveDebug has hotswapping too. It is kinda buried in the features list...rxi wrote: I believe lurker and lovedebug provide completely different functionality,
I LÖVE, therefore I am.
Re: Lume & Lurker : Utility functions and auto-hotswapping
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.
Re: Lume & Lurker : Utility functions and auto-hotswapping
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 .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.
- Attachments
-
- lurker.lua
- (5.2 KiB) Downloaded 108 times
Re: Lume & Lurker : Utility functions and auto-hotswapping
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.
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.
- Puzzlem00n
- Party member
- Posts: 171
- Joined: Fri Apr 06, 2012 8:49 pm
- Contact:
Re: Lume & Lurker : Utility functions and auto-hotswapping
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).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.
I LÖVE, therefore I am.
Re: Lume & Lurker : Utility functions and auto-hotswapping
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.
Re: Lume & Lurker : Utility functions and auto-hotswapping
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: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.
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
Who is online
Users browsing this forum: Bing [Bot] and 1 guest