I read somewhere that it was possible although I need to make my own build.
How do I do that? Will it be stable?
How can I use Lua 5.2 for LOVE
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: How can I use Lua 5.2 for LOVE
You don't need to change source of Love2d to change Lua version. Lua is separated like other dependeces.
Follow build guide, but use lua headers and source files from 5.2 package.
Get ready for building conflicts, I don't know is Love2d source code is compatible with Lua 5.2
Follow build guide, but use lua headers and source files from 5.2 package.
Get ready for building conflicts, I don't know is Love2d source code is compatible with Lua 5.2
Last edited by AnRu on Wed Aug 17, 2016 4:58 pm, edited 1 time in total.
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: How can I use Lua 5.2 for LOVE
It's not tested regularly, but the LÖVE source should be compatible with lua 5.1, 5.2 and 5.3. Since we usually only test with 5.1 though, it's possible it no longer builds out-of-the-box, but I would consider that a bug.
EDIT: By the way, if you're compiling using autotools, give the --with-luaversion flag of configure a shot.
EDIT: By the way, if you're compiling using autotools, give the --with-luaversion flag of configure a shot.
- slime
- Solid Snayke
- Posts: 3132
- Joined: Mon Aug 23, 2010 6:45 am
- Location: Nova Scotia, Canada
- Contact:
Re: How can I use Lua 5.2 for LOVE
It's worth mentioning that LuaJIT (which LOVE uses by default) supports a few Lua 5.2 features out-of-the-box: http://luajit.org/extensions.html#lua52
Re: How can I use Lua 5.2 for LOVE
If you're looking for the _ENV feature from lua 5.2, bear in mind that its behavior is very similar to setfenv, which is still available in lua 5.1 (ignoring the scope/function distinctions). You can use the following code snippit at the top of a module to give you the effect you're looking for:
Though the advice of "don't use it unless you need to" is pinned with it.
Code: Select all
local _ENV = setmetatable({}, { __index = _ENV or _G })
if setfenv then setfenv(1, _ENV) end
Re: How can I use Lua 5.2 for LOVE
One way I've been using to run LÖVE with any Lua interpreter without recompiling anything, is to create a Lua file with this content:
and run it with whatever interpreter you want to use, instead of running love. Unfortunately, for some reason it segfaults for me with Lua 5.2, though it works fine with 5.1 and LuaJIT.
Code: Select all
package.preload.love = package.loadlib('/path/liblove.so.0', 'luaopen_love')
require('boot')()
- Positive07
- Party member
- Posts: 1014
- Joined: Sun Aug 12, 2012 4:34 pm
- Location: Argentina
Re: How can I use Lua 5.2 for LOVE
liblove or love.dll is dinamically linked to a dll called lua51.dll or liblua51.so, so it can't find that when using Lua 5.2 (or 5.3)
Why do you want to use 5.2 instead of 5.1? Are you aware that you will have to distribute your custom LÖVE version whenever you want to pass the game to someone else? Are you aware that binary module like the imgui one won't run without recompiling? Are you aware that LuaJIT is way faster than standard Lua?
You should have a really big motive to switch version
Why do you want to use 5.2 instead of 5.1? Are you aware that you will have to distribute your custom LÖVE version whenever you want to pass the game to someone else? Are you aware that binary module like the imgui one won't run without recompiling? Are you aware that LuaJIT is way faster than standard Lua?
You should have a really big motive to switch version
for i, person in ipairs(everybody) do
[tab]if not person.obey then person:setObey(true) end
end
love.system.openURL(github.com/pablomayobre)
[tab]if not person.obey then person:setObey(true) end
end
love.system.openURL(github.com/pablomayobre)
Re: How can I use Lua 5.2 for LOVE
There's a scripting app for iOS that uses Lua 5.2. It also comes with a draw library. I wanted to make an emulator to run my scripts on the computer, so I made one using Love. But I just realized some things like bit32 library are not included in Lua 5.1 which means some of my scripts don't work...
- slime
- Solid Snayke
- Posts: 3132
- Joined: Mon Aug 23, 2010 6:45 am
- Location: Nova Scotia, Canada
- Contact:
Re: How can I use Lua 5.2 for LOVE
LuaJIT has its own bit library: http://luajit.org/extensions.html#bit
Re: How can I use Lua 5.2 for LOVE
I just need this?
local bit = require("bit")
local bit = require("bit")
Who is online
Users browsing this forum: Google [Bot] and 138 guests