panno8M / godot-nim

godot 4.x bindings for nim-lang (early stage)
78 stars 5 forks source link

Unstable Nim version 1.9.3 #3

Closed aMOPel closed 11 months ago

aMOPel commented 11 months ago

In godot.nimble it specifies the Nim version to be.

requires "nim >= 1.9.3"

That is a problem because that is an unstable version of Nim that can only be reproduced by building Nim yourself at a specific commit in the repo.

It would be great if you could either upgrade your code to be compatible with Nim 2.0.0 or make it compatible with 1.6.x.

Thank you for you work!

insomniacUNDERSCORElemon commented 11 months ago

Is this a problem? 2.0.0 is >= 1.9.3 isn't it? I haven't tried it yet, but it installed just fine for me.

EDIT: Unless there is a problem with compatibility that wouldn't show up when installing, which is possible.

Though it seems to work for me...lots of warnings, but it does generate a log:

DEBUG-LIBRARY @load-Variants >>> 
 :: load destructors of all variants...
DEBUG-LIBRARY @load-Variants >>> 
 :: load constructors of all variants...
DEBUG-LIBRARY @String-load-constructor >>> 
 :: loading constructors of String...
DEBUG-LIBRARY @Rect2-load-constructor >>> 
 :: loading constructors of Rect2...
DEBUG-LIBRARY @Rect2i-load-constructor >>> 
 :: loading constructors of Rect2i...
DEBUG-LIBRARY @Transform2D-load-constructor >>> 
 :: loading constructors of Transform2D...
DEBUG-LIBRARY @Plane-load-constructor >>> 
 :: loading constructors of Plane...
DEBUG-LIBRARY @Quaternion-load-constructor >>> 
 :: loading constructors of Quaternion...

etc...

I am not seeing a print function though, which was obviously my first idea to test it.

Though other than the log (which I'm not actually sure what is calling it) I'm not seeing what I'd hope to see (add nim "script" to node, comfirmation via plugin menu or something etc) though I'm not sure if that's this project or gdextension.

panno8M commented 11 months ago

Thank you for your report. We have raised the requested Nim version to 2.0.0. And certainly did not provide an explanation of what can be done, so I have added a brief description in the README.

insomniacUNDERSCORElemon commented 11 months ago

@panno8M

ERROR: Cannot get class 'Tester'.
   at: instantiate (core/object/class_db.cpp:339)
WARNING: Node Tester of type Tester cannot be created. A placeholder will be created instead.
     at: instantiate (scene/resources/packed_scene.cpp:205)

Log still works, though.

Is anything visual supposed to happen? Or engine integration as I said in my last comment (as that was the reason we can't just use 3.X bindings)?

panno8M commented 11 months ago

For now, all that is possible is to define an object on the Nim side that inherits from the Godot class and register it in the Godot class database. This allows you to Instantiate the class defined by Nim from the Godot editor. The ability to define functions and properties on this Nim-defined object is currently under development and unavailable. In other words, you can only define and create an empty class with no functions, properties, or anything else.

As for Godot's print function, since it can be replaced by invoking Godot from the command line and calling Nim's echo, we are currently putting off its implementation.