playMaker

Author Topic: Steamworks.NET  (Read 77361 times)

terri

  • Sr. Member
  • ****
  • Posts: 386
    • terrivellmann.tumblr.com
Re: Steamworks.NET
« Reply #75 on: May 04, 2017, 05:22:38 PM »
i got the achievements to work and I have it where it is saving scores to the leaderboard.

Does anyone know how to retrieve the leaderboard scores and display them?

I would pay good money for this.

I originally hired the creator of Steamworks.NET for the first actions made for this, so you could probably pay him to create any actions you need.

BDFgames

  • Playmaker Newbie
  • *
  • Posts: 36
Re: Steamworks.NET
« Reply #76 on: May 04, 2017, 05:47:49 PM »
"i got the achievements to work and I have it where it is saving scores to the leaderboard."

Nice one. Mind sharing a screenshot of your leaderboard saving state? Mine works, but only intermittently, so I'm guessing I've done something wrong.  :(

"Does anyone know how to retrieve the leaderboard scores and display them?"

It seems to be currently not possible to display the leaderboard in-game using the Playmaker Steamworks actions. The action scripts need to be revisited to enable this.

iEpic

  • Playmaker Newbie
  • *
  • Posts: 48
    • IndieGamerWorld
Re: Steamworks.NET
« Reply #77 on: May 04, 2017, 05:58:41 PM »
It's working for INTs but I'm not sure how to upload it as a float or in a minute:seconds format.

BDFgames

  • Playmaker Newbie
  • *
  • Posts: 36
Re: Steamworks.NET
« Reply #78 on: May 04, 2017, 06:03:40 PM »
Thanks for sharing. Very simple -- I must be trying too hard with mine or something, as mine only works now and then.  :)

I'm pretty sure the Upload Score action only takes Integers right now. Someone would need to create a version for other formats the Steam Leaderboards will accept.

If there are any expert Action script coders interested in taking this on, I'd be interested in putting some cash into such an engagement too.  :)

ermak

  • Junior Playmaker
  • **
  • Posts: 60
    • AL Games
Re: Steamworks.NET
« Reply #79 on: August 02, 2017, 08:02:09 AM »
Here have one C# script for "Get scores from leaderboard" but the creator missing something and he don't know where exactly is downloaded score data. If anyone can help with this...
http://answers.unity3d.com/questions/1352472/steamworksnet-unity-c-leaderboards.html

========================================

Also is very important to add this line, if you want Achivments to unlock in-game and not only if you quit the game. Thanks to ManicMinerUK for that hint!

Line:
SteamUserStats.StoreStats()

So, my SteamAchievementUnlock.cs script currently is this and Achievements are unlocking in-game:

Quote
// Created by Riley Labrecque for Digital Devolver and Terri Vellmann
// (c) 2014
using UnityEngine;
using Steamworks;

namespace HutongGames.PlayMaker.Actions
{
   [ActionCategory("steamworks.NET")]
   [Tooltip("Unlocks an Achievement by name.")]
   public class SteamAchievementUnlock : FsmStateAction
   {
      [RequiredField]
      [Tooltip("Achievement name.")]
      public FsmString achievementId;

      [UIHint(UIHint.Variable)]
      [Tooltip("Returns true on success, false on failure.")]
      public FsmBool success;

      public override void Reset()
      {
         achievementId = null;
         success = null;
      }

      public override void OnEnter()
      {
         success.Value = SteamManager.StatsAndAchievements.UnlockAchievement(achievementId.Value);   
         SteamUserStats.StoreStats ();  // ADD THIS LINE
      }
   }
}


With this line Achievements showing in Unity Editor too, but you must be loged in your Steam app (username account with access to Steamworks page).
Also don't forget after creating Achievements on Steamworks page, to publish your changes and reload your Steam app and Unity program.

========================================

Can anyone give me example picture of FSM how to setup and work with these actions: Steam Stats Setup, Steam Stat Set, Steam Stat Get. I can't figure out how to work with this. Unity showing error "can't find stat with that name", but "Steam Stats Setup" action must be only INT or FLOAT and my stat API Name is STRING (on steamworks developer page https://partner.steamgames.com) ?

