extends Node var app_id: int = 480 var app_installed_depots: Array = [] var app_languages: String = "" var app_owner: int = 0 var build_id: int = 0 var game_language: String var install_dir: Dictionary = {} var is_on_steam_deck: bool = false var is_on_vr: bool = false var is_online: bool = false var is_owned: bool = false var launch_command_line: String = "" var steam_id: int = 0 var steam_username: String = "" var ui_language: String func _init() -> void: # Set your game's Steam app ID here unless you are passing the app ID to the initialization function OS.set_environment("SteamAppId", str(app_id)) OS.set_environment("SteamGameId", str(app_id)) func _ready() -> void: initialize_steam() # This is necessary to receive Steamworks callbacks / signals. Not needed if you pass true as the last argument to the initialization function. func _process(_delta: float) -> void: Steam.run_callbacks() func initialize_steam() -> void: # Depending on the GodotSteam version or your preference, here are some options var initialize_response: Dictionary = Steam.steamInitEx() # var initialize_response: Dictionary = Steam.steamInitEx( false, app_id, true ) # var initialize_response: Dictionary = Steam.steamInitEx( app_id, true ) print("Did Steam initialize?: %s" % initialize_response) if initialize_response['status'] > Steam.STEAM_API_INIT_RESULT_OK: print("Failed to initialize Steam. Shutting down. %s" % initialize_response) get_tree().quit() # Gather additional data app_installed_depots = Steam.getInstalledDepots( app_id ) app_languages = Steam.getAvailableGameLanguages() app_owner = Steam.getAppOwner() build_id = Steam.getAppBuildId() game_language = Steam.getCurrentGameLanguage() install_dir = Steam.getAppInstallDir( app_id ) is_on_steam_deck = Steam.isSteamRunningOnSteamDeck() is_on_vr = Steam.isSteamRunningInVR() is_online = Steam.loggedOn() is_owned = Steam.isSubscribed() launch_command_line = Steam.getLaunchCommandLine() steam_id = Steam.getSteamID() steam_username = Steam.getPersonaName() ui_language = Steam.getSteamUILanguage() # Check if account owns the game if is_owned == false: print("User does not own this game") get_tree().quit()
or share this direct link: