I created a script where I declared several signals and in another script I am trying to refer to that script to use the signals and am getting the error “Identifier “CommandDispatcher” not declared in the current scope.” What am I doing wrong? I’m following a tutorial step-by-step and the guide had no issues when they did it this way.
When you have defined a class CommandDispatcher and then you write CommandDispatcher.PROCESS_COMMAND, you request a static property of the class. We don’t have static signals in GDScript currently (see proposal #6851), that’s why it fails.
When you define an autoload, it’s a bit special case which looks the same as if it were declared as a class, but it’s actually an instance that you can refer to as CommandDispatcher. Then when you write CommandDispatcher.PROCESS_COMMAND, you request a property of the instance, a signal in this case, which is perfectly valid.