Startup checks and initialization behavior configuration

Godot Version



at launch, from the game itself, i want to perform a check at the core startup of the game. i need to check for GDExtension files needed to run the game, wether they are present or not at the same folder as the main executable. if this check fails, the startup of the game should bring the player to a warning message, where they can either ignore and be subject to undefined behavior, or gracefully close the game. the catch is that i have Autoload scripts currently in my project which depends on the GDExtension, so just launching the game normally will already cause the broken behavior to happen. how do i ensure i can fully prioritize one scene or script to be ran in this manner before anything else is attempted to load from within the executable?

the reason for me to even consider all of this is that people keep trying to run the game directly from the zip folder, and most archivers including the default Windows archiver has this behavior where it only extracts to the temp folder the executable itself to save time, but the engine has no proper checks for GDExtensions when launching. any solutions?
thank you for reading.

You can have an Autoload in the first position in the list (you can move it using the arrows in the right side) where you can check if the library has loaded with Engine.has_singleton() and, if not, then show a popup or something.

For example, to check if the GodotSteam GDExtension library is loaded:

extends Node

func _enter_tree() -> void:
	if not Engine.has_singleton("Steam"):
		process_mode = Node.PROCESS_MODE_ALWAYS
		get_tree().paused = true
		var popup =
		popup.title = "Error"
		popup.dialog_text = "Library not loaded"
1 Like

thank you, i’ll check it out ^^

now how do i halt the rest of the loading of the game until after the popup is closed?

In the example I paused the game when the library is not found. I’m not sure if there’s another way.

1 Like

oh i didn’t notice at first. thank you

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.