Steamworks FFI

Showcase your libraries, tools and other projects that help your fellow love users.
artless
Prole
Posts: 6
Joined: Sat Jan 25, 2020 3:36 pm

Re: Steamworks FFI

Post by artless »

Still not working at the moment.
Error message remains the same.
(I tried both Contents/Frameworks/libsteam_api.dylib and gamefolder/Contents/Frameworks/libsteam_api.dylib)

Where should I edit, if I want to simply load dylib from game folder?
(It would be better than load from somewhere else, as it avoids installation)

Extra information:
I'm working in VM VirtualBox. Not sure if it makes the difference.
This is my first time using a Mac system. I could be making some really silly mistakes.
User avatar
ivan
Party member
Posts: 1721
Joined: Fri Mar 07, 2008 1:39 pm
Contact:

Re: Steamworks FFI

Post by ivan »

No, don't put it in the game folder, it should be in the love folder.
The game folder should be cross platform and shouldn't contain any binaries.
I'm not on a Mac but it should be under "Contents/Frameworks/" so it depends how you have Love2D setup
User avatar
ReFreezed
Party member
Posts: 218
Joined: Sun Oct 25, 2015 11:32 pm
Location: Sweden
Contact:

Re: Steamworks FFI

Post by ReFreezed »

So that would be "MyGame.app/Contents/Frameworks/" (where MyGame.app is a copy of the original love.app that you downloaded from this website).
Tools: Hot Particles, LuaPreprocess, (more)
Games: Momento Temporis: Light from the Deep, Energize!
"If each mistake being made is a new one, then progress is being made."
artless
Prole
Posts: 6
Joined: Sat Jan 25, 2020 3:36 pm

Re: Steamworks FFI

Post by artless »

It takes me a few minutes to notice Contents/Frameworks means inside love.app.

It worked.
Thanks!
User avatar
qaisjp
Party member
Posts: 491
Joined: Tue Sep 04, 2012 10:49 am
Location: United Kingdom
Contact:

Re: Steamworks FFI

Post by qaisjp »

There's no license file in the repo, so this cannot (legally) be used in any games. Please can you add a license?
Lua is not an acronym.
User avatar
ivan
Party member
Posts: 1721
Joined: Fri Mar 07, 2008 1:39 pm
Contact:

Re: Steamworks FFI

Post by ivan »

Yep, I'll include a license in the update.
It is allowed to use the library in your commercial projects as long as you provide credit to 2dengine.
User avatar
groverburger
Prole
Posts: 35
Joined: Tue Oct 30, 2018 9:27 pm

Re: Steamworks FFI

Post by groverburger »

Hey ivan, I got your Steamworks FFI to work on Windows perfectly, but on Mac I'm failing on assert(Steam.init()) only when I run the game fused as a .love file.

EDIT: on further inspection, the failure seems to occur on line 59 of api.lua, api.lib.SteamAPI_Init() is not behaving correctly. Could the api be failing to load the dylib?

EDIT EDIT: after some trial and error, putting the steam_appid.txt in the .app/Contents/MacOS seems to work!

I'm logged in to Steam, and I have my libsteam_api.dylib in my .app/Contents/Frameworks, so I think everything should be in order. I'm also using macOS Big Sur 11.1 and Steam SDK v1.5.

Any ideas?
User avatar
ivan
Party member
Posts: 1721
Joined: Fri Mar 07, 2008 1:39 pm
Contact:

Re: Steamworks FFI

Post by ivan »

Hello. I am primarily testing this library on Windows and Ubuntu. The Mac version was tested a while ago but things may have broken since then. I don't have any Mac hardware at the moment so please help me out and we can get it up and running again.

First off make sure you have the correct binaries Steamworks SDK v1.5 (looks like 1.51 is out so I will have to update it soon)
Double check that libsteam_api.dylib is in the ".app/Contents/Frameworks"
Next, make sure your Steam client is up and running before you start your game. Also make sure your AppID is set up and you have the game in your Steam library.
failure seems to occur on line 59 of api.lua, api.lib.SteamAPI_Init()
This is a very generic error so it's hard to say. The Steamworks docs say:
-The Steam client isn't running. A running Steam client is required to provide implementations of the various Steamworks interfaces.
-The Steam client couldn't determine the App ID of game. If you're running your application from the executable or debugger directly then you must have a steam_appid.txt in your game directory next to the executable, with your app ID in it and nothing else. Steam will look for this file in the current working directory. If you are running your executable from a different directory you may need to relocate the steam_appid.txt file.
-Your application is not running under the same OS user context as the Steam client, such as a different user or administration access level.
-Ensure that you own a license for the App ID on the currently active Steam account. Your game must show up in your Steam library.
-Your App ID is not completely set up, i.e. in Release State: Unavailable, or it's missing default packages.
pauljessup
Party member
Posts: 189
Joined: Wed Jul 03, 2013 4:06 am

Re: Steamworks FFI

Post by pauljessup »

I tried this library, and I get this error when I call any function from it. Running on OSX, gamve is approved on steam, app ID all set up, etc. I tried placing the steamworks dynamic link in both the .love file, the resulting app, and the folder next to it. Keep getting the same error, even when I drag and drop into Love2d to run it.
Screen Shot 2021-01-25 at 11.58.46 AM.png
Screen Shot 2021-01-25 at 11.58.46 AM.png (108.91 KiB) Viewed 5718 times
pauljessup
Party member
Posts: 189
Joined: Wed Jul 03, 2013 4:06 am

Re: Steamworks FFI

Post by pauljessup »

Update-
it looks like steam init is causing this error, and not steam.isRunning() is causing another error (saying that there is no function with that name)
Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests