UserGeneratedContent.Client
Last updated
Last updated
Support us as a and get instant access to all our assets, exclusive tools and assets, escalated support and issue tracking and our gratitude. These articles are made possible by our ... become a sponsor today!
Occurs when a UGC item is downloaded
The event handler would look similar to
Called when a workshop item has been installed or updated
The event handler would look similar to
The callback for this method would look like the following.
Adds a dependency between the given item and the appid. This list of dependencies can be retrieved by calling GetAppDependencies. This is a soft-dependency that is displayed on the web. It is up to the application to determine whether the item can actually be used or not.
Adds a workshop item as a dependency to the specified item. If the nParentPublishedFileID item is of type k_EWorkshopFileTypeCollection, than the nChildPublishedFileID is simply added to that collection. Otherwise, the dependency is a soft one that is displayed on the web and can be retrieved via the ISteamUGC API using a combination of the m_unNumChildren member variable of the SteamUGCDetails_t struct and GetQueryUGCChildren.
Adds a excluded tag to a pending UGC Query. This will only return UGC without the specified tag.
Adds a key-value tag pair to an item. Keys can map to multiple different values (1-to-many relationship). Key names are restricted to alpha-numeric characters and the '_' character. Both keys and values cannot exceed 255 characters in length. Key-value tags are searchable by exact match only.
Adds an additional preview file for the item. Then the format of the image should be one that both the web and the application(if necessary) can render, and must be under 1MB.Suggested formats include JPG, PNG and GIF.
Adds an additional video preview from YouTube for the item.
Adds workshop item to the users favorite list. The callback to this method would look like the following
Adds a required key-value tag to a pending UGC Query. This will only return workshop items that have a key = pKey and a value = pValue.
Adds a required tag to a pending UGC Query. This will only return UGC with the specified tag.
The first overload handles the creation and update of new items in a single line call.
The remaining parameters deal with additional preview images and videos as well as the key value tag system
The callback for this overload would look similar to following.
The second overload is only creates an empty UGC File. You would then manually start the update process and set each of its fields. This approach is more akin to using the Raw Steam API.
The callback for this overload would look similar to the following.
Query for all matching UGC. You can use this to list all of the available UGC for your app. You must release the handle returned by this function by calling WorkshopReleaseQueryRequest when you are done with it!
All of the overloads do the same thing they simply reduce the need for in line conversion when using different types of collecitons.
Query for the details of specific workshop items. You must release the handle returned by this function by calling WorkshopReleaseQueryRequest when you are done with it!
Query UGC associated with a user. You can use this to list the UGC the user is subscribed to amongst other things. You must release the handle returned by this function by calling WorkshopReleaseQueryRequest when you are done with it!
Frees a UGC query
Requests delete of a UGC item
Request download of a UGC item
Request the app dependencies of a UGC item
Request the download informaiton of a UGC item
Request the installation informaiton of a UGC item
Request the installation informaiton of a UGC item
Gets the current state of a workshop item on this client.
Checks if the 'checkFlag' value is in the 'value'
Cheks if any of the 'checkflags' values are in the 'value'
Gets the progress of an item update.
Returns the number of subscribed UGC items
Request an additional preview for a UGC item
Request the child items of a given UGC item
Retrieve the details of a key-value tag associated with an individual workshop item after receiving a querying UGC call result.
Request the metadata of a UGC item
Request the number of previews of a UGC item
Request the number of key value tags for a UGC item
Get the preview URL of a UGC item
Fetch the results of a UGC query
Fetch the statistics of a UGC query
Get the file IDs of all subscribed UGC items up to the array size. This is a wrapper around the raw API entry and maintained for backward compatibility.
or
Returns the list of items the user is subscribed to as a simple array.
or
This will query for the details of the items the user is subscribed to and invoke a callback when those details are returned.
Get the item vote value of a UGC item. The callback for this would look like the following
Asynchronously retrieves data about whether the user accepted the Workshop EULA for the current app. The callback for this method would look like the following.
Show the app's latest Workshop EULA to the user in an overlay window, where they can accept it or not
Request the removal of app dependency from a UGC item
Request the removal of a dependency from a UGC item
Request the item be removed from the user's favourites list if present
Remove UGC Item key value tags
Remove UGC Item Preview
Request details of a given UGC item
Send a UGC query for processing
Set the allow cashed response on Steam
Set the file name filter value for use with queries
Sets the folder path that Valve will upload from when submitting an item update
Sets the item description of the item when submitting an item update
Sets the item metadata of the item when submitting an item update
Set a query to return the playtime stats for related items
Set a query to only return the total number of files that match the arguments
Sets the search text used when executing a UGC query
Sets the vote value for a given item from this user.
Request the start of an item update. This must be called before you set item preview, description, etc.
Start tracking playtime for the indicated items.
Stop tracking playtime for the indicated items.
Stop tracking playtime for all relevant items
Submit an update request committing any changes made since the StartItemUpdate request.
Subscribe to the indicated item
Suspend downloads
Unsubscribe to the indicated item
Update item preview image file
Update item preview video
Creating a new item can be done in one of two ways.
Example:
Assuming a method such as
Then you can call the method such as
This callback will contain a UGCUpdateHandle_t which can be used by other methods to update key features using the following methods
You can also use these tools to modify and existing file assuming you are its author
AddItemKeyValueTag
AddItemPreviewFile
AddItemPreviewVideo
SetItemContent
SetItemDescription
SetItemMetadata
SetItemPreview
SetItemTags
SetItemTitle
SetItemUpdateLanguage
SetItemVisibility
UpdateItemPreviewVideo
UpdateItemPreviewFIle
UpdateItemPreviewVideo
RemoveItemKeyValueTags
RemoveItemPreview
For example the following code would update the title and description
When complete you should submit the update
The remainder of this section talks about manually querying items.
The process is similar in that you would "create" or "start" a query which will give you a UGCQueryHandle_t
which can then be modified to fine tune your query before submitting it to get the matching records.
To crete the UGCQueryHandle_t
Once you have created your handle you can modify the way it searches for matching items by calling the following methods.
AddExcludeTag
AddRequiredKeyValueTag
AddRequiredTag
SetAllowCashedResponse
SetCloudFileNameFilter
SetLanguage
SetMatchAnyTag
SetRankedByTrendDays
SetReturnAdditionalPreviews
SetReturnChildren
SetReturnKeyValueTags
SetReturnLongDescription
SetReturnMetadata
SetReturnOnlyIDs
SetReturnPlaytimeStats
SetReturnTotalOnly
SetSearchText
Once you have your query set up you can submit it to fetch the related items. Note the UGC Query system is a page query system. It will never return more than 50 items (determined by Valve) and so you will need to increment the page in your query handle to fetch each successive set of records.
When the callback is invoked its parameter will indicate the result state and query handle, assuming the state is eResultOk you can fetch the found items via, the following assumes param
is the SteamUGCQueryComplete_t object returned by the SendQueryUGCRequest's callback
Getting the next page of data is done the same way, you will need to track what page your on and howmany there are and create a new query updating the page.
Our UGC Query Manager does this fore you. You can simply incrament the page by calling SetPage
and we will release any existing handle and fetch a new handle for the next page. You will need to re apply any modifications to the query you may have done before executing it again.
To get the list of subscirbed items e.g. items the user has indicated should be installed
This is a native callback, details as to the meaning of fields in the AddAppDependencyResult_t object can be found .
This is a native callback, details as to the meaning of fields in the AddUGCDependencyResult_t object can be found .
This is a native Steam API callback you can find more details .
The first parameter defines the core fields of the item to be created, note the method simply calls this overload.
See the definition for more information on what fields it contains.
Learn more about manual creation and update of items .
This works exsactly the same as the native Steam API callback as documented and uses those native Steam API structures.
The can make working with quires much simpler.
The can make working with quires much simpler.
This is a native callback you can find more details on it .
When using the 1 liner approach you will first create a object. This object defines the item you wish to create e.g. its name, description, content folder, etc.
The callback for this method is a delegate that takes 1 parameter of type .
To learn more about please read the related article.
The status returned to the callback will indicate the status of the operation. Note that the operation occurs in two stages. First a blank item is created and then once that has been found successful that blank item will be updated with the content and settings indicated thus it is possible for a blank item to be created but for the update to fail. Please see the in the status object for more details.
The easiest way to handle a UGC / Workshop browser in game is to use the . The manager uses the same features present in the interface so it can be done manually.
You can see how we implemented paging in the if you wished to do so your self or simply to better understand the system.