How to Give Upload Perms to Steam Workshop Mod

Introduction

Steam Workshop is a organization of dorsum-end storage and front-cease web pages that brand it easy to store, organize, sort, rate, and download content for your game or application.

This folio contains technical details on implementing Steam Workshop with your title. For information and definitions of the diverse types of Workshop integration y'all tin utilise and how to make the best out of the tools provided by Steam please see the Steam Workshop Overview before getting started integrating the steam workshop with your game.

In a typical gear up-up, customers of your game would use tools provided past you with purchase of your game to create modifications or entirely new content. Those customers would then submit that content through a form built into your tool to the Steam Workshop. Other customers would then be able to scan, sort, rate, and subscribe to items they wish to add together to their game by going to the Steam Workshop in the Steam Community. Those items would then download through Steam. If you lot've registered for the ISteamUGC::ItemInstalled_t callback inside your game, yous can and so call ISteamUGC::GetItemInstallInfo to become the installed location and read the data directly from that folder. That new content would then be recognized by the game in whatever capacity makes sense for your game and the content created.

Steam Workshop Types, Monetization, & Best Practices

For more information and definitions of the diverse types of Workshop integration you tin apply and how to make the best out of the tools provided by Steam, please run into the Steam Workshop documentation.

Managing Steam Workshop Visibility

The Steam Workshop is the website hosted through Steam that enumerates shared content and allows users to vote and comment on the content visible through the community. By default, applications are not enabled to be publicly visible in the Workshop. This prevents content not intended to be shared through the Steam Workshop portal from existence visible unless the workshop is set to public.
Set the visibility state of the workshop through the following steps:

  1. Browse to the application landing page on the Steamworks website
  2. Click Edit Steamworks Settings
  3. From the Workshop Tab, select General
  4. On the right-mitt side of the page, notice the Visibility Country department.
  5. Use the radio buttons to select the desired level of visibility which tin include Developers Only, Developers & Testers, Customers & Developers and Everyone.
  6. From the Publish tab, click Prepare for Publishing
  7. Click Publish to Steam and complete the process to publish the change.

Annotation: To alter the visibility country to Everyone, the Workshop checklist must be consummate which includes branding, title, description and at least one item of content publicly visible.

Tech Overview

The process to share and consume User Generated Content is by using the ISteamUGC API which tin can be institute in the Steamworks SDK. The methods exposed provide a style to share workshop item content which tin can then be discovered through the Steam Workshop or an in-app experience.

The Workshop API must be accessed through the arrow that is returned from SteamUGC().

For example:

SteamAPICall_t hSteamAPICall = SteamUGC()->CreateItem( SteamUtils()->GetAppID(), k_EWorkshopFileTypeMicrotransaction );

Enabling ISteamUGC for a Game or Application

Before workshop items can be uploaded to the Steamworks backend in that location are 2 configuration settings that must be fabricated, Configuring Steam Cloud Quotas and Enabling the ISteamUGC API.

The Steam Cloud feature is used to shop the preview images associated to workshop items. The Steam Cloud Quota can be configured with the following steps:

  1. Navigate to the Steam Cloud Settings page in the App Admin panel.
  2. Gear up the Byte quota per user and Number of files allowed per user to appropriate values for preview prototype storage
  3. Click Save
  4. From the Publish tab, click Prepare for Publishing
  5. Click Publish to Steam and complete the process to publish the modify.

Enabling the ISteamUGC API tin be accomplished with the following steps:

  1. Navigate to the Steam Workshop Configuration page in the App Admin console.
  2. Notice the Additional Configuration Options section.
  3. Cheque Enable ISteamUGC for file transfer.
  4. Click Save.
  5. From the Publish tab, click Ready for Publishing.
  6. Click Publish to Steam and complete the process to publish the change.

One time these settings are in identify workshop content can be uploaded via the API.

Creating and Uploading Content

The procedure of creating and uploading workshop content is a simple and repeatable procedure as shown in the flow chart beneath.

ISteamUGCFlow-CreateUpload-Web2.png

