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

Error Calling Method From Signal -- Method Not Found #46306

Closed
TheOriginalBytePlayer opened this issue Feb 22, 2021 · 3 comments
Closed

Error Calling Method From Signal -- Method Not Found #46306

TheOriginalBytePlayer opened this issue Feb 22, 2021 · 3 comments

Comments

@TheOriginalBytePlayer
Copy link

TheOriginalBytePlayer commented Feb 22, 2021

3.2.3 stable:

Windows IDE

Whenever I open a specific scene, it gives me the following erroneous error:

Godot Engine v3.2.3.stable.official (c) 2007-2020 Juan Linietsky, Ariel Manzur & Godot Contributors.
--- GDScript language server started ---
Switch Scene Tab
core/object.cpp:1260 - Error calling method from signal 'frame_changed': 'Control(Book_Spine.gd)::_on_pause_play_button_frame_changed': Method not found..

This is erroneous as the method IS Found, shows the little green connected icon in the IDE and I can jump directly to it, not to mention that it works in the project running project.

The key element as to why this is happening seems to be:

  1. The sprite whose frame_changed method is not being bound has its own script BUT the frame_change is being called in the owning Scene's Script

  2. The sprite's script has some code in the _ready function enforces that it start at Frame Zero

Steps to reproduce:

Open the attached project and open Book_Spine.tscn You'll see the error in the output window

Minimal reproduction project:

Error Calling method from signal.zip

@Xrayez
Copy link
Contributor

Xrayez commented Feb 22, 2021

The Control node should also be annotated with tool keyword, otherwise the script won't work in the editor (required by signal connection).

Once I add tool keyword, it no longer produced the error as in this issue, but then there are errors which are unrelated to this issue (non-existing node).

On a side note, I've stumbled upon this myself a few times as well, so perhaps there should be more user-friendly way to show what might go wrong.

@TheOriginalBytePlayer
Copy link
Author

Hey Xrayez,

I don't want the BookSpine.gd to use a Tool Keyword as, unlike the clickablesprite.gd, this is the script for a single scene, not for the subclassing of an existing control. So while adding this does make the erroneous error go away, adding the Tool keyword makes it TOO live, auto-animations and audio start playing in the editor and it becomes a real pain to work with.

While I appreciate that this may not be a bug per se, but rather more of a design issue, I don't think a more user-friendly explanation is the best solution because clearly the IDE has all the information needed to make it function correctly.

1.The IDE "knows" the signal linkage exists because it correctly allows you to jump it from the Node's signal (right-hand IDE tree)
2. It shows the green signal connected icon in the IDE next to the function when you're looking at the script
3. It correctly uses the signal method when running the program.

In other words, it works perfectly and giving me an error message saying that it can't find solely at the moment its loading the page within the ID when it can find it in every other instance is not useful. The best solution would to to make the IDE smarter so it knows what it knows (as it were), though failing that, I suppose it would be an improvement if the error was changed from an error to a warning: "Frame_Change signal for Object XXX will not function in IDE without Tool keyword being added to script XXX" then it would give me some useful information, but to display it as an error is just worrisome and incorrect.

@Calinou
Copy link
Member

Calinou commented Feb 28, 2021

Duplicate of #36592.

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

3 participants