GDScript Installation fails with Class "CustomTypes" hides a global script class
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:
- 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
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.
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.
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.
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.
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!
Should be now fixed with release 1.6.8 / 2.0.0
Unfortunately it looks like the issue is still there :
I'm using Godot v4.3 stable and updated YATI to v2.0.1.
I tried deactivating/reactivating the plugin, but to no avail.
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?
I tried both successively, letting Godot reimport all the assets each time, but the issue persists. :/
I think I found the issue: commit acf3c7fc10379b2feb4a4a80fc9d8a1e9a631123 reintroduced the preload that was fixed in 49b72b02444b3a41dd25da79bb700c1a8a64eb1c.
Damn it! You're using the runtime right? And there I forgot to remove the preload.
Yep, I'm using it to load chunks of the world dynamically (#41) :)
Anyway, it's all solved now, thanks for your help!
Sorry about that! I'll fix it of course but think it's overkill to put out an extra release about it.