-
-
Notifications
You must be signed in to change notification settings - Fork 22k
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
Fix global scripts not being added because of bad global_script_class_cache.cfg
#102636
Fix global scripts not being added because of bad global_script_class_cache.cfg
#102636
Conversation
global_script_class_cache.cfg
Some quick thoughts, but @RandomShaper and @Hilderin should be able to assess this further:
I'm not necessarily suggesting to implement any of the above, it's just food for thought. The proposed solution here might totally be the best one already. |
Thanks for the thoughts! About removing the optimization, i believe the method is called only once at the start of the editor. Only on the And i thought about making them not mandatory, but tool scripts were added on 4.3, so any tool script migrating to 4.4 might break if we default to false. The problem is not so much the editor, since it refreshes all the scripts at startup, but the games don't work when |
After looking at the issue a bit, I found 2 problems.
ScriptServer::save_global_classes();
EditorNode::get_editor_data().script_class_save_icon_paths(); That causes the
Another minor modif: I added a break in I created a branch with my modified test code to help you if you want: master...Hilderin:godot:fix-global-class-names-not-save-with-upgrade-tool |
58f5661
to
ee4867a
Compare
Thanks for the help Hilderin! Now if a global class is found or removed on the first scan, Also i noticed that every time that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Notwithstanding other comments needing to be addressed, this makes sense to me.
|
Co-authored-by: Hilderin <81109165+Hilderin@users.noreply.github.com>
ee4867a
to
2ba64a5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested locally, it works as expected, fixes the issue and even prevents some potential out of sync of the global cache file on some limit cases or in the future if other props are added. Good job!
Thanks a ton! This solves some of the remaining release blockers for 4.4, so that's a huge contribution! |
Fixes #102557, probably also fixes #102568
The Issue:
A commit made "is_tool" and "is_abstract" mandatory to add new global classes to
ScriptServer::global_classes
. Butglobal_script_class_cache.cfg
from projects before 4.4 lack these properties, so these classes won't be added, causing errors when running the game.Current Solution:
After the editor scans all the scripts for the first time, now forcibly updates
global_script_class_cache.cfg
, resolving the issue.However, running a 4.3 game with 4.4 without first opening it with the editor at least once still fails.
I've tried to fix this in
ScriptServer::init_languages
, where the global classes are first loaded, but couldn't figure it out.