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

self setup chicken and egg problem (ModLoaderStore not being available in setup) #200

Closed
Tracked by #181
Qubus0 opened this issue Mar 30, 2023 · 2 comments
Closed
Tracked by #181
Assignees
Labels
bug Something isn't working installation
Milestone

Comments

@Qubus0
Copy link
Collaborator

Qubus0 commented Mar 30, 2023

Self setup is currently stuck in an infinite loop:

  1. The Setup runs
  2. it logs something via ModLoaderUtils (or uses another util method, when logs are removed)
  3. ModLoaderUtils requires info from ModLoaderStore
  4. ModLoaderStore is not set up yet
  5. => script compilation error, setup fails

Problems:

  • Since it's a compilation error, we can't just not use the autoload in a few methods and keep them in others that aren't used in the setup
  • we also can't get the autoload via get_node("/root/..."), since the Utils a) aren't in the tree and b) can't use it since all methods are static and get_node is non-static

Possible solutions

  • Create a different utils class without store just for setup? not clean
  • same as option before, but move them into the setup?
  • remove ModLoaderStore from the utils again? loses a lot of functionality
@Qubus0 Qubus0 added bug Something isn't working installation labels Mar 30, 2023
@KANAjetzt KANAjetzt added this to the v6.0.0 milestone Mar 30, 2023
@KANAjetzt KANAjetzt self-assigned this Mar 30, 2023
@KANAjetzt
Copy link
Member

KANAjetzt commented Mar 30, 2023

functions in mod_loader_utils.gd that are used in mod_loader_setup.gd and reference ModLoaderStore

  • _get_verbosity()
  • get_path_to_mods()
  • get_path_to_configs()

@KANAjetzt KANAjetzt mentioned this issue Mar 30, 2023
37 tasks
KANAjetzt added a commit to KANAjetzt/godot-mod-loader that referenced this issue Mar 30, 2023
The ModLoader self setup script uses util function from ModLoaderUtils in GodotModding#172 ModLoaderStore was introduced into utility functions that where used by the self setup. Because the setup is run before the ModLoaderStore is initialized the setup was stuck in an infinite loop. To fix that `get_modloader_store()` was added and is now used in `_get_verbosity()`, `get_path_to_mods()` and `get_path_to_configs()`. Also updated the the autoload index check in the `_init()` of *mod_loader_setup.gd*.

closes GodotModding#200
KANAjetzt added a commit that referenced this issue Mar 30, 2023
The ModLoader self setup script uses util function from ModLoaderUtils in #172 ModLoaderStore was introduced into utility functions that where used by the self setup. Because the setup is run before the ModLoaderStore is initialized the setup was stuck in an infinite loop. To fix that `get_modloader_store()` was added and is now used in `_get_verbosity()`, `get_path_to_mods()` and `get_path_to_configs()`. Also updated the the autoload index check in the `_init()` of *mod_loader_setup.gd*.

closes #200
@ithinkandicode ithinkandicode changed the title self setup chicken and egg problem self setup chicken and egg problem (ModLoaderStore not being available in setup) Apr 1, 2023
@KANAjetzt
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working installation
Projects
None yet
Development

No branches or pull requests

2 participants