- Edited
Hey there,
I've written a simple plugin for godot nativescript and then wanted to use it in the engine. First I wasn't able to find it in the "add node" Dialog, then decided to go for a simple Node and attach my plugin as a script (via a .gdns file). This does work and so I proceeded.
After a while I wanted to get a simple reference to my script object and got it, but not as strict type. Due to a hint on discord I was able to create an "alias" like const MyClass = preload("res://..../*gdns)
and were now able to strict type my reference.
Some time later I was wondering how to extend my script via GDScript and here I am (since extends must be the first statement, the preload hack won't work).
I have actually no clue, what I'm doing wrong, as I'm not able to access my gdnative class properly. My .gdns file looks like that:
[gd_resource type="NativeScript" load_steps=2 format=2]
[ext_resource path="res://bin/TheGuild++_Plugin.gdnlib" type="GDNativeLibrary" id=1]
[resource]
resource_name = "ProductionNode"
class_name = "ProductionNode"
library = ExtResource( 1 )
The corresponding gdnlib looks like that:
[general]
singleton=false
load_once=false
symbol_prefix="godot_"
reloadable=true
[entry]
X11.64="res://bin/x11/TheGuild++_Plugin.so"
Windows.64="res://bin/win64/TheGuild++_Plugin.dll"
OSX.64="res://bin/osx/TheGuild++_Plugin.dylib"
[dependencies]
X11.64=[ ]
Windows.64=[ ]
OSX.64=[ ]
Thanks in advance