Godot Engine Integration

Integrate KSS Dreamgate with your Godot game:

func _ready():
	on_KSS_DreamGate_call()


func on_KSS_DreamGate_call():
	
	# 1. Get PID and build args (Correct)
	var main_game_pid = OS.get_process_id()
	var game_id = "YOUR GAME ID"
	var ksscall = "FALSE" # If thexecution comes from a standard game launch or from the KSS DreamGate call
	var args_to_pass = [game_id, ksscall, str(main_game_pid)] 
	var external_app_path = OS.get_executable_path().get_base_dir() + "/KSS Sdk.exe"
	
	# IMPORTANT: Launch the SDK Tool in non-blocking mode
	var exit_code = OS.create_process(external_app_path, args_to_pass, false)
	
	if exit_code != OK:
		# Launch FAILED (e.g., SDK executable not found).
		# The game will NOT quit here. It will proceed, but without the integrity check running.
		print("FATAL ERROR: Failed to launch KSS Sdk Tool! Exit Code: " + str(exit_code))
		get_tree().quit()
		# --- PREVIOUSLY HERE: get_tree().quit() ---
		# Removed the quit call. The game proceeds to the 'else' block below.
		
	else:
		# Launch successful. The game continues to run, waiting for the SDK Tool 
		# to execute its check and either quit (if checks pass) or kill the main game (if checks fail).
		print("KSS Sdk Tool launched. Loading main game...")
		
		# Now, load your main game scene or continue the initialization flow
		# get_tree().change_scene_to_file("res://MainMenu.tscn")

Log in to your Account

Join the Rebel Community of Gamers!

JOIN THE REBEL TRIBE!

Join the K-Magazine web tribe and receive occasional emails about our games, new products, promo codes and exiting news!

[newsletter_signup_form id=3]

By subscribing, you consent to receive emails from K-Magazine and K Storm Studio. You may revoke the consent at any time by clicking "unsubscribe" at the bottom of any email from us.

skull gamer k_newsletter popup k-magazine