Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Showcase / Steam API Plugin

Author
Message
adambiser
AGK Developer
3
Years of Service
User Offline
Joined: 16th Sep 2015
Location: US
Posted: 10th Jan 2018 17:31
Yeah, there is so much involved with the game server/multiplayer stuff. I've never played any multiplayer games through Steam, so I have to look into how it does things. The Spacewar sample code they include with the SDK is helpful though.

Simply exporting direct access to the API functions doesn't seem like an acceptable solution. I want to make it as easy as possible to use outside the plugin, but that means that all the hard stuff is inside the plugin. I had hoped that I could skip some of the networking stuff since AppGameKit has some networking/socket functionality, but that might not be the case.

I have no estimate or guess as to when the game server/multiplayer stuff will be done.
IBOL
Moderator
14
Years of Service
User Offline
Joined: 30th Mar 2004
Location: @IBOL17
Posted: 22nd Jan 2018 20:55
is there any handling for DLC?

like, GetSteamDLCOwned() ? , something?

Thanks,

Bob
adambiser
AGK Developer
3
Years of Service
User Offline
Joined: 16th Sep 2015
Location: US
Posted: 24th Jan 2018 06:14
@IBOL: I will look into adding it soon.
(Sorry for the late reply, forum email notifications aren't working for me.)
IBOL
Moderator
14
Years of Service
User Offline
Joined: 30th Mar 2004
Location: @IBOL17
Posted: 24th Jan 2018 14:25
Thanks a lot, i hope that would be much easier than all that multiplayer stuff
adambiser
AGK Developer
3
Years of Service
User Offline
Joined: 16th Sep 2015
Location: US
Posted: 25th Jan 2018 04:34
Considerably easier.
Have the code done, but need to add information about all the new commands to the wiki.
adambiser
AGK Developer
3
Years of Service
User Offline
Joined: 16th Sep 2015
Location: US
Posted: 25th Jan 2018 06:12 Edited at: 25th Jan 2018 06:14
OK, v1.4 of the plugin is up and includes app and DLC-related commands from ISteamApps.
A DLC example project has been added and the wiki has been updated with the new commands.

Added Commands
IsVACBanned
GetAppBuildID, GetCurrentBetaName, GetAvailableGameLanguages, GetCurrentGameLanguage, IsAppInstalled, GetAppInstallDir, GetAppOwner, GetEarliestPurchaseUnixTime, GetInstalledDepotsJSON
GetLaunchQueryParam, HasNewLaunchQueryParameters
IsCybercafe, IsLowViolence, IsSubscribed, IsSubscribedApp, IsSubscribedFromFreeWeekend, MarkContentCorrupt
IsDLCInstalled, GetDLCDataJSON, GetDLCCount, GetDLCDataByIndexJSON, InstallDLC, UninstallDLC, GetDLCDownloadProgressJSON, HasNewDLCInstalled, GetNewDLCInstalled

@IBOL: The is no direct "GetSteamDLCOwned".
If you just want to see if DLC is installed, use IsDLCInstalled with the DLC App ID.
If you want to see if the current user owns it (installed or not), use GetDLCDataJSON, find the index with the matching DLC App ID and check the Available value. If 1, it's owned, 0 means not owned.

This can't be tested with Spaceware/App 480. It has two DLC packages (plus a hidden one), but they can't be installed (says I don't own them and can't figure out how to add them to my account).
IBOL
Moderator
14
Years of Service
User Offline
Joined: 30th Mar 2004
Location: @IBOL17
Posted: 26th Jan 2018 14:31
Wow, that's great, and super fast. When i switch gears again i will let you know if it's working on my end. Thank you!!!
adambiser
AGK Developer
3
Years of Service
User Offline
Joined: 16th Sep 2015
Location: US
Posted: 26th Jan 2018 19:13 Edited at: 26th Jan 2018 19:14
You're welcome. The example project should show you how it can be used.

I'll have another little update with some new commands soon.

The Game Server stuff is very daunting. It looks like it will be very difficult to come up with a simple interface for it that will cover most of the main features.
adambiser
AGK Developer
3
Years of Service
User Offline
Joined: 16th Sep 2015
Location: US
Posted: 28th Jan 2018 03:15
Another set of commands, these are utility methods and might not be useful to very many.

// Utility methods.
GetCurrentBatteryPower, HasLowBatteryWarning, GetMinutesBatteryLeft
GetIPCCallCount
GetIPCountry, HasIPCountryChanged
GetSecondsSinceAppActive, GetSecondsSinceComputerActive, GetServerRealTime, GetSteamUILanguage
IsOverlayEnabled, SetOverlayNotificationInset, SetOverlayNotificationPosition
IsSteamShuttingDown, SetWarningMessageHook

// Big Picture Mode:
IsSteamInBigPictureMode
ShowGamepadTextInput
HasGamepadTextInputDismissedInfo
GetGamepadTextInputDismissedInfoJSON

// VR Stuff:
IsSteamRunningInVR
StartVRDashboard
SetVRHeadsetStreamingEnabled
IsVRHeadsetStreamingEnabled
IBOL
Moderator
14
Years of Service
User Offline
Joined: 30th Mar 2004
Location: @IBOL17
Posted: 6th Feb 2018 14:48
Adam, as far as i can tell, the steam DLC "checker" command is working. I am using it just to check with steam whether a user has purchased a DLC or not, and it works, so great, wow, thanks!
Supertino
1
Years of Service
User Offline
Joined: 22nd Jun 2017
Location: Behind you!
Posted: 7th Feb 2018 11:43
Before long this plugin will be making me tea in the morning.
adambiser
AGK Developer
3
Years of Service
User Offline
Joined: 16th Sep 2015
Location: US
Posted: 7th Feb 2018 17:34
@IBOL: Good to hear. i had checked it as well, but always good to get a confirmation from someone else.

@Supertino: Might be faster than the game server stuff. Actually, I have been busy with something else and haven't had the chance to look into it further.
PSY
Valued Member
2
Years of Service
Recently Online
Joined: 3rd Jul 2016
Location: Laniakea Supercluster
Posted: 20th Mar 2018 19:59 Edited at: 23rd Mar 2018 18:12
Quote: "Yeah, there is so much involved with the game server/multiplayer stuff. I've never played any multiplayer games through Steam, so I have to look into how it does things."

Would be outstanding if this worked some day

I have a really cool project on ice, because I need Steam multiplayer features for it


PSY LABS Games
Coders don't die, they just gosub without return
adambiser
AGK Developer
3
Years of Service
User Offline
Joined: 16th Sep 2015
Location: US
Posted: 21st Mar 2018 00:53
@PSY: I've got a few things to work on at the moment (currently finishing up some music compositions for a game demo), but I'll try to take a look at this again soon. It definitely would be a pretty cool thing to have.
PSY
Valued Member
2
Years of Service
Recently Online
Joined: 3rd Jul 2016
Location: Laniakea Supercluster
Posted: 23rd Mar 2018 18:11
@adambiser
Absolutely spiffing
Looking forward to it


PSY LABS Games
Coders don't die, they just gosub without return
Digital Awakening
AGK Developer
16
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 2nd Apr 2018 09:47
Wow, you are still adding more cool features to this

Today I am finally trying to get the plugin working and I am getting an error:



Could it be because I am not running the latest version of AGK2? Seems like the AppGameKit downloads aren't working at the moment so I can't test this.
adambiser
AGK Developer
3
Years of Service
User Offline
Joined: 16th Sep 2015
Location: US
Posted: 2nd Apr 2018 20:22 Edited at: 2nd Apr 2018 20:23
@Digital Awakening:
What version of AGK2 are you using? 2017.09.25? That version introduced that function and several others, but with a typo (Impluse instead of Impulse).

I should probably trim down the number of AppGameKit functions the plugin finds. The plugin example code, which this plugin uses, imports all AppGameKit functions and this really only uses 10 at most.

EDIT: Interesting. The forum changes "AGK" to "AppGameKit".
adambiser
AGK Developer
3
Years of Service
User Offline
Joined: 16th Sep 2015
Location: US
Posted: 2nd Apr 2018 22:05
@Digital Awakening: I've updated the code and DLL in the github repo to only import AppGameKit functions that are used by the plugin. Please try this version and let me know whether it works for you.
Digital Awakening
AGK Developer
16
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 3rd Apr 2018 06:39
Thanks Adam, that works. Probably a good idea to limit the number of commands it relies on for future compatibility as well

I run the game from within the IDE and both of these prints out 0:
print (Steam.SteamInitialized())
print (Steam.GetAppID())

I there something I am not doing correctly?

I got these two lines at the beginning of my code
#import_plugin SteamPlugin As Steam
Steam.Init()

I have both steam_api.dll and steam_appid.txt write protected in the project folder.
adambiser
AGK Developer
3
Years of Service
User Offline
Joined: 16th Sep 2015
Location: US
Posted: 3rd Apr 2018 15:39
Is the Steam client running? Are you logged in or in offline mode?

Also, Steam.Init returns an integer "bool" and you might want to store that value and check it before calling plugin commands if you ever SetErrorMode to 2, otherwise you'll get "Steam API has not been initialized." errors if Init failed for some reason. If you don't change SetErrorMode, no need to worry.
Digital Awakening
AGK Developer
16
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 3rd Apr 2018 17:40
Yes, Steam is running and I am logged in.
Steam.Init returns 0.
I am not using SetErrorMode.
adambiser
AGK Developer
3
Years of Service
User Offline
Joined: 16th Sep 2015
Location: US
Posted: 3rd Apr 2018 17:52
Are you running the IDE from Steam?
Have you tried the plugin example projects? Do they also report 0?
Digital Awakening
AGK Developer
16
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 3rd Apr 2018 19:37 Edited at: 3rd Apr 2018 19:39
When I use the app ID 480 it works just fine but I have triple checked my own app ID.

Is there a step I am missing, some setting in Steam?
Digital Awakening
AGK Developer
16
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 3rd Apr 2018 19:46 Edited at: 3rd Apr 2018 19:49
Using SetErrorMode(2) shows that the API hasn't been initialized.
adambiser
AGK Developer
3
Years of Service
User Offline
Joined: 16th Sep 2015
Location: US
Posted: 3rd Apr 2018 19:54 Edited at: 3rd Apr 2018 19:57
When you say that you used app ID 480, do you mean that you used that app ID with your game code or that you are tried the project sample code?

If you use your game's app ID in the project sample code, does it work there?

EDIT: Check the false conditions here and see if any apply to your game:
https://partner.steamgames.com/doc/api/steam_api#SteamAPI_Init
Digital Awakening
AGK Developer
16
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 3rd Apr 2018 20:16
I tried putting 480 into my steam_appid.txt and it worked. Now I also tried doing it with my demo ID and that also worked.
Same results when using 480, game and demo IDs in an example.

It could be that I have unsaved changes in my app settings on Steam.
I got all my Achievements set up but I haven't published those changes because I don't want them showing up on Steam when they don't work yet.
Digital Awakening
AGK Developer
16
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 3rd Apr 2018 20:34
Tried publishing my changes and still no luck. It works just fine with the app ID of my demo. The little Steam notification pops upp in the bottom right corner and everything.
Digital Awakening
AGK Developer
16
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 3rd Apr 2018 20:41
Finally found the problem!

I was logged into my personal account that doesn't own the game. When I switched to my company account it works fine

Sorry for causing so much trouble!
adambiser
AGK Developer
3
Years of Service
User Offline
Joined: 16th Sep 2015
Location: US
Digital Awakening
AGK Developer
16
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 8th Apr 2018 14:38
I am having some problems with StoreStats().

It only returns 1 the first time I call it. Then I have to turn off the game to get achievement notifications from Steam.

It doesn't work at all after I use ResetAllStats(1).

I have tried using RequestStats() but still no luck.
Digital Awakening
AGK Developer
16
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 10th Apr 2018 06:48
After looking at your example I found out that I had to use Steam.RunCallbacks() every frame. And now it works

You might want to put that somewhere easy to spot in the achievements section of your documentation
adambiser
AGK Developer
3
Years of Service
User Offline
Joined: 16th Sep 2015
Location: US
Posted: 10th Apr 2018 08:15
@Digital Awakening: Glad you were able to figure it out. I was away and I haven't been getting email notifications from this forum lately either for some reason.

I'll edit some of the wiki pages to include reminders for calling RunCallbacks each frame.
Digital Awakening
AGK Developer
16
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 15th Apr 2018 16:03
I just released a new version of Rush to Adventure on Steam with your plugin. As a thank you I made a donation and also emailed you a free Steam key
adambiser
AGK Developer
3
Years of Service
User Offline
Joined: 16th Sep 2015
Location: US
Posted: 15th Apr 2018 17:47

Login to post a reply

Server time is: 2018-09-21 20:10:00
Your offset time is: 2018-09-21 20:10:00