Thanks!
« Last Edit: August 02, 2017, 08:49:46 AM by ermak »

evmo

  • Playmaker Newbie
  • *
  • Posts: 21
Re: Steamworks.NET
« Reply #80 on: November 14, 2017, 12:53:15 AM »
Hey All,

I've got steamworks.NET all setup with the actions installed.

I've followed everyone's examples and got the app ID entered. Everything seems to be working, no errors and the console is putting out the following messages:

New Score of 420 uploaded to leaderboard: High Scores
UnityEngine.Debug:Log(Object)

OnScoreUploaded 1 - 0
UnityEngine.Debug:Log(Object)

Nothing is appearing in the leaderboard though.

Am I missing something?

ermak

  • Junior Playmaker
  • **
  • Posts: 60
    • AL Games
Re: Steamworks.NET
« Reply #81 on: November 15, 2017, 03:08:38 AM »
Hey All,

I've got steamworks.NET all setup with the actions installed.

I've followed everyone's examples and got the app ID entered. Everything seems to be working, no errors and the console is putting out the following messages:

New Score of 420 uploaded to leaderboard: High Scores
UnityEngine.Debug:Log(Object)

OnScoreUploaded 1 - 0
UnityEngine.Debug:Log(Object)

Nothing is appearing in the leaderboard though.

Am I missing something?

If I remember right (because I dont work with Unity from a while)

1. You must see in the log:
OnScoreUploaded 1 - 1 (Score is uploaded)
If you see:
OnScoreUploaded 1 - 0 (Score is not uploaded)

2. You must send only bigger score not equal or smaller of the current recorded score on steam. Example: upload: 2, 5, 10 , 12 ... this is fine.
If you upload 10, 15 and after this again 15 or 14 , 12 ... this is not fine.

3. Make your Leaderboard in your Steamworks account like this:

Name: What you want
Community Name: What you want
Sort Method: Descending (this is very important)
Display Type: Numeric

4. If I remember right (from Steam docs)... You can upload/send only 10 scores for 10 minutes interval. TIhis is steam limitation for optimisation purpose. So, if you upload the right numbers, but very often... again you will see:
OnScoreUploaded 1 - 0

Good Luck!

evmo

  • Playmaker Newbie
  • *
  • Posts: 21
Re: Steamworks.NET
« Reply #82 on: November 15, 2017, 01:59:30 PM »
Hey All,

I've got steamworks.NET all setup with the actions installed.

I've followed everyone's examples and got the app ID entered. Everything seems to be working, no errors and the console is putting out the following messages:

New Score of 420 uploaded to leaderboard: High Scores
UnityEngine.Debug:Log(Object)

OnScoreUploaded 1 - 0
UnityEngine.Debug:Log(Object)

Nothing is appearing in the leaderboard though.

Am I missing something?

If I remember right (because I dont work with Unity from a while)

1. You must see in the log:
OnScoreUploaded 1 - 1 (Score is uploaded)
If you see:
OnScoreUploaded 1 - 0 (Score is not uploaded)

2. You must send only bigger score not equal or smaller of the current recorded score on steam. Example: upload: 2, 5, 10 , 12 ... this is fine.
If you upload 10, 15 and after this again 15 or 14 , 12 ... this is not fine.

3. Make your Leaderboard in your Steamworks account like this:

Name: What you want
Community Name: What you want
Sort Method: Descending (this is very important)
Display Type: Numeric

4. If I remember right (from Steam docs)... You can upload/send only 10 scores for 10 minutes interval. TIhis is steam limitation for optimisation purpose. So, if you upload the right numbers, but very often... again you will see:
OnScoreUploaded 1 - 0

Good Luck!

I've been told that the build must be uploaded to Steam for this to work? I've only been trying it locally so far...I'm shown as being in the game when I test so it is talking to Steam.

I set my leaderboard up just as you show it in your example so that should be correct.

Will upload a build tonight and see it works.

Never tried to use any Steam services before so this is all new to me, I appreciate the help!
« Last Edit: November 15, 2017, 02:02:05 PM by evmo »

evmo

  • Playmaker Newbie
  • *
  • Posts: 21
Re: Steamworks.NET
« Reply #83 on: November 15, 2017, 11:07:40 PM »
Success!  I have scores in my leaderboard!

I just missed the part about it needing to be played through Steam which in hindsight is totally obvious.... ::)

Thanks for the help everyone.

terri

  • Sr. Member
  • ****
  • Posts: 386
    • terrivellmann.tumblr.com
Re: Steamworks.NET
« Reply #84 on: November 21, 2017, 08:51:49 AM »
I don't think the build needs to be on Steam, but Steam does need to be online

Neikke

  • Full Member
  • ***
  • Posts: 134
Re: Steamworks.NET
« Reply #85 on: January 01, 2018, 06:30:13 AM »
Hi,

I don't quite understand how do I actually list all players' scores in some UI window or smth like that.. All examples I found show how they do it using Debug.Log as an example. But how to actually list, let's say 100 scores in some UI window after I press some UI button? Thanks in advance!

clandestine

  • Sr. Member
  • ****
  • Posts: 255
    • ЯKD.ZONE
Re: Steamworks.NET
« Reply #86 on: January 01, 2018, 01:08:21 PM »
I never figured out how to do this with the steamworks.net actions. I'll try some of those assets (this one is the cheapest) and see what happens.

Neikke

  • Full Member
  • ***
  • Posts: 134
Re: Steamworks.NET
« Reply #87 on: January 05, 2018, 10:51:35 AM »
I never figured out how to do this with the steamworks.net actions. I'll try some of those assets (this one is the cheapest) and see what happens.

Yeah I bought this one from Asset Store and it seems to be very cool thing but I struggle with implementation - but that's because I;m not a coder. But there are comments from guys that it's super easy thing if you can code of course.

terri

  • Sr. Member
  • ****
  • Posts: 386
    • terrivellmann.tumblr.com
Re: Steamworks.NET
« Reply #88 on: January 15, 2018, 06:45:42 AM »
I know its not what you want exactly, but you can use this and link it to your game's leaderboard URL

markadet

  • Playmaker Newbie
  • *
  • Posts: 20
Re: Steamworks.NET
« Reply #89 on: January 24, 2018, 05:14:58 PM »
I have the same problem than ManicMiner here:

I'm also using this set of actions, and I think I've found a fairly clear-cut problem with the "Steam Unlock Achievement" action.

I'm using it, and it DOES award the achievements.. however you only get notifications for it after you close the game.

The Steamworks.NET FAQ mentions this problem specifically, and says "This is most likely caused by not calling SteamAPI.RunCallbacks() in your game or not calling SteamUserStats.StoreStats() after you set an achievement."

He later said he fixed it here:

In the end we fixed it by just pasting "SteamUserStats.StoreStats();" into the unlock achievement action - I can't say I know enough coding to say if that's a GOOD solution or not, but it seems to be working so far?

How could I do that? I don't know the C# syntax enough to do this surely (and doing a lot of tests would be very long because it has to be tested as a build on Steam...)

FYI : here is the action:
Code: [Select]
// Created by Riley Labrecque for Digital Devolver and Terri Vellmann
// (c) 2014
using UnityEngine;
using Steamworks;

namespace HutongGames.PlayMaker.Actions
{
[ActionCategory("steamworks.NET")]
[Tooltip("Unlocks an Achievement by name.")]
public class SteamAchievementUnlock : FsmStateAction
{
[RequiredField]
[Tooltip("Achievement name.")]
public FsmString achievementId;

[UIHint(UIHint.Variable)]
[Tooltip("Returns true on success, false on failure.")]
public FsmBool success;

public override void Reset()
{
achievementId = null;
success = null;
}

public override void OnEnter()
{
success.Value = SteamManager.StatsAndAchievements.UnlockAchievement(achievementId.Value);
}
}
}
« Last Edit: January 24, 2018, 05:20:44 PM by markadet »