Running a .love file inside of another .love file

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
Le_juiceBOX
Citizen
Posts: 71
Joined: Sat Mar 26, 2016 3:07 pm

Running a .love file inside of another .love file

Post by Le_juiceBOX »

Hi! Thanks for looking into my problem!

I have a love file inside of another love file (for 2 windows)

How do i run that love file? I have looked at the wiki for love.filesystem.load() but i wasnt sure on how exactly to use it.

Thanks for helping! :awesome:
SteamLibrary-like Program For Love2D Games:
take me to the forum thread!
User avatar
zorg
Party member
Posts: 3444
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: Running a .love file inside of another .love file

Post by zorg »

You can't do that.

Elaboration: You can have two separate projects, and run them at the same time, that would communicate through messages or whatever, but wanting one project to have two windows is not possible.

That said, you could unpack the inner .love file (or just name it a zip or something) into your outer project's save directory, then execute that in some way, that i don't know about.
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
alloyed
Citizen
Posts: 80
Joined: Thu May 28, 2015 8:45 pm
Contact:

Re: Running a .love file inside of another .love file

Post by alloyed »

Or, you could have one project that does two things, so for example:

Code: Select all

function love.load()
    for _, a in ipairs(arg) do
        if a == "--program1" then
            require "program1.main"
        elseif a == "--program2" then
            require "program2.main"
        end
    end
end
and then to run both you'd just have a script that runs "love . --program1" and "love . --program2" simultaneously.
User avatar
zorg
Party member
Posts: 3444
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: Running a .love file inside of another .love file

Post by zorg »

Yep, alloyed's solution seems the cleanest, i'd use that. :3
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
User avatar
Le_juiceBOX
Citizen
Posts: 71
Joined: Sat Mar 26, 2016 3:07 pm

Re: Running a .love file inside of another .love file

Post by Le_juiceBOX »

zorg wrote:Yep, alloyed's solution seems the cleanest, i'd use that. :3
thanks! :neko:
SteamLibrary-like Program For Love2D Games:
take me to the forum thread!
User avatar
s-ol
Party member
Posts: 1077
Joined: Mon Sep 15, 2014 7:41 pm
Location: Cologne, Germany
Contact:

Re: Running a .love file inside of another .love file

Post by s-ol »

zorg wrote:You can't do that.
does this not still work? https://github.com/adonaac/blog/issues/6

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
User avatar
zorg
Party member
Posts: 3444
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: Running a .love file inside of another .love file

Post by zorg »

s-ol wrote:
zorg wrote:You can't do that.
does this not still work? https://github.com/adonaac/blog/issues/6
Keep reading that, and you'll find that adnzzzz... mentions that
1. The updater is a separate project, and
2. The actual game is contained in a file inside the updater's save directory. :3
(3. lfs.mount iirc can't mount anything from within the .love file itself)

I was referencing the fact that you can't execute one love file from within another; i did suggest other solutions that should work.
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
User avatar
s-ol
Party member
Posts: 1077
Joined: Mon Sep 15, 2014 7:41 pm
Location: Cologne, Germany
Contact:

Re: Running a .love file inside of another .love file

Post by s-ol »

zorg wrote:
s-ol wrote:
zorg wrote:You can't do that.
does this not still work? https://github.com/adonaac/blog/issues/6
Keep reading that, and you'll find that adnzzzz... mentions that
1. The updater is a separate project, and
2. The actual game is contained in a file inside the updater's save directory. :3
(3. lfs.mount iirc can't mount anything from within the .love file itself)

I was referencing the fact that you can't execute one love file from within another; i did suggest other solutions that should work.
oops, I totally missed the 'inside' in the OP.

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
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 74 guests