-
Notifications
You must be signed in to change notification settings - Fork 5
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
Failed to compile when export a string field: #145
Comments
It is a base class, and it has a child class "SkillMeleeAttack". |
Is it difficult to be fixed? |
This code looks like correct. I will investigate. |
How to reproduce : type SkillBase3D* = ptr object of Node3D
skillId* {.gdexport.}: string = "PlayerMeleeAttack"
```nim
create a subclass: type SkillMeleeAttack3D* = ptr object of SkillBase3D
|
Can you zip the project and send it to us? If you don't want to publish it, please email it to me([email protected]). I promise to delete the data as soon as I finish my research. |
nim.zip cd nim
nim c --stackTrace:on --lineTrace:on .\libprj\bootstrap.nim |
Thank you very much. I will do some research. Btw this is a bit verbose, but try the following. (I just hard-coded what the gdexport pragma does internally) type SkillBase3D* = ptr object of Node3D
skillId*: string = "PlayerMeleeAttack"
timecc* : float32
status*: SkillStatus = coolingDown
detectArea3D* : Area3D
bulletCache*: Node
bullets* :Node
followingBullets*: Node3D
detectedTargets*: HashSet[MyCharBase3D.MyCharBase3D] = initHashSet[MyCharBase3D.MyCharBase3D]()
params*: SkillSetting
gdexport "skillId",
proc (self: SkillBase3D): string = self.skillId,
proc (self: SkillBase3D; value: string) = self.skillId = value |
gdexport "skillId",
proc (self: SkillBase3D): string = self.skillId,
proc (self: SkillBase3D; value: string) = self.skillId = value the hard-coded snippet works. |
I found the cause of the problem, but it will take some time to fix the root cause. It seems to be caused by a batting between the module name and the class name, so as a temporary measure, rename SkillBase3D.nim appropriately. |
There are a few fields that need to be exported, so I'll hard-code them for now; it won't have much impact. |
If you modify the module name (filename) to something other (gd***.nim is recommended) than the class name, the first snippet should work. |
I renamed SkillBase3D.nim to gdSkillBase3D.nim , It works now. |
Here is my class, I am trying to export first field "skillId"
A error was reported when building with gdext 0.4.1:
The error will not be reported if "{.gdexport.}" is removed.
The text was updated successfully, but these errors were encountered: