Search Unity

Steam Workshop - Easy Steamworks Integration

Discussion in 'Assets and Asset Store' started by FreebordMAD, Mar 22, 2017.

  1. FreebordMAD

    FreebordMAD

    Joined:
    Mar 15, 2013
    Posts:
    633
    Steam Workshop - Easy Steamworks Integration available in the Unity Asset Store

    As some of you know the Steamworks API is a complex thing. Hence, I want to create a super easy Steam integration that can be used by designers who will only need to drag n' drop a prefab into the scene. I want to minimize the coding part as much as possible.

    I'm still searching for Steam features that you developers need to work in an easy way. Therefore, feel free to say what you need for your projects!

    Description

    The Easy Steamworks Integration brings various Steam features to your game with a very few clicks. The Steam Workshop plugin allows to browse, vote, favorite, subscribe and upload user generated content. You can integrate this plugin within your uGUI menus or trigger a browse, upload or update popup with a single line of code. The UI is highly customizable and can be adapted to the look of your game.

    Features:
    • single prefab drag n' drop for static UI
    • single code line for popup UI
    • highly customizable uGUI prefabs
    • search items
    • sort items
    • subscribe and download items
    • vote items
    • add favorite items
    • upload items (create or update)
    • make and upload screenshots with defined resolution
    Screenshots



    Game using the Steam Workshop - Easy Steamworks Integration
    - Guts and Glory

    Documentation
    Getting Started
    Link App And Setup Workshop
    Show Independent Popups
    Add To Existing uGUI
    Scripting Reference

    Getting Started
    After importing the Unity package the browse example (in ExampleScenesPopup or ExampleScenesStatic folders) will work out of the box - Steam must be running.
    By default Steamworks.NET will use the Steam AppId 480 - SpaceWar, use it for your Workshop browser integration tests.
    However, it is not possible to upload new levels to SpaceWar.
    Please follow the instructions in Link App And Setup Workshop to browse the Workshop of your game and to use the upload feature.

    Link App And Setup Workshop
    Follow the steps below to set the AppId and to configure Steam Workshop for your game.
    • Start one of the test scenes to generate the steam_appid.txt file in the root of your project (the folder where Assets, Library and ProjectSettings directories a located).
    • Open the steam_appid.txt file and replace 480 with your Steam AppId.
    • Restart Unity Editor to load your new AppId.
    • Login to partner.steamgames.com and open your game's App Admin page.
    • Under Technical Tools hit Edit Steamworks Settings.
    • Go to Application->Steam Cloud and set your data quotas e.g. 1048576000 for data per user and 1000 for number of files.
    • [optional] Tick Enable cloud support for developers only to hide your Workshop work until it is finished for public use.
    • Go to Workshop->General and tick Enable ISteamUGC for file transfer.
    • Go to Publish and apply your changes.
    • Steam might need a few hours for the changes to be applied -> be patient if it doesn't start to work instantly.
    • Now you should be able to browse the items of your game's Workshop and to upload new items by using the provided example scenes (in the ExampleScenesPopup or ExampleScenesStatic folders). You can find a more detailed tutorial in the Steam partner portal.
    Show Independent Popups
    The single code line below will show a Workshop browser popup, which will list all comunity items of your game and allow to search, sort, vote, favorite, subscribe and download them. Please find detailed example code in addition with some other useful hints in the SteamWorkshopBrowseExamplePopup class.
    Code (CSharp):
    1. // show the Steam Workshop browse popup
    2. uMyGUI_PopupManager.Instance.ShowPopup("steam_ugc_browse");
    The code below will show a Workshop item upload popup, which will allow entering the name and description of the item. Besides, it will allow to make a screenshot, which will be displayed as the item icon in the Workshop. Please find detailed example code in addition with some other useful hints in the SteamWorkshopUploadNewItemExamplePopup class.
    Code (CSharp):
    1. // tell which folder you want to upload
    2. WorkshopItemUpdate createNewItemUsingGivenFolder = new WorkshopItemUpdate();
    3. createNewItemUsingGivenFolder.ContentPath = ...;
    4. // show the Steam Workshop item upload popup
    5. ((SteamWorkshopPopupUpload)uMyGUI_PopupManager.Instance.ShowPopup("steam_ugc_upload"))
    6.    .UploadUI.SetItemData(createNewItemUsingGivenFolder);

    The following code shows a Workshop item update popup, which allows updating the name, the description and the icon of an existing item. All changed files in the given folder will be updated or uploaded. Please find detailed example code in addition with some other useful hints in the SteamWorkshopUpdateOwnedItemExamplePopup and SteamWorkshopUpdateItemFromFolderExamplePopup classes.
    Code (CSharp):
    1. // load item data from existing item folder
    2. WorkshopItemUpdate itemUpdate = SteamWorkshopMain.Instance.GetItemUpdateFromFolder(...);
    3. // show the Steam Workshop item update popup
    4. ((SteamWorkshopPopupUpload)uMyGUI_PopupManager.Instance.ShowPopup("steam_ugc_upload"))
    5.    .UploadUI.SetItemData(itemUpdate);

    Add To Existing uGUI
    You will find two prefabs included in the package, SteamWorkshopItemBrowser and SteamWorkshopItemUpload. All you need to do is simply drag n' drop those into your Canvas or add them to any of your UI elements.



    Powered by Steamworks.NET

    The Easy Steamworks Integration series are powered by Steamworks.NET created by Riley Labrecquea. If you are lucky enough to earn some money with your game, then please consider a donation to Riley Labrecquea here.

    Unity Asset Store: https://www.assetstore.unity3d.com/en/#!/content/86189
     
    Last edited: Jan 25, 2021
  2. BackwoodsGaming

    BackwoodsGaming

    Joined:
    Jan 2, 2014
    Posts:
    2,229
    I haven't got a game close enough to be able to submit to Steam yet, so I'm not sure what all the issues/requirements are. But I'm definitely interested in seeing what you put together. :) Watching the thread.
     
    FreebordMAD likes this.
  3. FreebordMAD

    FreebordMAD

    Joined:
    Mar 15, 2013
    Posts:
    633
  4. FreebordMAD

    FreebordMAD

    Joined:
    Mar 15, 2013
    Posts:
    633
  5. iEpic

    iEpic

    Joined:
    Sep 29, 2013
    Posts:
    119
    does it have leaderboards?
    I would buy it if it had leaderboards with playmaker actions.
     
    FreebordMAD likes this.
  6. FreebordMAD

    FreebordMAD

    Joined:
    Mar 15, 2013
    Posts:
    633
    The Steam Workshop asset that is on the store now does not have leaderboards.
    However, it is great that you are asking for leaderboards. This shows me that there is interest in such an asset.
    Currently I'm waiting to see if the Steam Workshop asset is selling at all and if there are people who want to pay for Easy Steam Integration assets.
    I took a look at Nose Goes and I think that Steam leaderboards would for sure improve it.
    Having said all of that above, leaderboards are next on the list, but I cannot tell you when they will be finished.
    Once I have coded the leaderboards it will be a separate Asset Store package.
     
  7. anunnaki2016

    anunnaki2016

    Joined:
    Jun 16, 2016
    Posts:
    93
    Helloooooo my friend

    i have purchase asset now

    Thanks for your work i go add workshop in my game sossurvival check steam please, for look game

    But i have steamworks 9.0.0 there is a few error, if one has the your assets ;( possible update please for steamworks 9.0.0, well if you have steammanager 7.0.0 ok is work steamworks 9.0.0 is not work



    thanks for help @FreebordMAD
     
    Last edited: May 27, 2017
  8. FreebordMAD

    FreebordMAD

    Joined:
    Mar 15, 2013
    Posts:
    633
    First of all, thank you very much for using the Steam Workshop - Easy Steamworks Integration. I'm currently working on the Steam Leaderboards package. I took a look at your game. It looks very interesting. Maybe you can also use this package soon counting the days survived or other scores. Is there anything else you want to integrate with Steam?

    Steam Workshop - Easy Steamworks Integration is currently compiled with 9.0.0, but I was able to reproduce your problems with Steamworks.NET 9.1.0. Those are fixed in the current beta. Please send me your e-mail in a pm including your order number, I will then send you the current beta version.
     
  9. anunnaki2016

    anunnaki2016

    Joined:
    Jun 16, 2016
    Posts:
    93
    hi ,

    Great :)

    i need add editor map for add workshop, i go try add in multiplayer photon too, ^^

    i have send you pm
     
  10. FreebordMAD

    FreebordMAD

    Joined:
    Mar 15, 2013
    Posts:
    633
    Already thought about using the Multiplatform Runtime Level Editor? :rolleyes:
     
  11. anunnaki2016

    anunnaki2016

    Joined:
    Jun 16, 2016
    Posts:
    93
  12. FreebordMAD

    FreebordMAD

    Joined:
    Mar 15, 2013
    Posts:
    633
    The MRLE will simply instatiate prefabs that you place in the resource folder. Hence, you can add any script that you want. For example, you could add a script to the door object, which would allow the player to open it when he is close enough or looking at it. Besides, you could make huge levels with the streamed level feature. Objects would be instantiated only if the player is close enough, also they would be hidden if the player leaves the area.
    If you have any further questions regarding the MRLE, then please let us move this conversation to the right thread:
    http://forum.unity3d.com/threads/multiplatform-runtime-level-editor-any-one-interested.250920/
     
  13. Mattiebo

    Mattiebo

    Joined:
    Feb 11, 2013
    Posts:
    12
    Hey there, I'm getting the following error when I use the example upload scenes:

    All the fields are filled-in and the upload adds a blank file with no name, icon or description to my Workshop page. This is on Unity 5.6.1f1.

    Thanks.
     
    kaifu2 likes this.
  14. FreebordMAD

    FreebordMAD

    Joined:
    Mar 15, 2013
    Posts:
    633
    First of all, thank you for purchasing the Easy Steam Integration plugin!
    This error message is coming from Steam:
    Code (CSharp):
    1. case EResult.k_EResultInvalidParam: return "A parameter is incorrect!";
    Have you correctly setup the Steam Workshop of your game in the Steam partner website (data quotas, Enable ISteamUGC and cloud support)?
    http://www.freebord-game.com/index.php/dev-tools/steam-workshop-easy-steamworks#doc_v1_00_link

    Also, please just try again, sometimes Steam needs some time to update their servers with your changes.
     
    kaifu2 and GibTreaty like this.
  15. Mattiebo

    Mattiebo

    Joined:
    Feb 11, 2013
    Posts:
    12
    Thanks for the help, looks like I missed the 'save' button at the bottom of the page after enabling ISteamUGC.

    Also, thanks for making this plugin! I expected to spend a long time working on Workshop implementation, but this will spare me some valuable time to work on other parts of the game.
     
    kaifu2 and FreebordMAD like this.
  16. FreebordMAD

    FreebordMAD

    Joined:
    Mar 15, 2013
    Posts:
    633
    I'm glad that it works now!

    You're welcome. My aim is to create single code line/drag'n'drop plugins for every Steam API. I'm in the submission process of the Steam Leaderboards plugin, maybe you can use it in your game. You would help me a lot to push the Easy Steamworks Integration series on the Asset Store if you would simply copy paste your quote above to an Asset Store review!
     
    kaifu2 likes this.
  17. davenirline

    davenirline

    Joined:
    Jul 7, 2010
    Posts:
    982
    Hello. Do you have a demo version of your product? I just want to simulate the whole thing first before I buy. Like a test upload, download, then loading the downloaded items to the game. From the video, I can only see that it uploads a single file. Can it upload folders instead?
     
  18. FreebordMAD

    FreebordMAD

    Joined:
    Mar 15, 2013
    Posts:
    633
    Steam allows to upload only folders not single files. Hence, the content of a folder is uploaded. In the code of the demo only one text file is uploaded with content, but you can add further files if you need it.
    Feel free to buy it and ask for a refund within 10 days if it does not satisfy your wishes.
    Please pay attention to the Steam configuration guide here: http://www.freebord-game.com/index.php/dev-tools/steam-workshop-easy-steamworks#doc_v1_00_link
     
    theANMATOR2b likes this.
  19. davenirline

    davenirline

    Joined:
    Jul 7, 2010
    Posts:
    982
    I already bought it, but haven't had the time to play with it yet. I'll post here if I encounter problems.
     
    FreebordMAD likes this.
  20. davenirline

    davenirline

    Joined:
    Jul 7, 2010
    Posts:
    982
    Does it have callbacks/hooks for cases when there are errors like during download or upload?
     
  21. FreebordMAD

    FreebordMAD

    Joined:
    Mar 15, 2013
    Posts:
    633
  22. davenirline

    davenirline

    Joined:
    Jul 7, 2010
    Posts:
    982
    Hello. How do I download an outdated item? I used WorkshopItem.IsUpdateNeeded to check if an update is needed but how to really update? Do we call SteamWorkshopMain.Instance.Subscribe() again? I don't see SteamWorkshopMain.Instance.Download() function.
     
    FreebordMAD likes this.
  23. FreebordMAD

    FreebordMAD

    Joined:
    Mar 15, 2013
    Posts:
    633
    Please add the code below to the SteamWorkshopMain class. It will be included in the next version with the TODOs implemented. However, you can already use it. If you need to know when your item is updated, then you can listen for SteamWorkshopMain.Instance.IsInstalled.

    [EDIT:] changed code

    Code (CSharp):
    1.  
    2.         public bool Download(WorkshopItem p_item)
    3.         {
    4.             if (SteamManager.Initialized && SteamUGC.DownloadItem(p_item.SteamNative.m_nPublishedFileId, true))
    5.             {
    6.                 if (!m_downloadingItems.Contains(p_item.SteamNative.m_nPublishedFileId))
    7.                 {
    8.                     m_downloadingItems.Add(p_item.SteamNative.m_nPublishedFileId);
    9.                 }
    10.                 // update state again
    11.                 EItemState itemState = (EItemState)SteamUGC.GetItemState(p_item.SteamNative.m_nPublishedFileId);
    12.                 p_item.SteamNative.m_itemState = itemState;
    13.                 p_item.IsInstalled = IsInstalled(itemState);
    14.                 p_item.IsDownloading = IsDownloading(itemState);
    15.                 p_item.IsUpdateNeeded = IsUpdateNeeded(itemState);
    16.  
    17.                 // TODO: allow to hook directly into OnInstalled
    18.  
    19.                 return true;
    20.             }
    21.             else
    22.             {
    23.                 // TODO: proper error messages and event handling
    24.  
    25.                 return false;
    26.             }
    27.         }
    [EDIT2:] If you are happy with the Steam Workshop - Easy Steamworks Integration package, then you would help me a lot with a review in the Unity Asset Store!
     
    Last edited: Oct 12, 2017
  24. unicoea

    unicoea

    Joined:
    Feb 18, 2013
    Posts:
    60
    Hi friend!
    I have purchase this, it is very good in upload, and i set right the steam store, i can see the upload result in store page.
    I use scene "SteamWorkshopBrowse" to see the user's data it is ok too, but when i click "+" to download it, it keeps 0%.
    I use unity5.6.4 with Steam Workshop - Easy Steamworks Integration_v1.22
    Please tell me how to solve, thank you!
    20171206201522.jpg
     
  25. FreebordMAD

    FreebordMAD

    Joined:
    Mar 15, 2013
    Posts:
    633
    Thank you for choosing the ESI Workshop package! Please attach the Unity Editor log.
     
  26. unicoea

    unicoea

    Joined:
    Feb 18, 2013
    Posts:
    60
    OK!
    I test this five mimutes ago, i found the download is ok, i think maybe is net problem.
    Then i want to test it again , i found the content of steamapp, delete all download contents, and want to retest the download. But it not download again.
    It shows in below picture.
    123.jpg
    Then i open a new project and test the default 480 appid, it download ok!
    Now just need to know how to download again after delete steamapp/contents/*.* ,and test again in my appid.
    Thank you!
    :)
     
    FreebordMAD likes this.
  27. FreebordMAD

    FreebordMAD

    Joined:
    Mar 15, 2013
    Posts:
    633
    Great. It sometimes takes Steam a while until they setup their system to include your workshop settings and content.

    This is impossible. Now the Steam database is out of sync with the file system.
    I did some testing SteamUGC.DownloadItem will not do anything, it says that the file will be downloaded by returning true. The Callback<DownloadItemResult_t> is fired instantly, but the file is not loaded.
    Basically, the only way to fix this is by syncing the Steam DB with the file system:
    • go to your games in Steam
    • right click the game and hit properties
    • select the local files tab
    • hit check for errors
    This is not going to work with Spacewar (appid 480), since it is invisible in the Steam games list.

    Don't hesitate to ask further questions! If you like the ESI Workshop plugin, then you would help a lot by leaving a review!
     
  28. unicoea

    unicoea

    Joined:
    Feb 18, 2013
    Posts:
    60
    Hi!
    I found the Solution.
    When i delete the workshop content from my local disk, it can not download again.
    Find game in steam, uninstall it. Then it can download again!
    Now is fine! Thank you for your guide and help!
    Yes i will leave a review. :)
    123.jpg
     
    FreebordMAD likes this.
  29. unicoea

    unicoea

    Joined:
    Feb 18, 2013
    Posts:
    60
    My need is to write custom data and upload to steam, then i can use it when download contents,here is i found how to achieve it in plugins, Is it right?

    Here is how to upload custom data and receive it from plugin
    1.To write you own data:
    SteamWorkshopUploadNewItemExamplePopup.cs:
    // create dummy content to upload
    string dummyItemContentStr =
    "Save your item/level/mod data here.\n" +
    "It does not need to be a text file. Any file type is supported (binary, images, etc...).\n" +
    "You can save multiple files, Steam items are folders (not single files).\n";
    Debug.Log(dummyItemContentFolder);
    File.WriteAllText(Path.Combine(dummyItemContentFolder, "ItemData.txt"), dummyItemContentStr);
    The "ItemData.txt" is a example of custom data which you want to save to steam cloud.
    The "ContentPath " is a folder will be upload with all in it.
    // tell which folder you want to upload
    WorkshopItemUpdate createNewItemUsingGivenFolder = new WorkshopItemUpdate();
    createNewItemUsingGivenFolder.ContentPath = dummyItemContentFolder;
    -----------------------------------------------------------------------------
    2. Receive the data:
    SteamWorkshopBrowseExamplePopup.cs:
    // show the Steam Workshop browse popup
    ((SteamWorkshopPopupBrowse)uMyGUI_PopupManager.Instance.ShowPopup("steam_ugc_browse")).BrowseUI
    // implement your item/level loading here
    .OnPlayButtonClick += (WorkshopItemEventArgs p_itemArgs) =>
    {
    // collect names of all local files
    string filesInfoStr = "\n";
    try
    {
    string[] localFiles = Directory.GetFiles(p_itemArgs.Item.InstalledLocalFolder);
    for (int i = 0; i < localFiles.Length; i++)
    {
    filesInfoStr += localFiles + "\n";
    }
    }
    catch
    {
    filesInfoStr += "not found!";
    }
    The data will receive as p_itemArgs.Item,then it has a installedLocalFolder, there store your upload data before.
    You can load "ItemData.txt" from here.
     
  30. unicoea

    unicoea

    Joined:
    Feb 18, 2013
    Posts:
    60
    By the way, i want to know how to use "SteamWorkshopUpdateOwnedItem", and what difference between it and "SteamWorkshopUpdateItemFromFolder"?
    I think it is like this:
    1. user upload new item to steam by use: "SteamWorkshopUploadNewItem".
    2. user can use "SteamWorkshopBrowse" to browse all items make by all users, then download for example 4 items.
    then user can play these items.
    3. user want to update items use "SteamWorkshopUpdateOwnedItem", the list items is what this user uploaded.
    4. What is the use or how to use "SteamWorkshopUpdateItemFromFolder"?
    Am i think right?
     
  31. FreebordMAD

    FreebordMAD

    Joined:
    Mar 15, 2013
    Posts:
    633
    Yes

    Yes

    You got it!

    Yes
    Yes
    Yes

    If you know the folder, then you don't need to get the item's data as in the "SteamWorkshopUpdateOwnedItem" example. Instead you can simply update by specifying the folder. The folder contains an XML file, which saves the steam file ID (after the item being uploaded for the first time).
     
  32. unicoea

    unicoea

    Joined:
    Feb 18, 2013
    Posts:
    60
    I think you mean custom write the XML file and it's content, and with resource reference from it. Then use SteamWorkshopUpdateItemFromFolder to upload directly.
    Ok! I got it. This plugins is very nice!
    I have integrated it into game, and work fine!
    Thank you very much!
    Regards!
     
    FreebordMAD likes this.
  33. unicoea

    unicoea

    Joined:
    Feb 18, 2013
    Posts:
    60
    Hi!
    I am continue to integrate, i found a question:
    If I use UpdateOwned() , the progress has four steps:
    1. modify the name
    2. modify the description
    3. Capture a new Icon.
    4. Upload to steam.
    Now if i skip step3, i mean i just want to modify the name or description of a exist item, but my game screen is not the same scene view of this item. So i can't capture a new icon for it.
    Then i click upload. It will upload success.
    But when i open the UpdateOwned() again, the icon region is white as blank. It should be the same icon as last time.
    So i track the progress:
    When press Capture Icon Button, the program will use new edit name to build a new IconPath:
    a.jpg

    This IconPath will use for save the "WorkshopItemInfo.XML":

    b.jpg

    If i skip Capture Icon Step, the XML will be like this:
    You can see the IconFileName is still the old name, this is what i need.
    c.jpg

    Then i trigger UpdateOwned() again, the existed item will be read through this:

    d.jpg

    But in "WorkshopItemUpdate.cs", it read the item's name, then use it to find Icon:
    e.jpg

    So the icon can't be find, then it will show with white blank in icon:
     
    Last edited: Dec 10, 2017
    FreebordMAD likes this.
  34. unicoea

    unicoea

    Joined:
    Feb 18, 2013
    Posts:
    60
    1.jpg

    Can the icon name read from the WorkshopItemInfo.XML? It will be OK for this situation.
    Please help me to do it, or tell me how to do?

    Thank you again! :)

    Regards,
    unicoea
     
  35. FreebordMAD

    FreebordMAD

    Joined:
    Mar 15, 2013
    Posts:
    633
    I have added the code to the OnOwnedItemSelectedForUpdate method, see below comment get item icon from folder if not loaded yet. This code will load the icon from the XML if it is not set in the update info by choosing a new name and rendering a new icon.
    Code (CSharp):
    1.  
    2.     private void OnOwnedItemSelectedForUpdate(WorkshopItem p_item)
    3.     {
    4.         uMyGUI_PopupManager.Instance.HidePopup(uMyGUI_PopupManager.POPUP_DROPDOWN);
    5.  
    6.         // only installed items can be updated
    7.         if (!p_item.IsInstalled)
    8.         {
    9.             ((uMyGUI_PopupText)uMyGUI_PopupManager.Instance.ShowPopup(uMyGUI_PopupManager.POPUP_TEXT))
    10.                 .SetText("Not Installed", "This item is not installed. Please subscribe this item first!")
    11.                 .ShowButton(uMyGUI_PopupManager.BTN_OK, Start); // retry on OK button
    12.             return;
    13.         }
    14.  
    15.         // generate a WorkshopItemUpdate instance
    16.         WorkshopItemUpdate updateExistingItem = new WorkshopItemUpdate(p_item);
    17.  
    18.         // get item icon from folder if not loaded yet
    19.         if (string.IsNullOrEmpty(updateExistingItem.IconPath))
    20.         {
    21.             WorkshopItemUpdate itemUpdate = SteamWorkshopMain.Instance.GetItemUpdateFromFolder(updateExistingItem.ContentPath);
    22.             if (itemUpdate != null && !string.IsNullOrEmpty(itemUpdate.IconPath))
    23.             {
    24.                 updateExistingItem.IconPath = itemUpdate.IconPath;
    25.             }
    26.         }
    27.  
    28.         string itemContentFile = Path.Combine(updateExistingItem.ContentPath, "ItemData.txt");
    29.         if (File.Exists(itemContentFile))
    30.         {
    31.             // update the content of your item
    32.             File.AppendAllText(itemContentFile, "\nUpdate - " + System.DateTime.Now);
    33.          
    34.             // show the Steam Workshop item upload popup
    35.             ((SteamWorkshopPopupUpload)uMyGUI_PopupManager.Instance.ShowPopup("steam_ugc_upload")).UploadUI.SetItemData(updateExistingItem);
    36.         }
    37.         else
    38.         {
    39.             ((uMyGUI_PopupText)uMyGUI_PopupManager.Instance.ShowPopup(uMyGUI_PopupManager.POPUP_TEXT))
    40.                 .SetText("Not Installed", "This item is subscribed, but not installed. Please sync local files in Steam!")
    41.                 .ShowButton(uMyGUI_PopupManager.BTN_OK, Start); // retry on OK button
    42.         }
    43.     }
     
  36. unicoea

    unicoea

    Joined:
    Feb 18, 2013
    Posts:
    60
    Nice Solve!
    Thank you for this, i can go on.
    Cheers! :)
     
    FreebordMAD likes this.
  37. unicoea

    unicoea

    Joined:
    Feb 18, 2013
    Posts:
    60
    Hi!
    I have purchased Leaderboards too. I want to achieve upload a score added to score existed in leadboard.
    For example:
    i have 30 score in leadboard, now i want to get the number 30 and add 10 to it, then upload 40 new score to leadboard.
    How to do?

    Thank you!
     
    FreebordMAD likes this.
  38. FreebordMAD

    FreebordMAD

    Joined:
    Mar 15, 2013
    Posts:
    633
    This is simple! Download the current score as below, then add a new value to it:
    Code (CSharp):
    1. int scoreToAdd = 10;
    2. SteamLeaderboardsMain.Instance.DownloadScoresAroundUser(m_leaderboardName, 0, (LeaderboardsDownloadedScoresEventArgs p_resultArgs) =>
    3. {
    4.     int currentScore = 0;
    5.     if (p_resultArgs.Scores.Count > 0)
    6.     {
    7.         // get current user score
    8.         currentScore = p_resultArgs.Scores[0].Score;
    9.     }
    10.     // add to current user score
    11.     currentScore += scoreToAdd;
    12.     // upload new score
    13.     SteamLeaderboardsUI.UploadScore(m_leaderboardName, currentScore, (LeaderboardsUploadedScoreEventArgs p_leaderboardArgs) =>
    14.     {
    15.         Debug.Log("Score updated in table '" + p_leaderboardArgs.LeaderboardName + "' to '" + p_leaderboardArgs.Score + "'");
    16.     });
    17. });
    Let's continue talking about the Leaderboard package in the post below
    https://forum.unity.com/threads/steam-leaderboards-easy-steamworks-integration.479183/#post-3324959

    By the way, also here I would be very thankful to see a review in the Asset Store
     
  39. lofwyre

    lofwyre

    Joined:
    Apr 19, 2007
    Posts:
    174
    Hi, I've been using the leaderboard/achievements for a while going well. I just purchased the workshop asset and I've got a few problems.

    First it gave this error

    Assets/Plugins/Steamworks.NET/CallbackDispatcher.cs(21,0): error CS1029: #error: 'You need to define STEAMWORKS_WIN, or STEAMWORKS_LIN_OSX. Refer to the readme for more details.'

    So I added STEAMWORKS_WIN in the Scripting Define Sympols in ProjectS Settings/Player

    Now it gives the following compile error

    Assets/Plugins/Steamworks.NET/autogen/isteamparentalsettings.cs(40,44): error CS0246: The type or namespace name `EParentalFeature' could not be found. Are you missing an assembly reference?
     
  40. lofwyre

    lofwyre

    Joined:
    Apr 19, 2007
    Posts:
    174
    OK I sorted it out by deleting the plugins/Steamworks.net/autogen folder and reimporting. I'm thinking leaderboards has an older version and importing workshop it would not allow it to be overridden.
     
    TheTortilla likes this.
  41. lofwyre

    lofwyre

    Joined:
    Apr 19, 2007
    Posts:
    174
    Where does WorkshopItemInfo.XML come from, do we create it ourselves?
     
  42. lofwyre

    lofwyre

    Joined:
    Apr 19, 2007
    Posts:
    174
    I think I have a handle on the above.

    Does anyone know how to remove a workshop item that a player has uploaded?
     
  43. FreebordMAD

    FreebordMAD

    Joined:
    Mar 15, 2013
    Posts:
    633
    I'm glad you were able to solve the other problems!

    As far as I know this is not possible problematically.

    You can see the workshop in the community hub when logged in with the developer account.
    You can delete your own items by selecting the item in the workshop and hitting delete in the right menu.
    I assume that you can ban or delete items of other players when you login with the developer account.

    By the way if you like the ESI plugins, then you would help a lot with short reviews ;)
     
  44. lofwyre

    lofwyre

    Joined:
    Apr 19, 2007
    Posts:
    174
    Hi Denis

    Thanks for the response. In the ISteamUGC interface there is DeleteItem, might be useful if you consider expanding your asset down the track. Not really a high priority though as the user delete and admin ban should be ok to manage the workshop.

    I'm implementing this without the UI, I have most of it, but an example of uploading without using the UI would be helpful.

    Cheers
    Matt
     
  45. FreebordMAD

    FreebordMAD

    Joined:
    Mar 15, 2013
    Posts:
    633
    Thanks for giving me an update on that! DeleteItem is a new feature in Steamworks.NET and I have added this to the todo list.

    You can use the code the in SteamWorkshopUIUpload class as an example. Interesting is the SteamWorkshopMain.Instance.Upload(m_itemData, null) call in OnUploadButtonClick. What you have to do is to fill m_itemData (WorkshopItemUpdate) with data manually.

    Please follow up with detailed questions if you need help with the SteamWorkshopMain.Instance.Upload method.
     
  46. Freznosis

    Freznosis

    Joined:
    Jul 16, 2014
    Posts:
    298
    Any insight on how hard it would be to convert this to Facepunch.Steamworks? I've been converting all of my code to use Facepunch and I'm stuck on using this asset and converting or not using it at all.
     
  47. FreebordMAD

    FreebordMAD

    Joined:
    Mar 15, 2013
    Posts:
    633
    Sorry to hear that you got stuck. What is the problem, maybe we can resolve it.

    I cannot tell you how hard it would be to go away from Steamworks.NET and convert to Facepunch.Steamworks, since I never tried Facepunch.
     
  48. shubhank008

    shubhank008

    Joined:
    Apr 3, 2014
    Posts:
    107
    This was on sale yesterday night when I went to sleep ($17) so I wishlisted it to buy today, now I wake up and see discount is gone and its $25 :/ Is there an upcoming discount ? Really want to get it for trying it out but now I am feeling hesitant just because it feels the assetstore removed discount when I left it in cart and wishlist. $8 aint a big difference, but yeah just feeling dumped.
     
  49. Rajmahal

    Rajmahal

    Joined:
    Apr 20, 2011
    Posts:
    2,101
    Hi, does this allow for putting in steam achievements or would that require a different plugin? I just launched on steam and regularly get requests for achievements.
     
  50. FreebordMAD

    FreebordMAD

    Joined:
    Mar 15, 2013
    Posts:
    633
    Sorry to hear you missed the sales. My assets are usually included in all big sales, but I don't know when the next sales will be.

    Achievements are currently not part of the Easy Steamworks Integration. However, I have another package for Leadebords just check my Asset Store account if you are interested.