Godot Version
4.6
Question
Hello,
I’m doing a Debugger load as a singleton at the start of my game. → The load is correct and the function _Ready is called.
In my _Ready function I register my function Test to capture message starting with “my_plugin”. So before the EngineDebugger.RegisterMessageCapture function when I tested things I used EngineDebugger.HasCapture(“my_plugin”) before and after the precedent function and before it returns false and after it returns true. → normal behavior.
And we arrive at the problem, when I send a debug message with EngineDebugger.SendMessage the message was never captured in my function Test and even worse we never even entered the function Test.
So that makes we wandering if we cannot use EngineDebugger in C# but only in GDScript.
Thank you very much
public partial class DebuggerSingleton : Node
{
public const String DEBUGGER_PREFIX = "my_plugin";
public static DebuggerSingleton Singleton;
public override void _Ready()
{
Singleton = this;
EngineDebugger.RegisterMessageCapture("my_plugin", new Callable(this, nameof(Test)));
EngineDebugger.SendMessage("my_plugin:test", []);
}
public bool Test(String message, GDArray array)
{
if (message == "test")
{
GD.Print("test is ok!");
return true;
}
return false;
}
}
P-S : sorry if my english is not good, if you have any question don’t hesitate to say them