Questions tagged [sol3]

7 questions
2
votes
0 answers

Why sol2 is slower than LuaBridge3?

I've done some benchmarks (lua-benchmarks). For some reason sol2 perform slower than LuaBridge3. In sol2 repo you can find benchmarks showing that sol2 have to outperform LuaBridge3 (benchmarks), but for some reason on real use cases it's not. In…
Alterise
  • 21
  • 2
0
votes
1 answer

What is the correct way to link LuaJIT with Sol2?

Using windows, visual studio 2022, vcpkg Installing sol2 in vcpgk installs lua package aswell. By my understanding installing luajit and linking within a project like this wont work: #include #include #include…
0
votes
1 answer

C++ SOL3 : Efficiently assigning a C++ stored table to a global table

In C++, I have a vector of sol::table stored: std::vector vecInstLuaTable; At some point in my code, I want to assign one of these tables to a global table called "me"…
0
votes
1 answer

Require but dont break out of sandbox environment - luajit

Is there a way to run a script in a sandbox environment to not pollute global state, but still be able to require"someluafile" in which global vars get set for said environment and NOT the global state -- main script local moduleXY =…
alf_gralf
  • 31
  • 5
0
votes
1 answer

How to detect a usertype is exist in sol3?

In C++ with sol3, My code is like this sol::state _state; void Func1() { auto userType1 = _state.new_usertype("Test", sol::constructors()); userType1["testFunction1"] = &test1; } void Func2() { auto userType2 =…
Shadow fiend
  • 753
  • 5
  • 7
0
votes
0 answers

Why does LuaJIT's jit module appear as a string when loaded through require?

I compiled a program on Linux using LuaJit 2.1 beta3.I loaded the profiler as recommended in the docs, like so: require("jit.p").start(options, output) require("jit.p").stop() However, the module failed to open, citing a version mismatch. Upon…
0
votes
1 answer

sol3: Is it possible to reset the lua state so that any coroutine function can be re-run from the beginning?

This is the overall flow of my setup: void ScriptPlayer::new_lua_state() { lua = {}; lua.open_libraries(sol::lib::base, sol::lib::package, sol::lib::coroutine, sol::lib::math); [...] // Proceeds to initialize the state with usertype…
Lake
  • 4,072
  • 26
  • 36