Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

[Steamworks] Game shows "Spacewars" in Editor but correct game if started via Steam

Discussion in 'Scripting' started by etaxi341, Jun 28, 2017.

  1. etaxi341

    etaxi341

    Joined:
    Oct 4, 2013
    Posts:
    64
    Hey community! Everytime I start my game in the Editor it says on Steam that I am playing Spacewars. But when I start it via Steam it says the correct title.
    I have changed all my AppIDs correctly.
    Please Help.

    Thank you! :)
     
  2. Scabbage

    Scabbage

    Joined:
    Dec 11, 2014
    Posts:
    268
    Hmm, that's odd. As long as the id is set in steam_appid.txt it should give the correct title in the editor. Do steam function calls all operate normally?
     
  3. etaxi341

    etaxi341

    Joined:
    Oct 4, 2013
    Posts:
    64
    Well I can use every function that works with the ID 480. But for example I cannot invite to lobbies of my game via Editor because it invites the users to Spacewars then.

    There is no file left in my Unity Project that contains the ID 480
     
  4. etaxi341

    etaxi341

    Joined:
    Oct 4, 2013
    Posts:
    64
  5. etaxi341

    etaxi341

    Joined:
    Oct 4, 2013
    Posts:
    64
    Fixed it by reimporting SteamWorks
     
  6. HonoraryBob

    HonoraryBob

    Joined:
    May 26, 2011
    Posts:
    1,214
    I'm having the same problem, but reimporting Steamworks didn't solve it. Do you know of any other way to fix it?
     
    Last edited: Apr 12, 2018
  7. etaxi341

    etaxi341

    Joined:
    Oct 4, 2013
    Posts:
    64
    Make sure the steam_appid.txt in the folder above your unity folder has the correct id. Its not in the Unity Project. Its one folder above.
     
  8. HonoraryBob

    HonoraryBob

    Joined:
    May 26, 2011
    Posts:
    1,214
    I have two files with that name, and it seems that both need to be changed for it to work, and then you need to restart Unity. It now acknowledges the correct game, but I can't set any achievements for that game. I'm using the usual code:

    Code (CSharp):
    1. SteamUserStats.SetAchievement("TEST");
    2. SteamUserStats.StoreStats();
    3. Debug.Log ("Achievement: " + SteamUserStats.GetAchievement("TEST",out Check_It));
    "TEST" is the correct API Name for the achievement I'm trying to set. The above code should set it using SetAchievement() then StoreStats(), then read its status back in and send it to the console. But it always returns false.
     
    Last edited: Apr 12, 2018
  9. HonoraryBob

    HonoraryBob

    Joined:
    May 26, 2011
    Posts:
    1,214
    The only explanation I can come up with is that it simply doesn't work to set achievements while running in the editor, although some people claim it can be done.
     
  10. etaxi341

    etaxi341

    Joined:
    Oct 4, 2013
    Posts:
    64
    Nice that atleast your game is displayed correctly now :) But I can tell you that achievements normaly work in editor. How about checking the Achievement stat not directly after the storing of the stats? I am not sure but maybe the SteamUserStats cache?
     
  11. HonoraryBob

    HonoraryBob

    Joined:
    May 26, 2011
    Posts:
    1,214
    You mean wait some time before checking it? But it should eventually return true on subsequent runs -- I've been running it periodically for over a day now.
     
  12. etaxi341

    etaxi341

    Joined:
    Oct 4, 2013
    Posts:
    64
    Hmm thats weird :/ Don't know how to help you with this sorry
     
  13. HonoraryBob

    HonoraryBob

    Joined:
    May 26, 2011
    Posts:
    1,214
    It finally worked completely at random several days later, while I was testing something else entirely. No idea why it suddenly worked at that point, since I hadn't changed the code in several days. Maybe it takes Steam several days to recognize new achievements?
     
  14. pantang

    pantang

    Joined:
    Sep 1, 2016
    Posts:
    219
    Same issue with Unity2019.3.7, any idea what causes it or how to solve it?