YATI icon indicating copy to clipboard operation
YATI copied to clipboard

GDScript Installation fails with Class "CustomTypes" hides a global script class

Open Nebelun opened this issue 1 year ago • 5 comments

Describe the bug Following the instructions on installation from the readme, I downloaded v1.6.7-gdscript.zip and extracted the addons folder to the root of my projects. ./assets/YATI However attempting to enable the plugin is met with:

res://addons/YATI/CustomTypes.gd:24 - Parse Error: Class "CustomTypes" hides a global script class.
  res://addons/YATI/Importer.gd:-1 - Compile Error: 
  res://addons/YATI/TiledImport.gd:-1 - Compile Error: 
  modules/gdscript/gdscript.cpp:2788 - Failed to load script "res://addons/YATI/TiledImport.gd" with error "Compilation failed". (U

To Reproduce Steps to reproduce the behavior:

  1. In a new godot project install the YATI Addon

Expected behavior Plugin to enable correctly

Desktop (please complete the following information):

  • OS: Windows 10
  • Version: GDScript 1.6.7
  • Godot Version 4.2.1

Nebelun avatar May 03 '24 01:05 Nebelun

Occasionally I also had this and after some disabling and re-enabling of the plugin the problem disappeared. Don't know why that happens and unfortunately I have no clearer recipe against it. Hope you get it sorted.

Kiamo2 avatar May 03 '24 10:05 Kiamo2

Looks like preload seems to cause a global namespace issue. I put in a pr that has fixed it in my project. Would love it you take a look.

Nebelun avatar May 03 '24 13:05 Nebelun

What happens if you now (after it once worked in the project) change that back to 'preload'? Does it continue to work or is it starting to fail again? I'm a little hesitant to change something that works for 99.9% of all users.

Kiamo2 avatar May 04 '24 12:05 Kiamo2

After changing it back the error comes back and refuses to load the script again. I totally get the hesitation for it and don't mind if the pr is earmarked or rejected. Just wanted to share the fix that I found.

Nebelun avatar May 04 '24 13:05 Nebelun

Ok, if the error occurs again, it really is a nuisance. I'll test that and eventually include it in a future release with adaptions for 4.3. Thank you very much for your valuable hints and pr!

Kiamo2 avatar May 04 '24 14:05 Kiamo2

Should be now fixed with release 1.6.8 / 2.0.0

Kiamo2 avatar Aug 19 '24 14:08 Kiamo2

Unfortunately it looks like the issue is still there :

Screenshot of the error

I'm using Godot v4.3 stable and updated YATI to v2.0.1.

I tried deactivating/reactivating the plugin, but to no avail.

Lertsenem avatar Sep 11 '24 07:09 Lertsenem

But the preload option is removed, I've double-checked that. Really strange that what helped in the past no longer works. And I still cannot reproduce it. Is there anything corrupted cached? Maybe try to remove the .godot/imported folder or even the .godot folder?

Kiamo2 avatar Sep 11 '24 09:09 Kiamo2

I tried both successively, letting Godot reimport all the assets each time, but the issue persists. :/

Lertsenem avatar Sep 11 '24 10:09 Lertsenem

I think I found the issue: commit acf3c7fc10379b2feb4a4a80fc9d8a1e9a631123 reintroduced the preload that was fixed in 49b72b02444b3a41dd25da79bb700c1a8a64eb1c.

Lertsenem avatar Sep 11 '24 10:09 Lertsenem

Damn it! You're using the runtime right? And there I forgot to remove the preload.

Kiamo2 avatar Sep 11 '24 10:09 Kiamo2

Yep, I'm using it to load chunks of the world dynamically (#41) :)

Anyway, it's all solved now, thanks for your help!

Lertsenem avatar Sep 11 '24 10:09 Lertsenem

Sorry about that! I'll fix it of course but think it's overkill to put out an extra release about it.

Kiamo2 avatar Sep 11 '24 10:09 Kiamo2