Creating a Workshop Item

  1. All workshop items begin their being with a phone call to ISteamUGC::CreateItem
    • The nConsumerAppId variable should contain the App ID for the game or application. Do not pass the App ID of the workshop item cosmos tool if that is a separate App ID.
    • EWorkshopFileType is an enumeration type that defines how the shared file volition exist shared with the customs. The valid values are:
      • k_EWorkshopFileTypeCommunity - This file blazon is used to describe files that will be uploaded by users and made available to download by anyone in the community. Common usage of this would be to share user created mods.
      • k_EWorkshopFileTypeMicrotransaction - This file type is used to describe files that are uploaded by users, just intended only for the game to consider adding equally official content. These files will non exist downloaded by users through the Workshop, only will be viewable by the community to charge per unit.
        This is the implementation that Team Fortress ii uses.
  2. Register a call result handler for CreateItemResult_t
  3. Kickoff check the m_eResult to ensure that the item was created successfully.
  4. When the call event handler is executed, read the m_nPublishedFileId value and shop for future updates to the workshop item (e.g. in a project file associated with the cosmos tool).
  5. The m_bUserNeedsToAcceptWorkshopLegalAgreement variable should also be checked and if information technology's true, the user should be redirected to accept the legal agreement. See the Workshop Legal Agreement section for more details.

Uploading a Workshop Item

  1. Once a workshop item has been created and a PublishedFileId_t value has been returned, the content of the workshop detail can be populated and uploaded to the Steam Workshop.
  2. An item update begins with a call to ISteamUGC::StartItemUpdate
  3. Using the UGCUpdateHandle_t that is returned from ISteamUGC::StartItemUpdate, calls can be made to update the Title, Description, Visibility, Tags, Item Content and Item Preview Image through the various ISteamUGC::SetItem[...] methods.
    • ISteamUGC::SetItemTitle - Sets a new title for an item.
    • ISteamUGC::SetItemDescription - Sets a new description for an item.
    • ISteamUGC::SetItemUpdateLanguage - Sets the language of the title and description that will be set in this item update.
    • ISteamUGC::SetItemMetadata - Sets arbitrary metadata for an item. This metadata tin can be returned from queries without having to download and install the actual content.
    • ISteamUGC::SetItemVisibility - Sets the visibility of an item.
    • ISteamUGC::SetItemTags - Sets arbitrary developer specified tags on an item.
    • ISteamUGC::AddItemKeyValueTag - Adds a key-value tag pair to an item. Keys can map to multiple different values (1-to-many human relationship).
    • ISteamUGC::RemoveItemKeyValueTags - Removes an existing key value tag from an item.
    • ISteamUGC::SetItemContent - Sets the folder that will be stored as the content for an particular.
    • ISteamUGC::SetItemPreview -Sets the master preview image for the item.
  4. Once the update calls have been completed, calling ISteamUGC::SubmitItemUpdate will initiate the upload process to the Steam Workshop.
    • Register a call result handler for SubmitItemUpdateResult_t
    • When the call upshot handler is executed, check the m_eResult to ostend the upload completed successfully.
    • Annotation: There is no method to cancel the detail update and upload once information technology's been called.
  5. If desired, the progress of the upload can be tracked using ISteamUGC::GetItemUpdateProgress
    • EItemUpdateStatus defines the upload and update progress.
    • punBytesProcessed and punBytesTotal tin can be used to provide input for a user interface control such as a progress bar to betoken progress of the upload.
    • punBytesTotal may update during the upload process based upon the stage of the item update.
  6. In the same way as Creating a Workshop Item, confirm the user has accepted the legal agreement. This is necessary in case where the user didn't initially create the detail simply is editing an existing particular.

Additional Notes

  • Workshop items were previously designated as single files. With ISteamUGC, a workshop item is a representation of a folder of files.
  • If a workshop item requires additional metadata for use by the consuming awarding, you can attach metadata to your item using the ISteamUGC::SetItemMetadata call. This metadata can be returned in queries without having to download and install the detail content.
    Previously we suggested that you lot salvage this metadata to a file inside the workshop item folder, which of course yous can still do.

Consuming Content

Consuming workshop content falls into two categories, Item Subscription and Detail Installation.

Item Subscription

The bulk of subscriptions to a workshop item will happen through the Steam Workshop portal. It is a known location, common to all games and applications, and as such, users are likely to detect and subscribe to items regularly on the workshop site.

However, ISteamUGC provides two methods for programmatically subscribing and unsubscribing to workshop items to support in-game particular subscription management.

  • ISteamUGC::SubscribeItem - Subscribe to a workshop particular. It will exist downloaded and installed as before long as possible.
  • ISteamUGC::UnsubscribeItem - Unsubscribe from a workshop item. This will result in the item being removed after the game quits.

Two additional methods be for enumerating through a user's subscribed items.

  • ISteamUGC::GetNumSubscribedItems - Gets the total number of items the current user is subscribed to for the game or application.
  • ISteamUGC::GetSubscribedItems - Gets a list of all of the items the electric current user is subscribed to for the current game.

Receiving Notifications for External Subscription Actions

In-game notifications tin can be received when a user has subscribed or unsubscribed from a file through any mechanism (eastward.g. ISteamUGC, Steam Workshop Website):

  • Register a callback handler for RemoteStoragePublishedFileSubscribed_t and RemoteStoragePublishedFileUnsubscribed_t
  • The structs will be populated with the ISteamRemoteStorage::PublishedFileId_t which can then be used to access the information nigh the workshop item.
  • The structs also contain the application ID (m_unAppID) associated with the workshop particular. It should exist compared against the running application ID every bit the handler will be called for all detail subscriptions regardless of the running awarding.

Item Installation

Once Item Subscription information is known, the remaining consumption methods tin be utilized. These methods provide information back to the game virtually the state of the item download and installation. Workshop detail downloads are executed via the Steam Client and happen automatically, based on the following rules:

  1. When the Steam Client indicates a game or application is to launch, all app depots that accept been updated will be downloaded and installed.
  2. Any existing installed workshop items are updated if needed
  3. Game or application then launches
  4. Newly subscribed workshop items that are not downloaded will then download and exist installed in the groundwork.
    • Subscribed files will be downloaded to the customer in the guild they were subscribed in.
    • The Steam download page will show workshop item downloads with a specific banner to indicate a workshop item download is occurring.

Notation: Using the "Verify Integrity of Game Files" feature in the Steam Customer will besides cause workshop items to be downloaded.

As the game will commencement earlier newly subscribed content is downloaded and installed, the remaining consumption methods exist to help in monitoring and managing the install progress. They can besides be used when items are subscribed in-game to provide status of installation in real time.

Status of a Workshop Item

  • ISteamUGC::GetItemState - Gets the current state of a workshop item on this client.

Download Progress of a Workshop Item

  • ISteamUGC::GetItemDownloadInfo - Get info about a pending download of a workshop item that has k_EItemStateNeedsUpdate set.

Initiate or Increase the Priority of Downloading a Workshop Item

  • ISteamUGC::DownloadItem
    • Prepare bHighPriority to true to pause whatever existing in-progress downloads and immediately begin downloading this workshop particular.
    • If the return value is true then register and await for the callback ISteamUGC::DownloadItemResult_t before calling ISteamUGC::GetItemInstallInfo or accessing the workshop item on disk.
    • If the user is not subscribed to the item (e.g. a Game Server using anonymous login), the workshop item will be downloaded and cached temporarily.
    • If the workshop item has an ISteamUGC::EItemState of k_EItemStateNeedsUpdate, ISteamUGC::DownloadItem tin can be called to initiate the update. Do not admission the workshop detail on disk until the callback ISteamUGC::DownloadItemResult_t is called.
    • This method only works with ISteamUGC created workshop items. It will not work with legacy ISteamRemoteStorage workshop items.
    • The ISteamUGC::DownloadItemResult_t callback struct contains the awarding ID (m_unAppID) associated with the workshop item. Information technology should be compared against the running application ID as the handler will be called for all particular downloads regardless of the running application.

Retrieving information about the local copy of the Workshop Particular

  • ISteamUGC::GetItemInstallInfo - Gets info about currently installed content on the disc for workshop items that have k_EItemStateInstalled set.

Notification when a Workshop Particular is Installed or Updated

  • Register a callback handler for ISteamUGC::ItemInstalled_t.

Querying Content

The ISteamUGC interface provides a flexible way to enumerate the various kinds of UGC in Steam (east.grand. Workshop items, screenshots, videos, etc.).

ISteamUGCFlows-QueryingContent-web2.png

  1. Annals a phone call issue handler for SteamUGCQueryCompleted_t.
  2. There are a few methods bachelor for creating the query depending upon the required scenario, Querying by Content Associated to a User or Querying All Content or getting the details of content you have ids for.
    • ISteamUGC::CreateQueryUserUGCRequest - Query UGC associated with a user. Yous can use this to listing the UGC the user is subscribed to amongst other things.
    • ISteamUGC::CreateQueryAllUGCRequest - Query for all matching UGC. You can apply this to list all of the available UGC for your app.
    • ISteamUGC::CreateQueryUGCDetailsRequest - Query for the details of specific workshop items.
  3. Customize the query equally appropriate past calling the pick setting methods:
    • When querying for User UGC
      • ISteamUGC::SetCloudFileNameFilter - Sets to only render items that take a specific filename on a pending UGC Query.
    • When querying for All UGC
      • ISteamUGC::SetMatchAnyTag - Sets whether workshop items will be returned if they have ane or more matching tag, or if all tags need to match on a pending UGC Query.
      • ISteamUGC::SetSearchText - Sets a string to that items need to match in either the championship or the description on a pending UGC Query.
      • ISteamUGC::SetRankedByTrendDays - Sets whether the order of the results will be updated based on the rank of items over a number of days on a awaiting UGC Query.
    • When querying for either blazon of UGC
      • ISteamUGC::AddRequiredTag - Adds a required tag to a awaiting UGC Query. This will only return UGC with the specified tag.
      • ISteamUGC::AddExcludedTag - Adds a excluded tag to a pending UGC Query. This volition simply return UGC without the specified tag.
      • ISteamUGC::AddRequiredKeyValueTag - Adds a required central-value tag to a pending UGC Query. This will only render workshop items that take a fundamental = [param]pKey[/param] and a value = [param]pValue[/param].
      • ISteamUGC::SetReturnOnlyIDs - Sets whether to only return IDs instead of all the details on a awaiting UGC Query. This is useful for when you don't demand all the data (e.g. you lot but want to get the IDs of the items a user has in their favorites list.)
      • ISteamUGC::SetReturnKeyValueTags - Sets whether to return any primal-value tags for the items on a pending UGC Query.
      • ISteamUGC::SetReturnLongDescription - Sets whether to return the full description for the items on a pending UGC Query.
      • ISteamUGC::SetReturnMetadata - Sets whether to return the developer specified metadata for the items on a pending UGC Query.
      • ISteamUGC::SetReturnChildren - Sets whether to render the IDs of the child items of the items on a awaiting UGC Query.
      • ISteamUGC::SetReturnAdditionalPreviews - Sets whether to return any additional images/videos attached to the items on a pending UGC Query.
      • ISteamUGC::SetReturnTotalOnly - Sets whether to only return the total number of matching items on a awaiting UGC Query. -- The actual items volition not exist returned when ISteamUGC::SteamUGCQueryCompleted_t is chosen.
      • ISteamUGC::SetLanguage - Sets the language to render the title and clarification in for the items on a awaiting UGC Query.
      • ISteamUGC::SetAllowCachedResponse - Sets whether results to be will be returned from the enshroud for the specific period of time on a awaiting UGC Query.
  4. Send the query to Steam using ISteamUGC::SendQueryUGCRequest which volition invoke the ISteamUGC::SteamUGCQueryCompleted_t call result handler registered in step one.
  5. In the telephone call result handler for ISteamUGC::SteamUGCQueryCompleted_t, call ISteamUGC::GetQueryUGCResult to call back the details for each item returned.
  6. You tin also call these functions to retrieve additional information for each item (some of this data is non returned past default, so you demand to configure your query appropriately):
    • ISteamUGC::GetQueryUGCPreviewURL - Call up the URL to the preview image of an private workshop item afterward receiving a querying UGC call result.
    • ISteamUGC::GetQueryUGCMetadata - Retrieve the developer set metadata of an individual workshop item after receiving a querying UGC call upshot.
    • ISteamUGC::GetQueryUGCChildren - Retrieve the ids of whatever kid items of an individual workshop detail afterwards receiving a querying UGC call result.
    • ISteamUGC::GetQueryUGCStatistic - Recall various statistics of an individual workshop item later on receiving a querying UGC call issue.
    • ISteamUGC::GetQueryUGCNumAdditionalPreviews and ISteamUGC::GetQueryUGCAdditionalPreview - Think the details of an additional preview associated with an individual workshop item later receiving a querying UGC telephone call consequence.
    • ISteamUGC::GetQueryUGCNumKeyValueTags and ISteamUGC::GetQueryUGCKeyValueTag - Call back the details of a cardinal-value tag associated with an private workshop item subsequently receiving a querying UGC phone call result.
  7. Call ISteamUGC::ReleaseQueryUGCRequest to free up any retention allocated while querying or retrieving the results.

