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

Loading of script inside .pck does not override autoloaded scripts #42002

Open
nightrobin opened this issue Sep 12, 2020 · 2 comments
Open

Loading of script inside .pck does not override autoloaded scripts #42002

nightrobin opened this issue Sep 12, 2020 · 2 comments

Comments

@nightrobin
Copy link

nightrobin commented Sep 12, 2020

Godot version:
3.2.2

OS/device including version:

Windows 10 x64

Issue description:

What happened:
Loading of script inside .pck does not override autoloaded scripts
what was expected:
Loaded script inside .pck will override autoloaded scripts

I want to maximize this feature as I plan to have a DLC and updates: https://docs.godotengine.org/en/stable/getting_started/workflow/export/exporting_pcks.html?#summary

Steps to reproduce:

  1. Create a script. Print a character print("A") in the _ready or _process. Save it.
  2. Register the script in autoload.
  3. Export the script to an .pck file
  4. Edit the script, change the character print("B") to print. Save it.
  5. Create another script to load the .pck in runtime.
  6. See if the character printed is "A" and not "B". <- "B" is printed in actual.

I also tried, get_tree().reload_current_scene() after I loaded the pck but it does not have an effect on the autoloaded scripts.

Minimal reproduction project:

@Calinou
Copy link
Member

Calinou commented Sep 12, 2020

Autoloads are defined in project.godot, which is presumably never overridden when loading a resource pack (or if it is, it has no effect since the file is only read once when the project starts).

@ripperdave
Copy link

@nightrobin is there any solution for this?
My .pck also has autoloaded scenes/scripts.
It would be great to add or change them in run-time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants