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

GDScript: Allow trying to reload shallow script when instantiated #97302

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rune-scape
Copy link
Contributor

@rune-scape rune-scape commented Sep 21, 2024

fixes #95789

this allows automatically compiling scripts on demand when calling script.new() in a very limited way to avoid errors from the wrong order of compiling dependencies that would otherwise be more difficult to solve

i looked back at the solution i mentioned in #95789 (comment)
and i think the solution i mentioned is actually fine, the gdscript compiler is not designed for multithreading, so, without accounting for that the logic is simple:
when a script is created it has a bool shallow set to true
while reloading, reloading is set to true like usual
at the beginning of compilation, shallow is set to false
then when instantiating a not-valid shallow root script that is not currently reloading, tries to reload it

also adds a better error message and call error

@rune-scape rune-scape requested a review from a team as a code owner September 21, 2024 23:17
@dalexeev dalexeev added bug topic:gdscript regression cherrypick:4.3 Considered for cherry-picking into a future 4.3.x release labels Sep 22, 2024
@dalexeev dalexeev added this to the 4.4 milestone Sep 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug cherrypick:4.3 Considered for cherry-picking into a future 4.3.x release regression topic:gdscript
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Custom Resources that worked in 4.2.2 do not in 4.3 (does not recognize as resource?)
2 participants