Making a custom build of LÖVE that can be run on CLI?

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
Substance12
Prole
Posts: 19
Joined: Fri Dec 11, 2015 7:01 pm

Making a custom build of LÖVE that can be run on CLI?

Post by Substance12 »

I'm developing a multiplayer game and I want to know if it's possible to build a version of LÖVE that doesn't show any window, allowing it to be run in a command line. I would need to do this to run the servers, as I'd rather not have to port all of my game to plain Lua and figure out a new way to use dt (unless there's an easier way to work around this). Is it even possible? I have some knowledge of C++ so I think I could do it myself
User avatar
zorg
Party member
Posts: 3465
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: Making a custom build of LÖVE that can be run on CLI?

Post by zorg »

You don't need to make a different build.
Wiki article: Config_Files

Code: Select all

t.console = true
t.window = false
t.modules.window = false
t.modules.graphics = false
:3

One more thing, you'll need to know that io.read blocks, so if you want to have code run simultaneously while also accepting commands from the console window, you'll need to put the console io functions into another thread.
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.
Substance12
Prole
Posts: 19
Joined: Fri Dec 11, 2015 7:01 pm

Re: Making a custom build of LÖVE that can be run on CLI?

Post by Substance12 »

Damn, I feel dumb now :o: glad to hear it's so easy though, thanks a lot! And I don't think I'll use io.read, but I'll keep that in mind.
User avatar
zorg
Party member
Posts: 3465
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: Making a custom build of LÖVE that can be run on CLI?

Post by zorg »

Substance12 wrote: Wed Dec 20, 2017 3:35 pm Damn, I feel dumb now :o: glad to hear it's so easy though, thanks a lot! And I don't think I'll use io.read, but I'll keep that in mind.
You're welcome, and just to be clear, i meant that if you want to get input from the CLI, i believe lua io's the only way, and whichever function you use, it will block the thread the function was called from. That said, if you don't plan to allow input from the console, then it's a moot point.
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
Nixola
Inner party member
Posts: 1949
Joined: Tue Dec 06, 2011 7:11 pm
Location: Italy

Re: Making a custom build of LÖVE that can be run on CLI?

Post by Nixola »

You can also use LuaSocket if you want to get input from the CLI without blocking. It's a hack at best though, and you should really use threads if you can.
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 2 guests