Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@export_category("") name Strings cause conflicts with like Class names and Autoloads #80634

Closed
Dabnabbit opened this issue Aug 14, 2023 · 2 comments
Labels

Comments

@Dabnabbit
Copy link

Dabnabbit commented Aug 14, 2023

Godot version

4.1.1 Stable

System information

Windows 11, RTX 3070TI, Vulcan

Issue description

This may or may not be a bug, but definitely needs some kind of detection or warning build into the code if it is intentional or unavoidable.

After bashing my head against a wall today trying to figure out why a single specific script would not utilize referenced autoload function/methods and trying to figure out why it was the only script that would not recognize the autoload class, I realized that I had an organizational @export_category() at the top using the same name. Apparently this means that any future references to that same string will not properly reference the class or autoload.

Example:

Having an autoload script named "Debug" with a method "draw_cube()" in it.
Then in another script having a parameter organizer like such:

@export_category("Debug")
@export_range(0.0, 1.0) var debug_polyline_pos : float = 0.0

and then later attempting

Debug.draw_cube(Vector3.ZERO, Vector3.ZERO, 2.0, Color.PURPLE)

in that same script will result the inability for the game to recognize Debug as the autoload script and will not find the .draw_cube() method.

This may be expected/intentional behavior, but if that is the case this definitely needs to be outlined and/or flagged in the script-editor as a conflict.

Also as a side note, I love the fact the export_category("Debug") specifically has a little built-in easter-egg for using the term "Debug" so if there's anyway we can keep that around or maybe even expose the ability for users to control that little icon that would be pretty amazing!

@AThousandShips
Copy link
Member

Thank you for reporting, this has been reported previously and resolved in #78254, which has not been cherry picked yet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants