-
-
Notifications
You must be signed in to change notification settings - Fork 21.8k
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
Editing a built-in script won't update unless containing scene is saved #5535
Comments
Built-in scripts are so problematic that I wonder if they should be removed... Anyway, I'm not sure how possible this is. The script is in the scene file, so you need to save the scene in order to save the script. And saving another scene from the script editor (or when saving a different scene) doesn't sound like a good idea usability-wise. TBH I don't even like this "save all" function as it is, it's just convenient because Ctrl+S don't work for scripts. |
@vnen I agree with you about built-in scripts. The only think I ever used them for was for quickly testing a script that I would remove later. |
Well...I like built-in scripts as a good way to remove small scripting from the filesystem, specially when it's something not bound to be edited often. Laugh all you want but once they start piling on, it can become quite a nuisance to have 50 10-line scripts lying around in a folder. |
it should be safer now to edit them, as Godot won't allow you to open them On Wed, Jul 6, 2016 at 9:17 PM, Hetdegon notifications@github.com wrote:
|
For the reference, fixed by a78226c. |
Hmm, I just updated and noticed that if the built-in is already open in the editor, it still allows to modify it as normal, but with the same caveats as when I opened this issue. Perhaps this approach is wrong, and a "forced save" could be made on the containing scene instead? |
I guess a78226c missed the second part of the fix: saving a builtin script should force saving its scene. |
Issue #15406 might be related to this one? |
Are built-in scripts still open for discussion? I've always just created separate files for my scripts, it's more useful this way even for small scripts, for example, scripts can be easily re-used later. |
I personally disagree. When your script is just like 4 lines and not reusable (which is a thing that happens, specially with UI elements) making another file is just messy. Not to mention we already have to deal with extra data files for every image or icon, so a way to reduce file pollution would be great. |
Reading the steps from the OP, the issue is resolved already. You can't edit a foreign built-in script anymore, its scene will be opened automatically and if you close the scene, the script is also closed. As long as the owning scene is opened, running the game will save it automatically (by default), so the changes are reflected. The issue can thus be closed. |
Operating system or device - Godot version:
Ubuntu Linux 16.04 64b, Godot built from ac157f8
Issue description (what happened, and what was expected):
If you have a script that's built-in and modify it from the editor, while another scene is focused, changes won't take effect unless the scene containing the built-in script is saved. This can become kind of confusing when doing minute changes and not seeing them reflected in the project.
Steps to reproduce:
1 - Create a built-in script in a sub-scene, leave it in the script editor, then save the scene.
2 - Move to another scene and instance the sub-scene with the built-in script.
3 - Edit the built-in script and save it with ctrl+S (even if this saves the scene, it also saves scripts being edited even if it doesn't belong to that scene, so it's easy to forget)
4 - Run the scene with the instanced sub-scene. Changes won't be reflected.
5 - Re-focus the sub-scene and save it.
6 - Now it works.
The text was updated successfully, but these errors were encountered: