Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding script templates to project or editor folder does not make it appear on the "Create New Script" Dialogue #61614

Closed
eh-jogos opened this issue Jun 1, 2022 · 7 comments

Comments

@eh-jogos
Copy link

eh-jogos commented Jun 1, 2022

Godot version

4.0.alpha8

System information

Manjaro Linux, Vulkan

Issue description

I've added a template script to the project folder res:://script_templates/ like I used to do in Godot 3.x but it is not showing up on the Create new script dialogue.

I tried to add it directly to the editor script_templates folder and it also did not work, I use the editor in self contained mode.

Tried to take a look at the latest documentation, but it doesn't seem like I'm doing anything different:
https://docs.godotengine.org/en/latest/tutorials/scripting/creating_script_templates.html

Even tried to copy-paste the example in the documentation but got nothing.

Steps to reproduce

Start a new project, extract the attached zip file (it's just the "script_templates" folder with two files, the one I use and the example from the documentation) on the root folder of any godot 4.0 project and try to create a new script.

Minimal reproduction project

script_templates.zip

@eh-jogos eh-jogos changed the title Adding script templates to Project or editor folder does not make it appear on the "Create New Script" Dialogue Adding script templates to project or editor folder does not make it appear on the "Create New Script" Dialogue Jun 1, 2022
@timothyqiu
Copy link
Member

In 4.0, you have to put the template script inside a folder with the name of your target class.

e.g. If your template script targets any Node, then it has to be at res://script_templates/Node/some_name.gd.

@eh-jogos
Copy link
Author

eh-jogos commented Jun 2, 2022

Thanks a lot @timothyqiu

@NationalityNZ
Copy link

This was tripping me up big time. This really needs to be added to documentation.

@eh-jogos
Copy link
Author

eh-jogos commented Jun 4, 2022

@timothyqiu using %BASE% or the other placeholders on my template is not working on alpha9. Have they changed and is this another obsolete documentation problem or should I open a separate issue for it?

@timothyqiu
Copy link
Member

@eh-jogos Ah, yes, these %XXX% were changed to _XXX_. So it's _BASE_ now in 4.0.

You can open an issue in godot-docs repository to request an update of the documentation.

@eh-jogos
Copy link
Author

eh-jogos commented Jun 4, 2022

@timothyqiu Thanks a lot! Will open the issue there then!

@KoBeWi
Copy link
Member

KoBeWi commented Jun 22, 2022

I opened the docs issue: godotengine/godot-docs#5887

@KoBeWi KoBeWi closed this as not planned Won't fix, can't repro, duplicate, stale Jun 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

4 participants