Closed codewdy closed 1 year ago
Hmm, I've tried it here, both using the version in Asset Library and downloading the newest build, but none failed.
src/language_gdnative.c:301 - Error in validate: attempt to call a nil value stack traceback: [C]: at 0x7ff98d127030
By the looks of it, the problem seems to be loading plugin/in_editor_callbacks/init.lua, which is the file that contains the editor specific callbacks, including validate
.
Using require
in src/register_in_editor_callbacks.lua might be the issue, since it depends on package.path
.
I'll change it to load the file directly instead of relying on require
.
Say, how is the Package Path configuration in your project?
maybe the plugin is not loaded at all, so the settings is not enable.
I found the plugin is not enable in the settings, so I click here and get some error.
some errors when I click "Enable".
--- Debugging process started ---
Godot Engine v3.5.1.stable.official.6fed1ffa3 - https://godotengine.org
OpenGL ES 3.0 Renderer: NVIDIA GeForce RTX 3060 Laptop GPU/PCIe/SSE2
Async. shader compilation: OFF
Unicode error: invalid skip
--- Debugging process stopped ---
src/language_gdnative.c:184 - Error in script_init: attempt to call a nil value
stack traceback:
[C]: at 0x7ff994147030
src/language_gdnative.c:184 - Error in script_init: attempt to call a nil value
stack traceback:
[C]: at 0x7ff994147030
res://addons/godot-lua-pluginscript/plugin/plugin.gd:33 - Invalid call. Nonexistent function 'new' in base 'PluginScript'.
src/language_gdnative.c:184 - Error in script_init: attempt to call a nil value
stack traceback:
[C]: at 0x7ff994147030
src/language_gdnative.c:184 - Error in script_init: attempt to call a nil value
stack traceback:
[C]: at 0x7ff994147030
res://addons/godot-lua-pluginscript/plugin/plugin.gd:33 - Invalid call. Nonexistent function 'new' in base 'PluginScript'.
I tried add code in the head of the file, but no file created.
"PROJECT_ROOT\addons\godot-lua-pluginscript\plugin\in_editor_callbacks\init.lua"
file = io.open ("C:\Users\xxx\Downloads\a" , "w")
file:write("--test")
file:close()
Ok, it seems the GDNative library is being loaded, or else you wouldn't be seeing these [C]: *
stacktraces.
Lua initialization must have some error, since all PluginScript callbacks are nil
, hence the message attempt to call a nil value
.
I have a machine with Windows 10 here and will test to see what is going on, probably something is off with the new build. Thanks for the new information! I'll let you know if I find anything.
Hey, so I'm testing here and I found the problem.
It seems MinGW is not exporting symbols marked with extern
, I don't know why it stopped working.
LuaJIT accesses some global variables via FFI, so they need to be exported in the DLL. Adding -Wl,--export-all-symbols
seems to fix this, but I might change the initialization script to receive these variables directly instead of relying on exported symbols to avoid more trouble.
@codewdy #34 should fix the problem. Can you please test the "lua_pluginscript" artifact from https://github.com/gilzoide/godot-lua-pluginscript/actions/runs/3834391408 and confirm if the new version works for you?
a new bug, but not very confusing.
I use windows 11.
first click "Enable" error log:
Godot Engine v3.5.1.stable.official (c) 2007-2022 Juan Linietsky, Ariel Manzur & Godot Contributors.
--- GDScript language server started ---
No loader found for resource: res://addons/godot-lua-pluginscript/plugin/lua_repl.lua.
No loader found for resource: res://addons/godot-lua-pluginscript/plugin/lua_repl.lua.
scene/resources/resource_format_text.cpp:157 - Couldn't load external resource: res://addons/godot-lua-pluginscript/plugin/lua_repl.lua
No loader found for resource: res://addons/godot-lua-pluginscript/plugin/export_plugin.lua.
res://addons/godot-lua-pluginscript/plugin/plugin.gd:33 - Parse Error: Can't preload resource at path: res://addons/godot-lua-pluginscript/plugin/export_plugin.lua
core/project_settings.cpp:239 - Property not found: editor_plugins/enabled
Ok, thanks for the info. Since it is a different problem, can you please open a new issue for it? I'm closing this one, since the fix is working and the PluginScript is loaded correctly in Windows.
I create an empty godot project, and unzip addons to the project. reopen the project and press F5(Run). I think there is some lua error.
v0.5.0 lua_pluginscript.zip md5sum:47c9324b9f15aa2f4009914d7c247e1d
I revert lua plugin to v0.4.0 and all things work well.