Paging Results

Upwardly to l results will be returned from each query. Paging through more results can be achieved by creating a query that increments the unPage parameter (which should start at 1).

Playtime Tracking

To rail the playtime of Workshop items only call ISteamUGC::StartPlaytimeTracking with the ids of the items you want to track. So when the items are removed from play call ISteamUGC::StopPlaytimeTracking with the ids you desire to finish tracking or call ISteamUGC::StopPlaytimeTrackingForAllItems to stop tracking playtime for all items at in one case.
When your app shuts down, playtime tracking will automatically end.

You lot will also exist able to sort items by various playtime metrics in ISteamUGC::CreateQueryAllUGCRequest queries. Hither are the playtime based query types yous can use:

  • k_EUGCQuery_RankedByPlaytimeTrend - Sort past total playtime in the "trend" flow descending (set with ISteamUGC::SetRankedByTrendDays)
  • k_EUGCQuery_RankedByTotalPlaytime - Sort by total lifetime playtime descending.
  • k_EUGCQuery_RankedByAveragePlaytimeTrend - Sort past average playtime in the "tendency" period descending (set with ISteamUGC::SetRankedByTrendDays)
  • k_EUGCQuery_RankedByLifetimeAveragePlaytime - Sort by lifetime boilerplate playtime descending
  • k_EUGCQuery_RankedByPlaytimeSessionsTrend - Sort by number of play sessions in the "tendency" period descending (set up in ISteamUGC::SetRankedByTrendDays)
  • k_EUGCQuery_RankedByLifetimePlaytimeSessions - Sort by number of lifetime play sessions descending

Deleting Workshop Item Content

To delete a Workshop detail, you can call ISteamUGC::DeleteItem. Delight note that this does non prompt the user and cannot be undone.

Steamworks Case – SpaceWar Integration

The Steamworks API Case Awarding (SpaceWar) that comes with the Steamworks SDK demonstrates a subset of the ISteamUGC API.

  • CSpaceWarClient::LoadWorkshopItem demonstrates checking if a workshop item is downloaded and installed on disk as well equally requesting information about a workshop item by ISteamRemoteStorage::PublishedFileId_t
  • CSpaceWarClient::LoadWorkshopItems demonstrates retrieving the list of subscribed workshop items for the current user for the SpaceWar awarding
  • CSpaceWarClient::OnWorkshopItemInstalled demonstrates a callback handler for ISteamUGC::ItemInstalled_t

Workshop Legal Agreement

