gilzoide / godot-lua-pluginscript

Godot PluginScript for the Lua language, currently based on LuaJIT's FFI
https://gilzoide.github.io/godot-lua-pluginscript/topics/README.md.html
MIT License
300 stars 21 forks source link

load plugin first time has some errors. #35

Open codewdy opened 1 year ago

codewdy commented 1 year ago
    a new bug, but not very confusing.
  1. create a project
  2. close godot
  3. copy the addons
  4. open the project
  5. now the plugin is not enable in the setting,
  6. click the Enable and some error log is emitted.
  7. close the godot and reopen
  8. now you can click Enable correctly, and lua plugin works well.

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

Originally posted by @codewdy in https://github.com/gilzoide/godot-lua-pluginscript/issues/31#issuecomment-1370733400

gemiware commented 1 year ago

Have a different error when trying to enable the plugin. Also on windows 11 and using latest godot: v4.0.stable.official [92bee43ad]

--- Debug adapter server started ---
--- GDScript language server started ---
res://addons/godot-lua-pluginscript/plugin/plugin.gd:23 - Parse Error: Unexpected "Identifier" in class body.
Transient parent has another exclusive child.

So it does not recognize the word tool...

after refactoring it to @tool it is recognized and I get the same error as abovementioned. However it seems the plugin is not yet supported in Godot4 as it does not have GDNative anymore...

gilzoide commented 1 year ago

Hi @gemiware. That's right, this plugin is Godot 3.X only, since it relies on GDNative + PluginScript. It's gonna take almost a full rewrite to support Godot 4 + GDExtension, so it will most likely live as a separate project.

If you want to use Lua in Godot 4.X right now, WeaselGames/godot_luaAPI already has some support for that. It is not a "Lua as a scripting language that you can attach directly to Nodes" like Lua PluginScript is, but may be enough depending on your use case.