SteamWrap (for Steam Games)

rob1221

  • *
  • Posts: 9473
Based on SteamWrap by dukope: https://github.com/dukope/SteamWrap
Modified by Rob1221 and Denver2003
With a lack of testers, some features may not perform as expected.  Report any problems here.

1. Either sign up to be a Steam partner (https://partner.steamgames.com) or have a publisher grant you access to the game on Steamworks.

2. To add the extension to your game, you can either unzip and move the attached extension folder into engine-extensions in your workspace, or you can go to Settings > Extensions > Install Extension.

3. Inside the extension folder, open include.nmml and fill in your Steamworks app ID and your game name as listed in the iOS settings.  There is a bug that causes your Mac app name to be the iOS name and not the main project name.
Update: newer Stencyl versions may use the Mac App Store name so make sure that one is filled in as well.

4. On the Steamworks site, setup any leaderboards, stats, and achievements that you need.  For achievements, you need to publish your changes before testing.  To test without uploading your game to Steam, make sure your Steam client is running.

5. Add the extension blocks to your game (see below for block details).

Start SteamWrap with App ID: _____
Put this block in "when created" of your first scene.

Set Steam Achievement _____
Set/unlock an achievement.

Clear Steam Achievement _____
Clear an achievement so it can be tested again.  DISABLE BEFORE PUBLISHING TO STEAM.

Set Stat With ID _____ to _____
Set a stat.

Store Steam Stats
This block is used to upload all set stats to Steam.

Upload Score: _____ With ID: _____
Upload a score onto a leaderboard.

Steam is Running
This can be useful if your Steam and non-Steam versions need to be different.

Player Owns Game
I assume this is for piracy protection, but it could also be used to distinguish Steam and non-Steam versions.

Account ID of Player
Get the player's account name.

Game Language
Get the game's language that users set from Steam.

Cloud Saves
While this extension does not use the API for cloud saves, you can tell Steam where the save files are located and that will allow you to use cloud saves.  After setting your byte and file quotas in the Steam Cloud Settings and saving, you'll see options to configure your save file paths.  Attached is an example of how I set up the paths for my game Isotiles so that cloud saving works on both PC and Mac.  Linux should work as well if you know the path to the save files.

SteamWrap V4
  • Fixed compilation issue with latest Stencyl 3.5 builds
  • Added 64-bit ndlls for Windows and Mac (Linux already had 64-bit)
SteamWrap V3
  • Added a block to get the game's language that users can set from Steam (PC and Mac)
SteamWrap V2
  • Reverted SDK update to fix Mac achievements

« Last Edit: June 28, 2023, 06:44:46 am by rob1221 »

LIBERADO

  • *
  • Posts: 2720
Excellent! Thank you very much, rob1221
I'm spanish, excuse me for my bad English.
I'm not a private teacher. Please, post your questions in the public forum.

iii

  • Posts: 194
Nicely done Rob & Denver. Good work.

MiscEtc

  • Posts: 162
Thanks for the extension Rob and Denver! It was really helpful.

DudeMakingAGame

  • Posts: 306
You rock Rob, thanks!

bobbyck

  • Posts: 124
Thanks.

Was extremely simple.

If you had any pointers on cloud saves as well I'd be much obliged!

rob1221

  • *
  • Posts: 9473
Steam has a feature called "auto-cloud" that doesn't require the API, so maybe that could work.

Bombini

  • *
  • Posts: 1400
Wonderful!
Will test it soonish.

rob1221

  • *
  • Posts: 9473
If you're using the GUI from Steamworks to upload your builds to Steam, you still need to run sdk/tools/ContentBuilder/builder/steamcmd.exe first, and you also need to make sure you have no spaces in the paths you setup in the GUI.

Also, leaderboards don't seem to be working and I don't know why. :(  The extension makes a call to Steam to find the leaderboard (confirmed in logs), but after that nothing happens and there's no message of any kind received from Steam.  It's like Steam doesn't get the leaderboard request, but achievements are working fine so it doesn't make any sense.  I thought it might be that leaderboards require uploading to Steam but I just did that and it's still not working.  Has anyone gotten leaderboards working using this extension?  I'd ask Denver2003 but it looks like he's abandoned the forum.

EDIT: Updating the Steam SDK did not work.  I figured out how to rebuild the extension but that isn't too useful right now because the problem happens with the communication between the game and Steam.  Disabling the firewall also made no difference.

EDIT: Finally after a deep look into the steamworks forum I find what the problem is.  After sending a message to Steam to find the leaderboard I have to call a function that runs all the callbacks.  In the extension that is handled by onEnterFrame() which I guess I overlooked as important or assumed it was being called already.  I'll either make a block for it or find a way for the extension to do it automatically.

« Last Edit: October 13, 2016, 09:22:12 am by rob1221 »

rob1221

  • *
  • Posts: 9473
The extension is updated with the latest Steamworks SDK (probably won't notice any changes), and leaderboards are now fixed.

LIBERADO

  • *
  • Posts: 2720
Fantastic! thanks.
I'm spanish, excuse me for my bad English.
I'm not a private teacher. Please, post your questions in the public forum.

Bombini

  • *
  • Posts: 1400

airman4

  • Posts: 875
Thanks a million rob, saved my  life !

rob1221

  • *
  • Posts: 9473
I did something wrong when updating the SDK and it broke Mac achievements.  Since it wasn't a necessary update anyway I decided to go back to the previous version rather than spend time trying to fix the update.  Leaderboards are still fine since that only required a change to the Haxe file.

MiscEtc

  • Posts: 162
Any idea if this works on Linux? Anyone tested it? (By the way, thanks for the extension, works great and is easy to implement on Windows)