godot-cpp icon indicating copy to clipboard operation
godot-cpp copied to clipboard

Language binding problem

Open JustDooooIt opened this issue 1 year ago • 2 comments

Godot version

4.3.stable

godot-cpp version

4.3.stable

System information

windows 11

Issue description

After using this method, the editor cannot detach the script and modify the visibility should be related to the implementation of GDExtensionScriptInstanceInfo3 436c41cf926de932afdd4dfcaa720e9

Steps to reproduce

create instance_info and script_instance

Minimal reproduction project

test.zip

JustDooooIt avatar Sep 12 '24 02:09 JustDooooIt

Thanks!

I haven't looked too deeply, but skimming your MRP, I suspect the issue is related to not completely implementing everything required from GDExtensionScriptInstanceInfo3. In fact, I don't see where you set any of the callbacks on instance_info?

I'm a little surprised, though, that it's _instance_create() that's causing issues in the editor and not _placeholder_instance_create(), since you've hard-coded _is_tool() to false, so I wouldn't expect the editor to create a real instance, but only a placeholder.

For placeholders, in general, I'd recommend using gdextension_interface_placeholder_script_instance_create() rather than making them custom.

And you may be interested in trying out the ScriptInstanceExtension class from PR https://github.com/godotengine/godot-cpp/pull/1544. I haven't had a chance to test the latest iteration of it, but assuming it works, it should make it a little easier to make your script instances.

dsnopek avatar Sep 12 '24 14:09 dsnopek

I don't know which interfaces are related to the functions of separate scripts and modify visibility

JustDooooIt avatar Sep 13 '24 13:09 JustDooooIt

Hi @JustDooooIt, can you explain the reason behind closing this issue?

Ivorforce avatar Dec 03 '24 14:12 Ivorforce

@Ivorforce This issue has been resolved.Implementing call_func will suffice.

JustDooooIt avatar Dec 03 '24 14:12 JustDooooIt