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

Adding Autoload/singleton in Runtime from script #52055

Closed
ripperdave opened this issue Aug 24, 2021 · 1 comment
Closed

Adding Autoload/singleton in Runtime from script #52055

ripperdave opened this issue Aug 24, 2021 · 1 comment

Comments

@ripperdave
Copy link

ripperdave commented Aug 24, 2021

Godot version

3.3.3

System information

Windows 10

Issue description

I am working on a game collection launcher. I have 10 existing games with Autoloaded singletons. I plan to add more in future.
I import existing games through .pck (ProjectSettings.load_resource_pack(...)), but imported games need their own singletons.

1, How can I add autoload singletons after the game (collection launcher) started?
Adding nodes to root won't make the node visible in global scope variables. (cannot access the singleton by its name)
2, Is there any way to add global scope variables?

No details about this in documents:
(https://docs.godotengine.org/en/stable/getting_started/workflow/export/exporting_pcks.html?#summary)
https://docs.godotengine.org/en/stable/getting_started/step_by_step/singletons_autoload.html

Thanks.

Steps to reproduce

Try to add autoload singleton after the game is started.

Minimal reproduction project

No response

@Calinou
Copy link
Member

Calinou commented Aug 24, 2021

Please don't ask support questions here, as this issue tracker is meant to be used for bug reports only. Use one of the other community channels instead.

I import existing games through .pck (ProjectSettings.load_resource_pack(...)), but imported games need their own singletons.

If the games are entirely separate, they should not be using singletons (or they should be separate processes if the platform allows this). It's an architecture decision you need to make here, but it's entirely feasible.

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

2 participants