Page 1 of 1

love.filesystem Loading .love files??

Posted: Sun Sep 08, 2013 2:02 pm
by Punkroku
I am thinking of making an arcade that will love love files... I just want to know if there is a way to load .love files or will I have to unzip them first and then load the lua file... Also is there a limit on how big the .lua can be?

Would the best way to do this, be creating a separate thread for the loaded game? I would also like to use love. love.graphics.newScreenshot to allow users to save pics of the game...

I like the way the example loader works... but that was for .lua file and they are name eXXXX.lua where XXXX is a number. I would like to be able to spawn new .love games and keep their conf file intact even though that is changeing with 0.9.0

My goal is to have the end result a lot like Mario 64 where you can walk around a 3D or 2.5D world and jump into games.

PS. I had another question but I dont want to make another post for it... Can I or should I put love.timer.sleep(1) in the love.focus callback or is that unnecessary? What would be a good amount of time to sleep if the window is not active?

Re: love.filesystem Loading .love files??

Posted: Sun Sep 08, 2013 6:04 pm
by raidho36
There is no limits on .lua or at least they're so huge that you can't possibly reach them within modern hardware.
My goal is to have the end result a lot like Mario 64 where you can walk around a 3D or 2.5D world and jump into games.
I don't think that what you suggest is really possible. Not within standard LÖVE version, you'd have to rewrite sources. Besides, the program you mentioned doesn't itself loads anything, it just calls the OS to run another executable. At least that's how you do it with PC and modern consoles. But really though, it simply changes the gamestate from "menu" to "subgame" and back, and the whole thing is a single contiguous program.
What would be a good amount of time to sleep if the window is not active?
Just the same amount as normal - 0.001. If you use that to avoid loading the processor for nothing, then just don't do anything while the game window is inactive. Better yet, just put it to pause.

Re: love.filesystem Loading .love files??

Posted: Thu Sep 12, 2013 5:34 am
by LoveHurts
What is the call to physfs that love utilizes to unzip the love file in the first place? I there a way I can unzip the contents to a tmp dir then load the file(s)?