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

3.2.3 mono/c# - [Tool] script - othernode.Call(otherMethodName) doesn't work/fails silently #43282

Closed
Flavelius opened this issue Nov 2, 2020 · 6 comments

Comments

@Flavelius
Copy link
Contributor

Flavelius commented Nov 2, 2020

Godot version:

3.2.3.stable.mono.official

OS/device including version:

Win10

Issue description:

In a [Tool] script:
Doing a node.Call on methods of other nodes just does nothing where checking node.HasMethod does return true.
Doing CallDeferred prints an error about the method not existing.

Expected: (node is MyClass) check foremost should work, but doesn't, so node.Call seems like a fallback workaround, as node.HasMethod correctly returns true; doesn't work, but should.

Steps to reproduce:
Add a [Tool] script to a node, add a non-tool script with some method to another node. From the first (tool) script try to check if the second, other node is of the required script type. This returns false as the editor doesn't recognize the custom script. Then do a othernode.HasMethod call with some method of the other node as argument. This returns true.
Then do a othernode.Call() with the method name as argument. This fails silently.

@daKuleMune
Copy link

This is likely because of an issue I had reported. Your C# node doesn't have a script. #41310. I worked around it, but it was quite painful.

@Flavelius
Copy link
Contributor Author

In my case i was trying to call a pre-existing node, one that i had created normally and assigned the script by hand. The script to be called (on the other node) also was created manually (and is a non-toolscript). But maybe it's still a similar problem.

@raulsntos
Copy link
Member

Please upload a minimal reproduction project to make this easier to troubleshoot. May be a duplicate of #59830.

Also, about the node is MyClass check. This doesn't work in Tool scripts unless MyClass is also declared as a Tool script. This is because the editor can't instantiate non-Tool scripts.

@Flavelius
Copy link
Contributor Author

I can try to create a MRP later, but that likely won't add any value, as it sounds pretty much like the other linked issues, yes.

@raulsntos
Copy link
Member

Since the linked issues have been fixed and you didn't provide an MRP, is it OK to close this as a duplicate or can you still reproduce this in Godot 4.2-dev3?

@Flavelius
Copy link
Contributor Author

I cannot test it, i don't have/use Godot currently. But those issues sounded like this could be marked as duplicate.

@raulsntos raulsntos closed this as not planned Won't fix, can't repro, duplicate, stale Aug 13, 2023
@raulsntos raulsntos added archived and removed bug labels Aug 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants