Skip to main content
Participant
February 24, 2014
Question

Connecting to Steam

  • February 24, 2014
  • 2 replies
  • 3071 views

I am looking to potentially port my latest game Pathogen to Steam. So far I have been trying to use FRESteamWorks by Amanita Design, found here:

https://github.com/Ventero/FRESteamWorks

I built a new test application, added the FRESteamWorks.ane extension, and am just copying the example from github there, to see if I can get something to work. But my compiler can't seem to locate com.amanitadesign.steam.FRESteamWorks. I can see lots of other classes through com.amanitadesign.steam - like SteamEvent, SteamResults, LeaderboardEntry - but no FRESteamWorks class. And the entire example relies on that class.

Has anyone successfully implemented FRESteamWorks? Or are there any other ideas for Steam integration with AS3?

This topic has been closed for replies.

2 replies

Participant
September 9, 2014

Recently had exactly the same issue and the solution was very simple

make sure your app.xml file contains

<extensions>

  <extensionID>com.amanitadesign.steam.FRESteamWorks</extensionID>

</extensions>

and then lock the file so its read only.

what happens if that this file gets created everytime and might overwrite your changes everytime you compile.

sinious
Legend
September 10, 2014

That's a bit of an artifact of older versions of Flash. CS5.5 was pretty notorious for it for a while. I'd have to keep my apps XML open in an editor and resave it every time I went into publish settings to fix icons, app name, and extensions. The newer versions of flash (CS6, CC, CC 2014) don't do this anymore however as long as the ANE is packaged correctly.

sinious
Legend
February 24, 2014

Download the master off GitHub. Extract the master branch and look in this path:

FRESteamWorks-master\lib\src\com\amanitadesign\steam

All your classes are typically found in the lib/src folders. You need to make sure Flash can find that source so either point Flash to it or copy the 'com' folder to your project.

If you don't want to compile the ANE you can see they linked to older precompiled versions:

http://dump.ventero.de/FRESteamWorks/v0.4/

mattbrandAuthor
Participant
February 24, 2014

Thanks for the reply.

I tried using the precompiled ANE, and FlashBuilder 4.6 is unable to locate the FRESteamWorks class...that was my problem.

I copied in the contents of the source into my project, and now it compiles, but I get other run-time errors, when the FRESteamWorks constructor attempts to set up the ExtensionContext. I am not really sure what that is doing, so I am not really sure how to proceed from here...

Error message:

TypeError: Error #1009: Cannot access a property or method of a null object reference.

          at com.amanitadesign.steam::FRESteamWorks()

line 37: _ExtensionContext = ExtensionContext.createExtensionContext("com.amanitadesign.steam.FRESteamWorks", null);

line 38: _ExtensionContext.addEventListener(StatusEvent.STATUS, handleStatusEvent);

sinious
Legend
February 25, 2014

Are you familiar with Adobe Native Extensions? If not, here's an in-depth primer:

http://www.adobe.com/devnet/air/articles/extending-air.html

If you skip down half the page to the ActionScript code you'll see that there's 2 parts to an ANE. The ActionScript side and the native side. The native side (Java for Android, Obj-c for iOS, etc) is the language used to write a library used for functionality beyond what Adobe AIR can do itself.

Once you write your native library (the steam ANE), you need to connect it to ActionScript. That is what your code is trying to do. You gain a context (reference) to the native code so you can interact with it.

The error is telling you that for some reason it cannot correctly work with that ANE. Are you sure you have the ANE itself in your project as well as the source code? You need both, they work together.

One simple reason it might not gain context is it was compiled from a different ActionScript interface and the source code you have is newer. Once that happens you need to recompile your ANE with the latest source so the ActionScript side mirrors the native code side.

This may sound complex but, it is. The article will go a great length to help you understand how ANEs work. You may have to recompile the native side again and create the ANE to get it to work.