Can a running scene update my plugin editor script?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By ClubEdNZ

When running the project, I want it to be able to update the tool script so that it can display changes, live in the editor. It seems like these are two separate environments that aren’t aware of each other.

Basically I want the running game to update a dictionary, and while it’s running, I want the tool editor to be able to access it and use that info to update what I’m seeing in the editor.

What should I use? A signal, resource, exported var, global var, singleton - I’ve tried lots, but am missing something big, or trying something impossible.

Hi,
where is your tool script located? Is it a node in the tree? is it a singleton? is it a plugin script?

klaas | 2020-09-01 17:34

It’s a plugin, in the addons directory.

ClubEdNZ | 2020-09-01 18:03

:bust_in_silhouette: Reply From: klaas

Hi,
as you said in your comment its a editorPlugin. So signals and exported vars wont work well. I would go with a singleton. Its easy accessible from everywhere.

Just ad a singleton onEnterTree with add_autoload_singleton

Hi, thanks for that.
I’m having issues with it, but I’m not sure what part of the project is the problem. and since you can’t step through plugin code, it’s more of a mystery. I think I’ll need to learn a bit more about plugins before diving into the deeper parts.

ClubEdNZ | 2020-09-07 02:05