Workshop items volition be subconscious by default until the contributor agrees to the Steam Workshop Legal Understanding. In gild to make it easy for the contributor to make the item publicly visible, please exercise the following.

  1. Include text next to the button that submits an item to the workshop, something to the event of: "By submitting this detail, you concord to the workshop terms of service" (including the link)
  2. After a user submits an detail, open up a browser window to the Steam Workshop page for that item by calling ISteamFriends::ActivateGameOverlayToWebPage with pchURL set to steam://url/CommunityFilePage/<PublishedFileId_t> replacing <PublishedFileId_t> with the workshop item id.

This has the benefit of directing the writer to the workshop page and so that they tin see the item and configure information technology farther if necessary and will make it easy for the user to read and take the Steam Workshop Legal Agreement.

Web API

In addition to these methods, there are a fix of Web API interface that provides similar functionality along with community-based filtering APIs to list all shared content. Please consult the documentation for the ISteamRemoteStorage interface in the Web API listing.

Dedicated Game Servers

Game servers can also download and install items.

  • The Game Server will need to know the PublishedFileId_t to request a workshop item, this could be supplied by the game clients or set by the server operator. Then call ISteamUGC::DownloadItem to call up a temporary copy of the workshop item.
  • A phone call can then be made to ISteamUGC::GetItemInstallInfo to retrieve information to locate and apply the workshop detail.
  • Run into the Item Installation section higher up for more information on these API methods.

SteamCmd Integration

Along with the ISteamUGC API, the steamcmd.exe command line tool tin exist used to create and update workshop items for testing purposes. This should only be used for testing purposes, as the tool requires the user to enter their Steam credentials (something we don't desire customers to have to do).

To create a new Steam Workshop detail using steamcmd.exe a VDF file must beginning be created. The VDF is a plain text file that should contain the following keys.

"workshopitem" { "appid" "480" "publishedfileid" "5674" "contentfolder" "D:\\Content\\workshopitem" "previewfile" "D:\\Content\\preview.jpg" "visibility" "0" "title" "Squad Fortress Green Hat" "clarification" "A green chapeau for Team Fortress" "changenote" "Version ane.two" }

Notes:

  • The keys map to the various ISteamUGC::SetItem[...] methods. See the documentation above for more than details.
  • The values shown are examples merely and should exist updated appropriately.
  • To create a new item, appid must be set and publishedfileid must be unset or ready to 0.
  • To update an existing detail, appid and publishedfileid must both be set.
  • The remaining key/value pairs should be included in the VDF if the key should be updated.

Once the VDF has been created, steamcmd.exe tin be run with the workshop_build_item <build config filename> file parameter. For example:

steamcmd.exe +login myLoginName myPassword +workshop_build_item workshop_green_hat.vdf +quit

If the command is successful, the publishedfileid value in the VDF will be automatically updated to contain the ID of the workshop item. In this style, subsequent calls with steamcmd.exe for the same VDF volition result in an update rather than creation of a new detail.

Errors and Logging

The majority of ISteamUGC methods return boolean values. For boosted data on specific errors, there are a number of places to review:

  • Steam\logs\Workshop_log.txt is a log for all transfers that occur during workshop particular downloading
    and installation.
  • Steam\workshopbuilds\depot_build_<appid>.log is a log for all actions during the upload and update of a workshop detail.
  • ISteamUGC::SteamUGCQueryCompleted_t, ISteamUGC::CreateItemResult_t and ISteamUGC::SubmitItemUpdateResult_t comprise EResult variables that can be checked.

Frequently Asked Questions

Q: Can a separate application publish content to my game'due south Workshop?

Yeah. A divide awarding for editing or publishing tools can be configured with base application's workshop to accept content from that editing application.

To configure this, go to the Workshop Configuration section for the base application and curl to the bottom of the page. Enter the divide application's App ID in the field nether "App Publish Permissions" and striking "Add".

Once the Steamworks settings are published, the editing application will be able to publish content to the base application's workshop.

parkerbrerefrommen93.blogspot.com

Source: https://partner.steamgames.com/doc/features/workshop/implementation

0 Response to "How to Give Upload Perms to Steam Workshop Mod"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel