love-steam - Steamworks integration for LÖVE
love-steam - Steamworks integration for LÖVE
The main motivation for this repository is to hopefully have a central solution for Steamworks integration with LÖVE. The main solution that people always point to also doesn't work because it doesn't handle Steamworks' callbacks system properly, which means that you can't use the majority of the API.
And going through the forums I'd say about 10 people released their LÖVE games on Steam and each one of them had to come up with their own way of solving the problem. This is a big waste of effort and it'd be much better if everyone could use and contribute to a single version that is used in many games. The hope for me is that everyone who wants to release their games on Steam can come to this repository and use the already implemented functions as well as contribute with implementing parts of the API that they need for their games that aren't already implemented.
https://github.com/SSYGEN/love-steam
And going through the forums I'd say about 10 people released their LÖVE games on Steam and each one of them had to come up with their own way of solving the problem. This is a big waste of effort and it'd be much better if everyone could use and contribute to a single version that is used in many games. The hope for me is that everyone who wants to release their games on Steam can come to this repository and use the already implemented functions as well as contribute with implementing parts of the API that they need for their games that aren't already implemented.
https://github.com/SSYGEN/love-steam
Re: love-steam - Steamworks integration for LÖVE
Starring your love-steam.
Thank you very much.
upd: I think that
Steam = require("love_steam")
should be moved into love.load func
Thank you very much.
upd: I think that
Steam = require("love_steam")
should be moved into love.load func
Our LÖVE Gamedev blog Zabuyaki (an open source retro beat 'em up game). Twitter: @Zabuyaki.
LÖVE & Lua Video Lessons in Russian / Видео уроки по LÖVE и Lua
LÖVE & Lua Video Lessons in Russian / Видео уроки по LÖVE и Lua
Re: love-steam - Steamworks integration for LÖVE
Great idea - we're going to release our game on Steam at some point in the future, so thanks already.
Re: love-steam - Steamworks integration for LÖVE
Awesome!! This will definitely save me a lot of headaches in the future!
Re: love-steam - Steamworks integration for LÖVE
I know nothing about C++, but I messed around with trying to get this to work in Linux. I made a small change to the code to to get it to compile, but haven't gotten it to actually work in LÖVE. I'll be looking at it more later, but here's what I have so far, as a starting place in case anyone else tries.
To get it to compile, in love_steam.cpp:
replace:
with:
I was then able to compile into an .so by using:
(You might need to install g++ to compile C++ code. It wasn't installed by default on my system)
Unfortunately, when I try to load the .so from lua, I get the error:
My guess is I'm compiling it wrong somehow.
Possibly it's not including the code from the header files? Or I might need to somehow include the libsteam_api.so that comes from Steam?
I'm not sure, and I could be totally off. Like I said, I've never actually programmed in C++.
To get it to compile, in love_steam.cpp:
replace:
Code: Select all
__declspec(dllexport)
Code: Select all
__attribute__((visibility("default")))
Code: Select all
gcc -fPIC love_steam.cpp -shared -o love_steam.so
Unfortunately, when I try to load the .so from lua, I get the error:
Code: Select all
error loading module 'love_steam' from file './love_steam.so':
./love_steam.so: undefined symbol: SteamAPI_RegisterCallback
Possibly it's not including the code from the header files? Or I might need to somehow include the libsteam_api.so that comes from Steam?
I'm not sure, and I could be totally off. Like I said, I've never actually programmed in C++.
Possession - Escape from the Nether Regions, my roguelike made in LÖVE for the 2013 7-Day Roguelike Challenge
And its sequel, simply called Possession , which is available on itch.io or Steam, and whose engine I've open-sourced!
And its sequel, simply called Possession , which is available on itch.io or Steam, and whose engine I've open-sourced!
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: love-steam - Steamworks integration for LÖVE
I would assume, considering you're setting the visibility to default, that you can simply remove the declspec, and it will work.Rickton wrote: ↑Tue Sep 04, 2018 10:02 pm replace:with:Code: Select all
__declspec(dllexport)
Code: Select all
__attribute__((visibility("default")))
You'll need to link it against the steam dynamic library. The easiest way, considering it's probably in some weird path, is simply to pass the .so file as extra argument to gcc.Rickton wrote: ↑Tue Sep 04, 2018 10:02 pm I was then able to compile into an .so by using:Unfortunately, when I try to load the .so from lua, I get the error:Code: Select all
gcc -fPIC love_steam.cpp -shared -o love_steam.so
Code: Select all
error loading module 'love_steam' from file './love_steam.so': ./love_steam.so: undefined symbol: SteamAPI_RegisterCallback
In the likely scenario it can't find the steam library when you've done that, try setting the LD_LIBRARY_PATH environment variable to steam's path. I assume it automatically gets set when launching from steam.
Re: love-steam - Steamworks integration for LÖVE
Yep, seems to.
You know, I tried to do that, tried passing the location to both -I and -L, and tried setting the LD_LIBRARY_PATH, and just couldn't get it to find the file.bartbes wrote: ↑Wed Sep 05, 2018 7:05 pm You'll need to link it against the steam dynamic library. The easiest way, considering it's probably in some weird path, is simply to pass the .so file as extra argument to gcc.
In the likely scenario it can't find the steam library when you've done that, try setting the LD_LIBRARY_PATH environment variable to steam's path. I assume it automatically gets set when launching from steam.
Then today I look again and see that when you use -l it automatically adds "lib" to the beginning, so when I tried to look for "libsteam_api" it was looking for "liblibsteam_api."
It seems to work now, thanks for the help!
Possession - Escape from the Nether Regions, my roguelike made in LÖVE for the 2013 7-Day Roguelike Challenge
And its sequel, simply called Possession , which is available on itch.io or Steam, and whose engine I've open-sourced!
And its sequel, simply called Possession , which is available on itch.io or Steam, and whose engine I've open-sourced!
- Pebsie
- Party member
- Posts: 144
- Joined: Mon Nov 11, 2013 12:35 am
- Location: Lincoln, United Kingdom
- Contact:
Re: love-steam - Steamworks integration for LÖVE
I was literally just about to have to start doing this from scratch. Thank you endlessly from the bottom of my heart
Re: love-steam - Steamworks integration for LÖVE
Btw. there is also a project called lua-steam and they provide already precompiled binaries: https://github.com/uspgamedev/luasteam
Re: love-steam - Steamworks integration for LÖVE
Thanks!SiENcE wrote: ↑Wed Oct 17, 2018 9:09 am Btw. there is also a project called lua-steam and they provide already precompiled binaries: https://github.com/uspgamedev/luasteam
Could you please explain how to make steam stats, achievements and leaderboards? For example with as-small-as-possible-example.
For example
stats: "stat_1"
achievements: "NEW_ACHIEVEMENT_1_0"
Leaderboard: "Best Time" and "High Score"
Update: found https://luasteam.readthedocs.io/en/stab ... arted.html
Place the luasteam.dll and steam_api64.dll to the Love folder: D:/Lua/love (near the lovec.exe)
See also: https://luasteam.readthedocs.io/en/stab ... stats.html
Who is online
Users browsing this forum: No registered users and 3 guests