This site is currently in read-only mode during migration to a new platform.
You cannot post questions, answers or comments, as they would be lost during the migration otherwise.
0 votes

I was making a pvz Adventures like game, I have a class "Data" that is typed as class_name Data, here I have an enum for plans, zombies, projectiles, and a dictionary called "get" that contains preload(classes) to use Data.get[Data.enum] to get a class. To assign the kind of projectile the plant will shoot I use 'export(Data.O) var projectile' it worked. Then I made a similar thing for planning a plant, I have a tilemap, an enum T (terrains) that are interpreted on the tilemap to allow or not plant on this cell, the base class of plants have
'export(Array, Data.T) var plant in'

enter image description here
enter image description here
enter image description here

And suddenly i doesn't work, it said 'Error expected const expression' in the export, line wasen't in red, just happen on play, Then all get broken without reason, I comment that export and happen the same error on the projectile export, I commented it, and give me the error in title in line 47 where literally end my planta code ¿¿¿???

'Parser Error: The class 'Data' was found in global scope but it's couldn't be loaded'

enter image description here
enter image description here
enter image description here

I don't have any idea what had happened, all worked well and now not, the problem seems to be un Data but where or how? I can't play the project

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

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.