love.filesystem Loading .love files??

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
Punkroku
Prole
Posts: 19
Joined: Sun Sep 01, 2013 10:04 am

love.filesystem Loading .love files??

Post by Punkroku » Sun Sep 08, 2013 2:02 pm

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?

User avatar
raidho36
Party member
Posts: 2001
Joined: Mon Jun 17, 2013 12:00 pm

Re: love.filesystem Loading .love files??

Post by raidho36 » Sun Sep 08, 2013 6:04 pm

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.

User avatar
LoveHurts
Prole
Posts: 7
Joined: Mon Sep 09, 2013 5:02 pm

Re: love.filesystem Loading .love files??

Post by LoveHurts » Thu Sep 12, 2013 5:34 am

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)?

Post Reply

Who is online

Users browsing this forum: No registered users and 10 guests