Skip to content

C# - Can't get method on CallableCustom "Delegate::Invoke". #60

@ryan-linehan

Description

@ryan-linehan

Issue: When registering a named bound anonymous function like referenced below godot will throw an error:

E 0:00:00:729 util.gd:34 @ get_method_info(): Can't get method on CallableCustom "Delegate::Invoke".
<C++ Error> Method/function failed. Returning: StringName()
<C++ Source> core/variant/callable.cpp:454 @ get_method()
util.gd:34 @ get_method_info()
limbo_console.gd:978 @ _validate_callable()
limbo_console.gd:284 @ register_command()

which links to here on the godot repo: https://github.com/godotengine/godot/blob/49a5bc7b616bd04689a2c89e89bda41f50241464/core/variant/callable.cpp#L454

I researched any work-arounds I could find:

Luckily functionally the plug-in works as expected still its just an annoyance for errors when registering and running commands

Unfortunately after reviewing the bug in depth more it seems to be related to:

godotengine/godot#90430

The closest I can get to getting the callables name without the error throwing is by using the following:

Image

which was registered as such:

func _ready() -> void:
	LimboConsole.register_command(multiply.bind(52).bind(3), "m4")

func multiply(a: float, b: float) -> void:
	LimboConsole.info("a * b: " + str(a * b))

I'm not certain we want to code for this explicitly and maybe just wait for the godot issue linked above to be fixed. Perhaps we should open a separate issue to track this?

Originally posted by @RcubDev in #59

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions