Open kunrii opened 2 years ago
Hmm, I've never used effil, but we can look at the error message to get some info.
Error loading script metadata: Thr
the error is happening when running your script and Thr
is the error message, which is weird, since it's the string you're passing to the created thread. If you change the text, does the error message change to the same thing?[string "res://Nodeee.lua"]:14: in main chunk
: the error occurs on the "main chunk" of the script, so it's outside of any functions when the error occurs. Error is in line 14, which exactly is line 14 there?So, somehow it seems the string Thr
is involved in the error, so the call to the thread must be happening. Maybe it is erroring right there, but maybe it's the wait
, whichever line is 14 might be the culprit.
The effil.dll file is located inside the res:// folder.
If effil = require("effil")
didn't error, your setup should be fine and the problem is probably somewhere else.
As a side note, be careful when using effil with Godot related stuff.
Since effil creates a brand new Lua state per thread, these new states will probably not have defined global stuff like the GD
table and types like Vector2
, Array
, etc. This could be dealt with by making a way to require
Godot definitions, the functionality used to open the plugin's lua_State
can be reused to open new states as well, but it is not possible right now.
Also, effil says here that:
Userdata and Lua threads (coroutines) are not supported.
All Godot objects are LuaJIT's C data, so I don't know how effil deals with them. Maybe it will be able to pass such data to threads, maybe it will not.
I think it's not effil, since I can run the same script with my version of luajit just fine. I tried both Godot 64 bit windows and 32 bit windows with both versions of the effil library and it fails to run with the same error, error "loading script metadata" on the call to the thread method.
I have a simple script in lua:
Which produces the following error:
The effil.dll file is located inside the res:// folder. Do you mind taking a guess at what the problem could be?
Edit: wrong error