The Godot Q&A is currently undergoing maintenance!

Your ability to ask and answer questions is temporarily disabled. You can browse existing threads in read-only mode.

We are working on bringing this community platform back to its full functionality, stay tuned for updates.

godotengine.org | Twitter

0 votes

I asked about it a long time ago, but I didn't receive any answer, in that time I went back to the last project version and continue, actually it has happened again so I will try to ask it with new information

Last question: my first question

I have a class "Data_Plantas" typed as "P" where I save the plants data in enums and constants
enter image description here
I try to export an enum of "P" in a different node, and that line is not flagged as an error, but I realize that popped up this in the console every time I write "expo"
enter image description here
When I run the game, it stops
enter image description here
enter image description here
Then I write on ready the same enum of "P"
enter image description here
It stops but gives us a different error, in the last line of the same code
enter image description here
enter image description here

It was working in that exact way, but suddenly on run, it don't, I wasn't doing any change in "P" or the export.

Godot version Godot v3.4.4
in Engine by (40 points)
edited by

Oh man where to start without writing an encyclopedia........
will try to simplify

Don't use classes like this unless its in Global Space (Like an Autoload in Godot)
If you use many enums centralize them in one file since this isn't c++
And that file must only contain enums

Okay, it's right, saving this in a global script is a better idea than using typed classes. I will move all of them.

Now "Data_Planta" is a Global script, it works in code, but not in export
enter image description here

Very strange indeed

make sure the Autoload name is what you're using
and remove any redundancies like class_name P

Yes, I am sure, you can see that the name is "P"; on the button left; is the same code and the editor flagged class_name, so I removed it. maybe it's something wrong with the file's project. if is necesarry I would re-build it in a new project, but I want to try a few things, thanks to give some help, I would never use a typed class for it again xD

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.