User Generated Content (UGC)

This section shows the functions associated with the Steam API specifically for user generated content (UGC).

This section is for those users that have been given access to the Steam API for publishing your game to that platform and that want to use the possibilities that the Steam Workshop and Community gives you for adding and generating user content in your projects. Some of the functions in this page require the Steam App ID for your project as well as a User ID for the person playing the game or their user name, which can be found using the following functions:

  1. steam_get_app_id
  2. steam_get_user_account_id
  3. steam_get_user_persona_name

Before using any of the built in functions for the Steam UGC API you need to have set up your game correctly from the Steam dashboard and you should have read through the required documentation found here: Sharing User Generated Content (note that you need to have your game accepted for the Steam network and have access to the developer areas of the Steam API documentation). All subscribed UGC items will be downloaded by the Steam client automatically, and you should have code in the Steam Asynchronous Event to catch this and store the ID of the UGC that has been downloaded for use in the other UGC functions.

IMPORTANT! Steam UGC ID's can be huge numbers over 600,000,000. This means that sometimes you may need to store these as a string rather than try and store them as a real value, especially if working with buffers or trying to write the value to a text file (since this will convert it to a simplified standard format like "6.6624e+003" which will cause issues being read back).

The normal workflow for getting UGC into your game would be as follows:

Creating And Editing Content

The following functions are essentially "wrapper" functions for those supplied in the Steam API for creating and uploading content to their servers. As such, we recommend that you read over the linked Steam documentation before using them to gain a greater understanding of how they work: Creating And Uploading Content.

  1. steam_ugc_create_item
  2. steam_ugc_start_item_update
  3. steam_ugc_set_item_title
  4. steam_ugc_set_item_description
  5. steam_ugc_set_item_visibility
  6. steam_ugc_set_item_tags
  7. steam_ugc_set_item_content
  8. steam_ugc_set_item_preview
  9. steam_ugc_submit_item_update
  10. steam_ugc_get_item_update_progress

Consuming Content

Once your user content has been created and the workshop has it available for download, people can subscribe to it through the Steam App or through the Web portal. However GameMaker: Studio also includes the following functions to use the Steam API for creating and canceling subscriptions as well as for getting information about what the user is subscribed to currently:

  1. steam_ugc_subscribe_item
  2. steam_ugc_unsubscribe_item
  3. steam_ugc_num_subscribed_items
  4. steam_ugc_get_subscribed_items
  5. steam_ugc_get_item_install_info
  6. steam_ugc_get_item_update_info
  7. steam_ugc_request_item_details

Querying Content

There are also a large number of functions available to query the Steam API about the UGC items available:

  1. steam_ugc_create_query_user
  2. steam_ugc_create_query_user_ex
  3. steam_ugc_create_query_all
  4. steam_ugc_create_query_all_ex
  5. steam_ugc_query_set_cloud_filename_filter
  6. steam_ugc_query_set_match_any_tag
  7. steam_ugc_query_set_search_text
  8. steam_ugc_query_set_ranked_by_trend_days
  9. steam_ugc_query_add_required_tag
  10. steam_ugc_query_add_excluded_tag
  11. steam_ugc_query_set_return_long_description
  12. steam_ugc_query_set_return_total_only
  13. steam_ugc_query_set_allow_cached_response
  14. steam_ugc_send_query

You can get a preview image of any UGC item from the workshop by using the function steam_ugc_send_query() to get the preview file handle of the image, and then calling the following function:

  1. steam_ugc_download


Back: Contents
© Copyright YoYo Games Ltd. 2018 All Rights Reserved