uspgamedev / luasteam Goto Github PK
View Code? Open in Web Editor NEWBindings to connect lua with Steam API
Home Page: https://luasteam.readthedocs.io/en/stable/
License: MIT License
Bindings to connect lua with Steam API
Home Page: https://luasteam.readthedocs.io/en/stable/
License: MIT License
Hi! I managed to get luasteam working properly with all of it's features fully running, but for some odd reason the game overlay just wont show up. I'm on Ubuntu 22.04 with the latest luasteam version.
Here's my source code:
local Steam = require "luasteam"
function love.load()
Steam.init()
love.window.setMode(1920, 1080)
love.window.setFullscreen(true)
print("Steam level: " .. Steam.user.getPlayerSteamLevel())
Steam.friends.activateGameOverlay('stats')
end
function Steam.friends.onGameOverlayActivated(data)
if data.active then
print("Steam overlay now active")
else
print("Steam overlay now inactive")
Steam.friends.activateGameOverlay('stats')
end
end
function love.update(dt)
Steam.runCallbacks()
end
function love.draw()
love.graphics.setBackgroundColor(1, 1, 1)
love.graphics.setColor(0, 0, 0)
love.graphics.print('Hello World!', 0, 0)
end
function love.quit()
Steam.shutdown()
end
and here is the command line output when I run it:
[S_API] SteamAPI_Init(): Loaded '/home/gungu/.steam/debian-installation/linux64/steamclient.so' OK.
Setting breakpad minidump AppID = 2457300
SteamInternal_SetMinidumpSteamID: Caching Steam ID: 76561199029178397 [API loaded no]
Steam level: 10
and just because it might help, here is what my lua file's directory contains:
data libsteam_api.so luasteam.so main.lua steam_appid.txt
Would be a really neat addition to add this, doc link: https://partner.steamgames.com/doc/api/ISteamFriends#GetPersonaName
Returns the current steam users username
(sorry if this is the wrong place to put this)
Hi there, would it be possible to add the Invite To Game feature that can be used in the Friends overlay to invite a friend to a game? As far as I understood, there are three functions and one callback that would enable this in Luasteam.
functions:
ActivateGameOverlayInviteDialog (https://partner.steamgames.com/doc/api/ISteamFriends#ActivateGameOverlayInviteDialog)
InviteUserToGame
(https://partner.steamgames.com/doc/api/ISteamFriends#InviteUserToGame)
GetLaunchCommandLine
(https://partner.steamgames.com/doc/api/ISteamApps#GetLaunchCommandLine)
callbacks:
GameRichPresenceJoinRequested_t
(https://partner.steamgames.com/doc/api/ISteamFriends#GameRichPresenceJoinRequested_t)
Here's my code. I would expect userStatsReceived
to be called eventually, and onGameOverlayActivated
to be called whenever I open and close the team overlay, but neither happen for me. Is there something I'm doing wrong? I've tested this with Steamwork SDK 1.42 and SDK 1.44, both behave identically.
Despite all this, I'm still able to execute setAchievement
, getAchievement
, storeStats
, and resetAllStats
, and they all appear to work in real time.
Thank you.
local Steam = require 'luasteam'
function love.load()
Steam.init()
Steam.userStats.requestCurrentStats()
end
-- This never gets triggered!!
function Steam.userStats.userStatsReceived(...)
print('userStatsReceived')
print(...)
end
-- Activating and Deactivating the game overlay does not trigger this.
function Steam.userStats.onGameOverlayActivated(data)
print("Steam overlay is now " .. (data.active and "active" or "inactive"))
end
function love.update()
Steam.runCallbacks()
end
function love.quit()
-- prints:
-- Setting breakpad minidump AppID = 1040490
-- Steam_SetMinidumpSteamID: Caching Steam ID: 76561197967143787 [API loaded no]
Steam.shutdown()
end
When downloading this codebase and following the luasteam instructions....
Download the correct binary for your platform and rename it to simply
luasteam.ext
.
... and renaming to luasteam.ext
, the library is not found:
Error
engine/external/init.lua:7: module 'luasteam' not found:
no field package.preload['luasteam']
no 'luasteam' in LOVE game directories.
no file 'luasteam' in LOVE paths.
no file './luasteam.lua'
no file '/usr/local/share/luajit-2.0.5/luasteam.lua'
no file '/usr/local/share/lua/5.1/luasteam.lua'
no file '/usr/local/share/lua/5.1/luasteam/init.lua'
no file './luasteam.so'
no file '/usr/local/lib/lua/5.1/luasteam.so'
no file '/usr/local/lib/lua/5.1/loadall.so'
Traceback
[C]: in function 'require'
engine/external/init.lua:7: in main chunk
[C]: in function 'require'
engine/init.lua:5: in main chunk
[C]: in function 'require'
main.lua:1: in main chunk
[C]: in function 'require'
[C]: in function 'xpcall'
[C]: in function 'xpcall'
This appears to be verified by third parties as per the comments in issue #14.
Renaming to luasteam.so
appears to work better (also as per those comments), however still yields the error:
Error
error loading module 'luasteam' from file './luasteam.so':
dlopen(./luasteam.so, 6): no suitable image found. Did find:
file system relative paths not allowed in hardened programs
Traceback
[C]: at 0x010927c740
[C]: in function 'require'
engine/external/init.lua:7: in main chunk
[C]: in function 'require'
engine/init.lua:5: in main chunk
[C]: in function 'require'
main.lua:1: in main chunk
[C]: in function 'require'
[C]: in function 'xpcall'
[C]: in function 'xpcall'
As per this suggestion hack cpath
.
local windows = package.config:sub(1, 1) == '\\'
package.cpath = string.format("%s;%s/?.%s", package.cpath, love.filesystem.getSourceBaseDirectory(), (windows and "dll" or "so"))
Didn't work, same error as above.
Can't use library following documentation's instructions on OSX. This is different to the other issue #14, which is about releasing on OSX.
ISteamUser::GetAuthSessionTicket
now takes an extra parameter: const SteamNetworkingIdentity *pIdentityRemote
.
"The identity of the remote system that will authenticate the ticket. If it is peer-to-peer then the user steam ID. If it is a game server, then the game server steam ID may be used if it was obtained from a trusted 3rd party, otherwise use the IP address. If it is a service, a string identifier of that service if one if provided."
HAuthTicket GetAuthSessionTicket( void *pTicket, int cbMaxTicket, uint32 *pcbTicket, const SteamNetworkingIdentity *pIdentityRemote );
I'm not much of a C++ person which is why i am writing this
I am currently working a better workshop helper tool for SCP Containment Breach Multiplayer, take gmpublisher (Garry's Mod workshop assistant tool) as an example. Not only would these be helpful for other people, it would also further enhance what this library can do
For this particular project, a permissive license such as MIT is more suitable.
The example for the sendMessageToConnection function given in the documentation is:
local result = Steam.networkingSockets.sendMessageToConnection(connection, "Ping", Steam.networkingSockets.flags.Reliable)
Shouldnt the flag key be Send_Reliable instead of just Reliable ?
Hey :)
Is it possible to implement these functions?
Could u please help me? I dont really know to write the code...
For example: ISteamUser::GetAuthSessionTicket returns HAuthTicket. What kind of return value would that be in luasteam?
Thanks in advance and happy new year! :D
I have trouble bundling my Love2D game on macOS. I include luasteam.so
and then
dlopen(./luasteam.so, 6): Library not loaded: /usr/local/opt/luajit/lib/libluajit-5.1.2.dylib
Referenced from: /Users/andras/dev/terraforming-earth.git/luasteam.so
Reason: image not found
Of course, if I install luajit with homebrew, it works fine, but I can't expect players to do so.
Love2d already includes luajit 2.0.5
, so there shouldn't be a problem theoretically, we're just looking for it in the wrong place? What am I doing wrong?
I had a look on your documentation and wasnt able to see network functions.
Does your wrapper provide steam network api stuff like https://github.com/ValveSoftware/GameNetworkingSockets ( https://partner.steamgames.com/doc/features/multiplayer/networking ) ?
If I would be able to use C++, I would create a PR, but I never worked with C++
That would be super nice to have.
Stuff to add:
Hey is it possible to cut a new release since the locale changes went in?
Thanks!
Hello! First off this project has saved me and my team a phenomenal amount of time, so thank you for that.
I was wondering if there are plans to add getting / setting of stats?
Whenever I attempt to require luasteam.so I get the following error.
Error
error loading module 'luasteam' from file './luasteam.so':
libsteam_api.so: cannot open shared object file: No such file or directory
Traceback
[C]: at 0x7f86e885f310
[C]: in function 'require'
main.lua:2: in main chunk
[C]: in function 'require'
[C]: in function 'xpcall'
[C]: in function 'xpcall'
My OS is Ubuntu Linux 64 bit.
In my current configuration I have luasteam.so and libsteam_api.so sitting in the root game folder with main.lua.
I am requiring luasteam with
steam = require 'luasteam'
I have tried the pre compiled luasteam as well as compiling it myself with Lua 5.1 .h files. I have tried putting libsteam_api in the root folder as well as the save folder and the normal sdk folder, all with the same error.
I am using the latest release of the Steamworks SDK as of November 11th. Any tips?
Thank you,
Hello! I am trying to build my game for release on macos. Following the 'Creating a macOS Application' steps here: https://love2d.org/wiki/Game_Distribution
My game runs fine before building, but if I try to run the actual built game I get the follow error:
Error
main.lua:1: module 'luasteam' not found:
no field package.preload['luasteam']
no 'luasteam' in LOVE game directories.
no file 'luasteam' in LOVE paths.
no file './luasteam.lua'
no file '/usr/local/share/luajit-2.0.5/luasteam.lua'
no file '/usr/local/share/lua/5.1/luasteam.lua'
no file '/usr/local/share/lua/5.1/luasteam/init.lua'
no file './luasteam.so'
no file '/usr/local/lib/lua/5.1/luasteam.so'
no file '/usr/local/lib/lua/5.1/loadall.so'
Traceback
[C]: in function 'require'
main.lua:1: in main chunk
[C]: in function 'require'
[C]: in function 'xpcall'
[C]: in function 'xpcall'
I have tried placing the luasteam.so in the different directories inside my game, but to no avail.
I think this has something to do with how love is loading (or not loading) libraries in fused mode, but I am a bit stumped as to how to proceed from here.
I want to be able to scan a users steam library.
https://developer.valvesoftware.com/wiki/Steam_Web_API#GetOwnedGames_.28v0001.29
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.