Making a custom build of LÖVE that can be run on CLI?
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
-
- Prole
- Posts: 19
- Joined: Fri Dec 11, 2015 7:01 pm
Making a custom build of LÖVE that can be run on CLI?
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
- zorg
- Party member
- Posts: 3470
- 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?
You don't need to make a different build.
Wiki article: Config_Files
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.
Wiki article: Config_Files
Code: Select all
t.console = true
t.window = false
t.modules.window = false
t.modules.graphics = false
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 True 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.
-
- 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?
Damn, I feel dumb now 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.
- zorg
- Party member
- Posts: 3470
- 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?
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.Substance12 wrote: ↑Wed Dec 20, 2017 3:35 pm Damn, I feel dumb now 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.
Me and my stuff True 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.
Re: Making a custom build of LÖVE that can be run on CLI?
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
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
Who is online
Users browsing this forum: Google [Bot], Semrush [Bot] and 5 guests