Steamworks SDK support for GameMaker 8.1 and earlier.
Output.gmk/steam_api.dllto the Included Files (menu: Resources - Included Files).
Output.gmk/Steamworks.gmk.dllto the Included Files.
steam_appid.txtfile containing your Steam App ID, and add it to the Included Files
Sample file is included in
Output.gmk/Steamworks.gmk.gmlonto a GameMaker window with the project open to import the scripts.
Create an object (say,
Mark it as persistent
Add the following into the Create event:
steam_init_dll(); steam_init(480); // replace `480` with your Steam App ID
This will initialize Steam API and request the user stats&achievements (if any).
Add the following into the Step event:
This is required by Steam API in order to receive API events.
Should you forget to call this function, the user will only receive achievements after they close the game.
Add the object into the game's first room (so that it is created on game start).
If the game's first room is a menu, make a separate "init" room that has the object and goes to the actual first room via
room_goto_next()in Room Creation Code.
If everything was done correctly, upon launching the game Steam will detect you as playing the game, and you'll be able to use Steam API functions as you wish.
Once installed, you can use the included
steam_ scripts to call the supported DLL functions.
Every script includes a short description of what it does.
Script naming closely follows that of built-in GameMaker-Studio functions.
Official documentation should be helpful too.
Things to keep in mind
Steam Overlay (default: Shift+Tab) will not show up unless the game is ran from Steam itself
This is due to pre-GMS versions of GameMaker not being able to comply with the required initialization order.
Achievements and stats can take a few moments to load. You can check whether they are done loading yet via
Author: Vadim "YellowAfterlife" Dyachenko
License: MIT https://opensource.org/licenses/mit-license.php