Skip to content
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

[GDExtension] Can't extend gd extension class #615

Closed
BastiaanOlij opened this issue Sep 21, 2021 · 4 comments
Closed

[GDExtension] Can't extend gd extension class #615

BastiaanOlij opened this issue Sep 21, 2021 · 4 comments
Labels
archived bug This has been identified as a bug topic:gdextension This relates to the new Godot 4 extension implementation
Milestone

Comments

@BastiaanOlij
Copy link
Collaborator

This wasn't possible before in GD native but I was under the impression that GD extensions would allow this, it's been a long requested feature to extend these classes with GDScript

image

@BastiaanOlij BastiaanOlij added bug This has been identified as a bug topic:gdextension This relates to the new Godot 4 extension implementation labels Sep 21, 2021
@BastiaanOlij BastiaanOlij added this to the 4.0 milestone Sep 21, 2021
@ellenhp
Copy link

ellenhp commented Sep 21, 2021

Wouldn't the node that this script is attached to have to be of the Example type? It looks like you're attaching it to a control. I might be misunderstanding though.

@BastiaanOlij
Copy link
Collaborator Author

@ellenhp I'm attaching it to the Example node:
image

I have a feeling this may be caused by the issue Fales mentioned around the class not being recognised correctly. I also have a feeling this may be the exact same reason why the properties don't show in the inspector because the inspector also thinks this is Control (which is the superclass of Example).

@BastiaanOlij
Copy link
Collaborator Author

Ok after more investigation it looks like @ellenhp was on the right track afterall.

The moment I assign my script to this node, behind the scenes, it changes my node back to being of type Control:

[node name="Example" type="Control" parent="."]
script = ExtResource( "2_6hifa" )
__meta__ = {
"_edit_use_anchors_": false
}

And it's pretty consistent in changing it every time I try to change it back...

@dsnopek
Copy link
Collaborator

dsnopek commented Jan 6, 2024

This issue is out-dated. It is currently possible to attach a script to a node defined in GDExtension. There is some weirdness around virtual methods, but there's dedicated issues for that, for example: #1199 and #1022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
archived bug This has been identified as a bug topic:gdextension This relates to the new Godot 4 extension implementation
Projects
None yet
Development

No branches or pull requests

5 participants