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

Built-in scripts of child nodes in editor require editor restart to reload #92157

Closed
KoBeWi opened this issue May 20, 2024 · 6 comments · Fixed by #92177
Closed

Built-in scripts of child nodes in editor require editor restart to reload #92157

KoBeWi opened this issue May 20, 2024 · 6 comments · Fixed by #92177

Comments

@KoBeWi
Copy link
Member

KoBeWi commented May 20, 2024

Tested versions

4.3 dev6 broken
4.2 works

System information

Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 1060 (NVIDIA; 31.0.15.4633) - Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz (8 Threads)

Issue description

If you have a built-in script in a preloaded scene, and the script is attached to a child node, not root, and you also use the script as part of editor plugin, any changes to the script will be ignored and you need to restart editor to update it. This used to work in older versions.

Also this error prints when opening the affected scene while the plugin is active:
modules/gdscript/gdscript.cpp:741 - Condition "!p_keep_state && has_instances" is true. Returning: ERR_ALREADY_IN_USE

Steps to reproduce

  1. Open the MRP
  2. Go to Screen X
  3. Press Test button
  4. Open MainScreen.tscn
  5. Edit the script inside Button
  6. Change to a different text
  7. Again in Screen X, press Test
  8. The printed text is the same

You can run the same project in Godot 4.2 and the text changes.

Minimal reproduction project (MRP)

deadscripts.zip

@KoBeWi
Copy link
Member Author

KoBeWi commented May 20, 2024

Seems to have broken between 4.3 dev3 and dev4.
I tried reverting #85501. It fixes the error, but not the reload issue, so it's something else.

@KoBeWi
Copy link
Member Author

KoBeWi commented May 20, 2024

Bisected to 2e09985 ;_;

EDIT:
Also it's specifically from changes in resource_loader.cpp, not editor_node.cpp.

@inhalt120g
Copy link

I'm getting this same error "!p_keep_state && has_instances" by just opening my project (written in 4.2 and now opening it in 4.3), and when I try to launch it, it gets all buggy. Same project works fine in 4.2 (tested hundreds of times). I can't figure out what exactly is triggering it, but if it means anything I do use lots of simple (for example I don't use a script as a part of an editor plugin) inbuilt scripts.

v4.3.beta1.official [a4f2ea9]
macOS 14.5.0 - Vulkan (Forward+) - integrated Apple M1 - Apple M1 (8 Threads)

@donn-xx
Copy link

donn-xx commented Sep 18, 2024

Am using compiled 4.4-dev (form yesterday*) and am getting that error message:
ERROR: Condition "!p_keep_state && has_instances" is true. Returning: ERR_ALREADY_IN_USE

(* commit 48403b5)

I am coding a Plugin (it uses a GraphEdit). Now I can't make any changes to my gdscript and see the results without restarting the editor. That's new..

@akien-mga
Copy link
Member

@donn-xx Please open an issue with a reproduction project and more details on what versions work, and what versions don't work. This is an issue that was resolved before the 4.3 release, it's unlikely to be related to what you're experiencing in the master branch.

@donn-xx
Copy link

donn-xx commented Sep 18, 2024

Done so. Here: #97138
MRP will take a mo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Bad
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants