Godot-steam-api - Godot Steam integration using GDNative.

Overview

Godot-Steam-API

Godot Steam integration without rebuilding Godot. Supports ๐Ÿ’ฐ Windows, ๐Ÿง Linux & ๐Ÿ MacOS (x86_x64/arm64).

Getting Started

  1. Download this plugin through Godot's asset library https://godotengine.org/asset-library/asset/1020
  2. There should now be a SteamAPI tab in your Project Settings, follow the instructions to configure the SteamAPI for your game (Takes a few seconds).

Now you can use the following functions:

# acheivements
Steam.set_achievement("gator_god")
Steam.get_achievement("gator_god")
Steam.clear_achievement("gator_god")

# leaderboards
Steam.set_leaderboard_score("High Scores", 1000)
# Get the first 10 global high scores
var top_10_global_scores = yield(Steam.get_leaderboard_scores("High Scores", 0, 10), "done")
# Get just the current user's high score
var players_score = yield(Steam.get_leaderboard_scores("High Scores", 0, 0, Steam.LeaderboardDataRequest.GlobalAroundUser), "done")
# Get the current user's high score and the two scores infront and behind
var player_rivals_score = yield(Steam.get_leaderboard_scores("High Scores", -1, 1, Steam.LeaderboardDataRequest.GlobalAroundUser), "done")

# overlay
Steam.activate_game_overlay_to_web_page("https://steamcommunity.com/")
Steam.activate_game_overlay_to_store(1435470, Steam.OverlayToStoreFlag.AddToCart)

Testing an exported build

Steam integration doesn't work with exported builds straight away. You'll have to either:

  • Upload your build to Steam or
  • Create a file in the same directory as your exported build named steamapp_id.txt with just your steam app id in it. Though do not upload this file as part of your build.

Troubleshooting

  • Did you follow the instruction in the project settings Steam tab?
  • Is Steam running?
  • Have you published your acheivments in the SteamWorks console? Publishing isn't releasing the game, I mean the button that publishes your Store page.
Comments
  • Not getting results

    Not getting results

    Hey :) I followed the youtube video, found that things were a bit different and then followed the instructions here also and made sure EVERYTHING was properly set up. txt file, sdk source path, appid, singleton, enabled, etc etc. And I am getting no achievement from it. REstarted Steam, made sure the overlay showed me online, etc etc. Any ideas?

    opened by mojoyup 8
  • Order of autoloads changed by the EditorPlugin

    Order of autoloads changed by the EditorPlugin

    Because the steam.gd singleton is added by the EditorPlugin dynamically, it's always put at the end of the autoload list. It seems we can't decide the order when adding a singleton by code unfortunately, unless I missed something?

    This is not a huge problem, it's possible to go around this limitation but I just wanted to talk about it in case someone else is having the same problem. It's frustrating to set the order in the settings and then getting it overridden.

    If there's no other solution, maybe we could add a warning somewhere in the readme or in the SteamAPI project settings panel?

    opened by MrEliptik 7
  • Steam.utils.is_running_on_steam_deck() returns an error and crashes engine

    Steam.utils.is_running_on_steam_deck() returns an error and crashes engine

    Steam.utils.is_running_on_steam_deck() returns nonexistent function 'is_running_on_steam_deck' in base Reference() error and crashes the engine.

    Perhaps the official Godot repositories are not updated yet? However, I did download a zipped version of the master and the same thing occurred.

    For reference, I'm on Ubuntu 22.04.1 LTS. Steam is currently running in the background, but Godot is being launched via Itch.

    opened by starsidecosmos 6
  • Ability to disable plugin at runtime

    Ability to disable plugin at runtime

    Is it possible to add a function I can call, to disable the Steam integration at runtime?

    I use the same code-base for the demo and full version of my game. In my export settings, I have two exports for each platform: one for the demo, and one for the full game. If possible, I would like to disable Steam integration in the demo version, by calling some function to disable the API if I detect the game is running in demo mode.

    opened by nightblade9 6
  • [question] How to get user id?

    [question] How to get user id?

    Hello, I have a super simple question that got me stumped. How can I get steam user id with this integration? I can successfully get everything working in general. The Steam established connection and returns for example user name.

    I can ask it for get_steam_id with Steam.user.get_steam_id() But I have no idea how to extract the id int from the returned value.

    Or am I doing it completely wrong?

    opened by AndrejsKlavins 6
  • [BUG] Couldn't fully load the singleton script

    [BUG] Couldn't fully load the singleton script "Steam" (possible cyclic reference or parse error)

    • OS: MacOS

    Describe the issue Basically, if I try to use a function with the Steam library (like, say, Steam.clear_achievement("test") for example), I have an error message saying that "Couldn't fully load the singleton script "Steam" (possible cyclic reference or parse error)". At first I did not have any message errors in the console, but now I have a few (listed below). I tried it on a copy of my current project, and for one of them it seems to work fine, but not for the other one. Weirdly enough, even in the one with all the error messages, it now seems to work (in the sense that the achievement is unlocked), even though I have a bunch of scary error messages.

    Paste the code causing the issue

    func _ready():
    # Test steam achievements
    	Steam.clear_achievement("test")
    	Steam.set_achievement("test")
    	print(Steam.user_stats.get_achievement_name(0))
    

    Paste any error appearing in the console

     Resource: 'res://addons/steam_api/steam.gd' is already being loaded. Cyclic reference?
     res://addons/steam_api/steam.gd:5 - Parse Error: The identifier "Steam" isn't declared in the current scope.
     modules/gdscript/gdscript.cpp:566 - Method failed. Returning: ERR_PARSE_ERROR
     Resource: 'res://addons/steam_api/steam.gd' is already being loaded. Cyclic reference?
     res://addons/steam_api/steam.gd:5 - Parse Error: The identifier "Steam" isn't declared in the current scope.
     modules/gdscript/gdscript.cpp:566 - Method failed. Returning: ERR_PARSE_ERROR
    
    
    opened by DotSquareGames 5
  • Plugin unable to connect after Godot version change

    Plugin unable to connect after Godot version change

    • OS: Windows 10

    Describe the issue When changing Godot versions (e.g. 3.4.4 > 3.5 or 3.4.3 > 3.4.4) the plugin seems to stop working. I get the error message that the plugin is unable to connect to Steam.

    Fix What helped now for a second time was completely removing the plugin and deleting the directoy in addons - then doing a clean install.

    opened by RPicster 5
  • [BUG] Cannot get it to work between Godot and Steam

    [BUG] Cannot get it to work between Godot and Steam

    • OS: Windows 10 / Godot 3.4.4

    I don't think it is necessarily a bug, but I cannot get it to work.

    Describe the issue The game/ID is in my library (but there is no game executable on Steamworks yet), steam_appid.txt has the correct number, and is located next to godot.exe. Steam.is_init() returns true after launch. Steam.set_achievement("xyz") does nothing, and Steam.get_achievement("xyz") returns false. Same for the leaderboards, which are also defined in Steamworks. I must have missed something, but cannot locate the error.

    Paste the code causing the issue

    func _ready():
    	if(steamVersion):
    		if Steam.is_init():
    			Steam.set_achievement("burger_time")
    			var has_alredy_unlocked_achievement:bool = Steam.get_achievement("burger_time")
    			print(has_alredy_unlocked_achievement) #prints false
    			set_steam_leaderboards()
    
    func set_steam_leaderboards():
    	if GameManager.current_game_mode == GameManager.current_player_game_data["easy_mode"]:
    		Steam.set_leaderboard_score("EasyMedium", GameManager.Score)
    	elif GameManager.current_game_mode == GameManager.current_player_game_data["medium_mode"]:
    		Steam.set_leaderboard_score("MediumHard", GameManager.Score)
    	elif GameManager.current_game_mode == GameManager.current_player_game_data["speedrun_mode"]:
    		Steam.set_leaderboard_score("SugarRushSpeedrun", GameManager.TotalGameTime)
    	elif GameManager.current_game_mode == GameManager.current_player_game_data["daily_challenge"]:
    		Steam.set_leaderboard_score("DailyHighScore", GameManager.Score)
    	print("Leaderboards updated") #number of entries on Steamworks are still at 0
    

    Paste any error appearing in the console

    None
    

    godot_steam

    The ID (1779560) is also correct (https://store.steampowered.com/app/1779560/Donut_Dodo/) Thanks.

    opened by zapposh 4
  • Can't get Steam Username

    Can't get Steam Username

    There doesn't seem to be a way to get the user's Steam name.

    Steamworks API docs say that I need to call ISteamFriends.GetPersonaName, but for some reason that's not exposed in the API here.

    This seems like a very basic thing I might want to do, so is a different method to achieve this already implemented?

    opened by DaelonSuzuka 4
  • Not working on Linux

    Not working on Linux

    I've tried to download the add-on to Godot 3.4.3 on Ubuntu 20.04 though the AssetLib section of the client, and I followed all of the steps in the video and added a steam_appid.txt to the root of my project folder.

    The example scene starts without any errors, but I don't get the Steam achievement notification, even after I've added the achievement through the steamworks dashboard.

    I don't have any errors to put here, and all I get on the console is []

    I'm sorry I don't have any more information to provide at the moment. What do I do?

    opened by Cobradabest 4
  • Is it possible to separate out NDA files into a subdirectory?

    Is it possible to separate out NDA files into a subdirectory?

    Background: I'm working on a (currently) closed-source game that I'm hoping to open-source. If that happens, I need to make sure I don't have anything in Git that is covered under the Steam NDA.

    From what I can see, right now, running the plugin with it being correctly configured, copies three files into the addons/steam_api directory.

    Is it possible to, instead, move those files into a subdirectory? That would make it rather easy for developers to open-source their games, while only needing to add a single directory to the .gitignore file.

    opened by nightblade9 4
  • Godot 4 version of the plugin

    Godot 4 version of the plugin

    Godot 4 is nearing a first non-beta release now, with the betas being more and more stable and feature complete.

    It would be greatly appreciated with a 4.0 version of this plugin in the assetLib as I'm looking at eventually trying to get a 4.0 project I've started on to Steam.

    opened by lostminds 1
  • Cannot get this to work at all

    Cannot get this to work at all

    I have googled everywhere trying to find out what I am doing wrong but this plugin does not work for me in any circumstance and doesn't really say why.

    • SDK downloaded, pressed the button and it said it copied the libs no problem and a green Done

    • Added my game id as requested

    • Tried running example scene in editor, errors

    • Tried running my game from editor, errors

    • Tried building and running from exe errors

    • Steam is on

    • steam_appid.txt is next to the exe when built

    • i put steam_appid.txt in the root directory of my res:// just in case, no difference.

    • i re-installed the plugin, no difference

    • I created a new project with nothing in it other than the plugin running Steam.is_init() - same issue

    • Using Godgot v3.5.stable.official [991bb6ac7]

    Any help would be appreciated, thanks.

    Error from IDE:

    • Is Steam running? - YES
    • Is the plugin activated? - YES
    • Did you do the setup in ProjectSettings > SteamAPI? - YES

    E 0:00:09.603 call: Failed to init steam api. Is Steam running? Is the plugin activated? Did you do the setup in ProjectSettings > SteamAPI <C++ Source> modules/gdscript/gdscript_functions.cpp:775 @ call() <Stack Trace> steam.gd:44 @ _ready()

    No other errors, this is the only one.

    Error when running from exe:

    • Is Steam running? - YES
    • Is the plugin activated? - YES
    • Did you do the setup in ProjectSettings > SteamAPI? - YES

    ERROR: Failed to init steam api. Is Steam running? Is the plugin activated? Did you do the setup in ProjectSettings > SteamAPI at: call (modules/gdscript/gdscript_functions.cpp:775) - Failed to init steam api. Is Steam running? Is the plugin activated? Did you do the setup in ProjectSettings > SteamAPI ERROR: You're running an exported build. Steam integration will only work if the game is launched by Steam. Either upload this build to Steam or create a file in the same directory as your exported build named 'steam_appid.txt' with just your steam app id in it. at: call (modules/gdscript/gdscript_functions.cpp:775) - You're running an exported build. Steam integration will only work if the game is launched by Steam. Either upload this build to Steam or create a file in the same directory as your exported build named 'steam_appid.txt' with just your steam app id in it.

    opened by mearlam 8
  • Mac OS 10.13.6 runtime error

    Mac OS 10.13.6 runtime error

    Hi and thank you for your library :)

    But I have an issue: library gives error on Mac OS 10.13.6 image image image

    Unfortunately I can't update OS to the latest version, so could you make it backward compatible with 10.x.x ?

    Thank you!

    opened by skuzmin 8
Owner
Sam Murray
Sam Murray
sc-ble-bridge is a utility that for every connected Steam Controller creates a virtual one acting as a bridge between SC and Steam

sc-ble-bridge The main goal of this utility is to provide workaround for steam-for-linux issue which makes Valve's Steam Controller unusable in BLE mo

null 5 Apr 19, 2022
This project contains three scripts to help working with the steam-runtime, especially outside of Steam.

This project contains three scripts to help working with the steam-runtime, especially outside of Steam. See these blog posts for more details: steam-

Jรธrgen P. Tjernรธ 12 Sep 27, 2022
Godot module to use ROS2 within Godot

godot_ros This repo is a Godot Module meant to connect Robotic Operating System 2 (ROS2) and the Godot Game Engine. Quick Start Make sure to have both

Evan Flynn 32 Dec 27, 2022
R integration for edlib, a C/C++ library for pairwise sequence alignment using edit distance (Levenshtein distance).

edlibR Introduction Main Features Usage Background Alignment Methods Algorithmic Design Installation References edlibR: R integration for edlib The R

null 5 Mar 2, 2022
ToPS is an objected-oriented framework implemented using C++ that facilitates the integration of probabilistic models for sequences over a user defined alphabet

ToPS is an objected-oriented framework implemented using C++ that facilitates the integration of probabilistic models for sequences over a user defined alphabet

Andre Yoshiaki Kashiwabara 34 Aug 2, 2022
This is a metamod plugin for Fall Guys maps in Sven Co-op (Steam version) (Windows or Linux)

metamod-fallguys This is a metamod plugin for Fall Guys maps in Sven Co-op (Steam version) (Windows or Linux) Installation Copy everything from build

hzqst 7 Dec 7, 2022
Sea of Thieves - Advanced ESP /w ImGui for XBox Version (Steam has to be written)

??โ€โ˜ ๏ธ Sea of Thieves - External Tool Premium Sea of Thieves - Advanced ESP /w ImGui for XBox Version (Steam has to be written) How to: Check latest ga

Kamil 12 Sep 21, 2022
Compatibility tool for Steam Play based on Wine and additional components

Introduction Proton is a tool for use with the Steam client which allows games which are exclusive to Windows to run on the Linux operating system. It

Valve Software 19.1k Dec 30, 2022
Valve's Steam Deck kernel (5.13.10; x86_64; linux-neptune)

Linux kernel ============ There are several guides for kernel developers and users. These guides can be rendered in a number of formats, like HTML an

Adam Jafarov 6 Aug 6, 2022
Send virtual keyboard presses in godot on linux/windows

gdvk - Godot Virtual Keyboard Send virtual keyboard presses in godot on linux/windows Please inform me about how my code is shit; I'm new to C++. Comp

CrispyPin 3 Dec 30, 2021
A module for Godot 3.x that makes it easy to send crash reports to Backtrace

Godot Backtrace Module This module adds automatic crash generation support to Godot 3.x with the intent of making it possible to send the crash data t

null 15 Oct 28, 2022
A proof-of-oncept module adding real-time Wren support to Godot

Godot Wren Module This module adds a new node, called WrenManager, that allows for executing Wren code in Godot during runtime! Wren is a cool lightwe

null 3 Nov 28, 2021
SAM (Software Automatic Mouth) for Godot

gdsam SAM (Software Automatic Mouth) for Godot 3.4+ A GDNative library wrapper around the C port of SAM by Sebastian Macke over at https://github.com/

null 2 Dec 28, 2021
Node1D and other 1-dimensional node types for making 1D games in Godot.

Godot 1D Node1D and other 1-dimensional node types for making 1D games in Godot. Have you ever wanted to make 1D games in Godot? ...no? You say you ha

Aaron Franke 12 Jul 31, 2022
Raspberry Pi Pico (RP2040) and Micro-ROS (ROS 2) Integration

The Pico is an amazing microcontroller and I couldn't wait for ROS 2 support or Arduino Core, so here is my approach. Once the Arduino Core for RP2040 is out it will be easier to use micro_ros_arduino.

Darko Lukiฤ‡ 19 Jun 19, 2022
Solving Kepler's equation via contour integration, implemented in C++

Kepler's Goat Herd Code for solving Kepler's equation using contour integration, following Philcox et al. (2021, arXiv). This uses a method originally

Oliver Philcox 45 Sep 11, 2022
ESPHome integration for the Xiaomi Mijia Bedside Lamp v2.

esphome-xiaomi_bslamp2 Warning: this code is still under development This code might not yet be production-ready. At this point, it is declared beta-q

Maurice Makaay 136 Dec 27, 2022
font rendering, Zep vim emulator, microui integration

LabFont This project is an exploration of getting text into a rendeing pipeline based on @floooh's sokol. Frameworks such as Dear ImGui solve text ren

Nick Porcino 14 Sep 11, 2022
JWM is a cross-platform Java window management and OS integration library.

JWM aims to expose an interface that abstracts over window creation, input handling and OS integration

JetBrains 403 Jan 9, 2023