Help with narrowing down "Get Script: Caller Thread can't call this function" error only during breakpoints

Godot Version

4.4.1

Question

Recently, I’m getting the following error messages:

E 0:08:12:929   get_script: Caller thread can't call this function in this node (/root/GameManager/PlayerParty/Kalboo). Use call_deferred() or call_thread_group() instead.
  <C++ Error>   Condition "!is_accessible_from_caller_thread()" is true. Returning: (Variant())
  <C++ Source>  scene/main/node.cpp:3989 @ get_script()

E 0:08:12:929   validate_object: Attempted to getptr an object into a TypedDictionary.Key, that does not inherit from 'GDScript'.
  <C++ Error>   Condition "other_script.is_null()" is true. Returning: false
  <C++ Source>  ./core/variant/container_type_validate.h:145 @ validate_object()

E 0:08:12:929   encode_variant: Parameter "value" is null.
  <C++ Source>  core/io/marshalls.cpp:1865 @ encode_variant()

E 0:08:12:930   encode_variant: Condition "err" is true. Returning: err
  <C++ Source>  core/io/marshalls.cpp:1895 @ encode_variant()

E 0:08:12:930   encode_variant: Condition "err" is true. Returning: err
  <C++ Source>  core/io/marshalls.cpp:1895 @ encode_variant()

E 0:08:12:930   _write_out: Condition "err != OK || size > out_buf.size() - 4" is true. Continuing.
  <C++ Source>  core/debugger/remote_debugger_peer.cpp:108 @ _write_out()

I have a resource called Animon (it’s like a Pokemon) and it seems to have trouble getting the animon.gd script but it only happens during breakpoints, so I’m led to believe it has something to do with @tool scripts that are referenced? I’m very new to using tools.
Interestingly, this only happens for the resource on the player side, never the NPC’s resource, which has all the same references. The game runs fine, the Animon has the animon.gd script loaded at runtime and all its stats and moves are fine but when I pause the game or there’s a breakpoint, I often get this error.

Any idea what could cause this or at least narrowing down what it could be?
Here’s the animon.gd script and two tool scripts that it references (technique_feature is info for what a move can do and animon_base is the base for each animon species)

Thanks already for taking the time!

Not sure this helps but I found this note about lack of support for debugging @tool scripts. Scroll down to User-contributed notes.

1 Like

Ah, thanks for the link! Anything helps at the moment tbh. Although I am not certain if it is the @tool script that’s causing the issue, it’s just my guess…