How to use editor scripts? (SOLVED)

Hi, I have an editor script I want to use it to make texture assignment faster but I am not sure how to use it with the engine. I checked out some forum discussions but could not find how to use it. AI also suggests finding some slot on game.project but no such field exist

Thank you

Chatgpt codex and Claude code wrote two editor scripts for me and they work great.

2 Likes

I mean, how do I make use of the code it provided? Do I add it as some kind of dependency?

No need to register it. Any file called .editor_script will be found automatically. When you made one or made a change to any just open menu on top and press reload editor scripts, new ones will become available :slight_smile:

2 Likes

Best is to use shortcut, for example Cmd+Shift+R depending on your platform

Thank you!

I do reload editor scripts but no change is visible on the editor. This is my editor script’s resource path: /_Scripts/editor/MaterialSet.editor_script

GPT says check the top bar but no visible changes there either. Do I need to enable Developer mode for it somehow?

1 Like

There’s no magic, or only a little magic.

The editor will pick up any file, placed anywhere, that has the .editor_script file ending. As SamsTheGreatest said when you are developing you need to press the “Reload Editor Script” menu option.

If your things does not show up still at that point, there is likely an error in your code. You can look at one of my extensions as an example.

4 Likes

Or maybe you have it at some different context?

For example, if you want to access/run your editor script from Project→Run my script you have to define locations in your get_commands(), e.g.:

locations = { “Project” }

Available are only:

locations (required) — an array of either "Edit", "View", "Project", "Debug", "Assets", "Bundle", "Scene" or "Outline", describes a place where this command should be available. "Edit", "View", "Project" and "Debug" mean menu bar at the top, "Assets" means context menu in Assets pane, "Outline" means context menu in Outline pane, and "Bundle" means Project → Bundle submenu.

1 Like

Here another example of editor_script which add Poki Sdk to Project→Bundle menu extension-poki-sdk/poki-sdk/editor/poki.editor_script at main · defold/extension-poki-sdk · GitHub

2 Likes