One of the biggest headaches of mine was connecting Regret to Steam, since Regret is built using Adobe Air platform, I’d have to write my own Steam Wrapper. There are virtually no tutorials on how to do that, plus I suck at C++ and I don’t wanna pay anyone to do that, because I’m greedy. :C And broke...and also because when I asked for help about Steam wrapper on Twitter, no one answered. Bastards. But this is not about me.
Where was I?
Right!
I did look things up and stumbled upon FRESteamWorks project. Which is a SteamWorks API for AIR applications. In other words it’s the thingy that lets Regret talk to Steam.
Great!
I followed the simple documentation, embedded the latest .ane file, downloaded the SteamSDK from Steam partner website and it doesn’t work...
And I’ve no idea why.
Turns out there are a couple of tricks one has to do to get everything working. And I know that many are/have struggled with this. So I figured I’d write a “little” tutorial for others. Just in case.
So, step 1.
And do keep in mind, I’m on Windows, but it should be pretty much the same on Mac as well. Not gonna even mention Linux. <.<
Update Air to the latest version. In order for this to work you have to have, at least, Air 3.0.
Step 2.
Get the latest FRESteamWorks.ane - Link
Currently the latest build is - v0.5-29-gea3356b
Step 3.
Log in or register to partner.steamgames.com
Download the latest Steamworks SDK.
(You’ll only need to embed 1 file from the SDK.)
Step 4.
I’m using Flash Builder 4.6, but the process is pretty much the same with whatever IDE you’re using.
Right click on your project >> properties >> ActionScript Build Path >> Native Extensions. And add your downloaded ane file.
Step 5.
Open up -app.xml file. Upon adding the ane file, the -app.xml should be updated automagically, but just to make sure check the <extensions> tag. It should look like this:
<extensions>
<extensionID>com.amanitadesign.steam.FRESteamWorks</extensionID>
</extensions>
Next in supported profiles add the following:
<supportedProfiles>extendedDesktop</supportedProfiles>
And, finally, scroll to the RenderMode tag and set it to direct mode:
<renderMode>direct</renderMode>
We need to have “direct” render mode I.e. Hardware Acceleration, otherwise Steam Overlay won’t work.
Step 6.
Find the SteamWorks SDK that you’ve downloaded and copy steam_api.dll file from redistributable_bin folder into your project’s directory.
The second file that you’ll need is just a text file with, either your appID, or the default one that Valve provided, which is 480.
Just create a text file, name it steam_appid and put 480 in it. Save and you’re done. Keep in mind - all of these files have to be together, otherwise Steam won’t be able to figure out the appID.
Step 7. (almost done)
If you try and run in debug right meow, you should be getting an error:
Error #3500: The extension context does not have a method with the name AIRSteam_Init.
It pretty much means that everything’s embedded correctly. It just doesn’t work when you run in debug.
Step 8.
Upon release build, copy all two of the files into bin-release-temp, make sure in the Native Extensions tab, package is checked so that you actually are packaging your app with the ane file. And you’re done!
Congratulations! Good bye.
What’s that? Steam overlay isn’t working?
Well, that’s because you have to launch your app via Steam. Just installing and running your app won’t work. Sure it’ll connect, you can get/set your data, but no overlay. Amazingly enough, there’s nothing about this vital step anywhere. Not in the docs, nor comments. >.>
So, go to your Steam library >> add Non-Steam Game and run it through there.
The developer’s suggested:
steamworks.addOverlayWorkaround(stage, true);
To make your app use hardware acceleration and thus inject Steam Overlay,
didn’t do crap for me. Besides, we already enabled Hardware Acceleration, so it should’ve worked from the beginning.
Ok, now we’re done.
Potato.