tutorials/plugins/running_code_in_the_editor #400
Replies: 7 comments 6 replies
-
|
It would be super helpful if there were some lines explaining why or why not breakpoints in @tool scripts are generally supported/ unsupported. If they are supported (i would assume by an external editor) then some steps on how to turn them on would be greatly appreciated. |
Beta Was this translation helpful? Give feedback.
-
|
Here's another use case where you need @tool that I just found out about: if your editor plugin tries to read a static variable from a static class, you'll get unless the static class is marked with @tool. I think it should be documented, because static methods can be called without issues from editor plugins, but as soon as you try to read a static variable it all goes to hell without any warning. |
Beta Was this translation helpful? Give feedback.
-
|
In the "Editing variables" section I think there's a small typo in the code example. In the script we declare |
Beta Was this translation helpful? Give feedback.
-
|
Got caught on _Process() not getting run until reloading the scene. godotengine/godot#25275 explains "set_process() is called internally inside ready, so there is no way to enable it without reloading the scene" as _Ready() wont be rerun automatically Some additional context around "You may need to restart the editor. This is a known bug found in all Godot 4 versions: GH-66381." may be useful - the linked issue seems to apply to a specific problem, but it seems there are other problems the warning covers as well |
Beta Was this translation helpful? Give feedback.
-
|
I really do feel that there should be a prominent link here to the several C# gotchas when using Tool scripts. |
Beta Was this translation helpful? Give feedback.
-
|
I don't know how to make a pull request but it would be cool if there was a section dedicated to making better ui in the editor with tool scripts, like making a "limited" bool that adds a integer field to the editor so you can define the limit of something. |
Beta Was this translation helpful? Give feedback.
-
|
This EditorScript note makes no sense:
When you are using an external editor, it is impossible to open a script in the Godot script editor. Attempting to do so just opens the script in your external editor. Only recently was the ability to run EditorScripts from the file-system or command palette added, and it's fully impossible to run EditorScripts in earlier versions of Godot with an external editor enabled. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
tutorials/plugins/running_code_in_the_editor
What is@tool?:@tool is a powerful line of code that, when added at the top of your script, makes it execute in the editor. You can also decide which parts of the script execute in the editor, which...
https://docs.godotengine.org/en/stable/tutorials/plugins/running_code_in_the_editor.html
Beta Was this translation helpful? Give feedback.
All reactions