<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<script type="text/javascript" language="JavaScript">
function reDo() {
if (innerWidth != origWidth || innerHeight != origHeight)
location.reload();
}
if ((parseInt(navigator.appVersion) == 4) && (navigator.appName == "Netscape")) {
origWidth = innerWidth;
origHeight = innerHeight;
onresize = reDo;
}
onerror = null;
</script>
<style type="text/css">
< !-- div.WebHelpPopupMenu {
position: absolute;
left: 0px;
top: 0px;
z-index: 4;
visibility: hidden;
}
p.WebHelpNavBar {
text-align: right;
}
-->
</style>
<script type="text/javascript">
gRootRelPath = "../../../..";
gCommonRootRelPath = "../../../..";
gTopicId = "9.2.15.7";
<script type="text/javascript" src="../../../../template/scripts/rh.min.js"></script>
<script type="text/javascript" src="../../../../template/scripts/common.min.js"></script>
<script type="text/javascript" src="../../../../template/scripts/topic.min.js"></script>
<script type="text/javascript" src="../../../../template/scripts/topicwidgets.min.js"></script>
<script type="text/javascript" src="../../../../whxdata/projectsettings.js"></script>
<link rel="stylesheet" type="text/css" href="../../../../template/styles/topic.min.css"/>
<link rel="stylesheet" type="text/css" href="../../../../template/Charcoal_Grey/topicheader.css"/>
<meta name="topic-status" content="Draft"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Steam UGC</title>
<meta name="generator" content="Adobe RoboHelp 2019"/>
<link rel="stylesheet" href="../../../../assets/css/default.css" type="text/css"/>
<meta name="rh-authors" content="Mark Alexander"/>
<meta name="topic-comment" content="Reference section for the different Steam UGC functions"/>
<meta name="rh-index-keywords" content=""/>
<meta name="search-keywords" content="Steam UGC,User Generated Content,Workshop,Steam Workshop"/>
</head>
<body>
<div class="topic-header rh-hide" id="rh-topic-header" onclick="rh._.goToFullLayout()">
<div class="logo">
</div>
<div class="nav">
<div class="title" title="Steam UGC">
<span>Steam UGC</span>
</div>
<div class="gotohome" title="Click here to see this page in full context">
<span>Click here to see this page in full context</span>
</div>
</div>
</div>
<div class="topic-header-shadow rh-hide" id="rh-topic-header-shadow"></div>
<h1>Steam</h1>
<p>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. The simplest form of user generated content is the ability for the user to take and share screenshots, which is facilitated using the following two functions:</p>
<p> </p>
<ul class="colour">
<li><a href="steam_is_screenshot_requested.htm">steam_is_screenshot_requested</a></li>
<li><a href="steam_send_screenshot.htm">steam_send_screenshot</a></li>
</ul>
<p> </p>
<p>The rest of the function on this page are related to using the <strong>Steam Worksop</strong> and some of them require the <strong>Steam App ID</strong> for your project as well as a <strong>User ID</strong> for the person playing the game or their
user name, which can be found using the following functions:</p>
<p> </p>
<ul class="colour">
<li><a href="../Steam_API/steam_get_app_id.htm">steam_get_app_id</a></li>
<li><a href="../Steam_API/steam_get_user_account_id.htm">steam_get_user_account_id</a></li>
<li><a href="../Steam_API/steam_get_user_persona_name.htm">steam_get_user_persona_name</a></li>
</ul>
<p> </p>
<p>Before using any of the built in functions for the Steam UGC (<strong>U</strong>ser <strong>G</strong>enerated <strong>C</strong>ontent) 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:</p>
<ul class="colour">
<li><a href="https://partner.steamgames.com/documentation/ugc#Tech" target="_blank">Sharing User Generated Content</a></li>
</ul>
<p class="note"><strong>NOTE</strong>: You need to have your game accepted for the Steam online store and have access to the developer areas of the Steam API documentation.</p>
<p>All subscribed UGC items will be downloaded by the Steam client automatically, and you should have code in the <a href="../../../../The_Asset_Editors/Object_Properties/Async_Events/Steam.htm">Steam Asynchronous Event</a> to catch this and store the
ID of the UGC that has been downloaded for use in the other UGC functions.</p>
<p class="note"><b>IMPORTANT!</b> Steam UGC IDs 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).</p>
<p>The normal workflow for getting UGC into your game would be as follows:</p>
<ol>
<li>The user would subscribe to an item (either from your game using <a href="steam_ugc_subscribe_item.htm"><tt>steam_ugc_subscribe_item()</tt></a> or from the client/browser.</li>
<li>Your game would "listen" for new subscriptions with the appropriate code in the Steam Async Event.</li>
<li>When you get a subscription async event, you would then check if the item is installed (ie: downloaded) with <a href="steam_ugc_get_item_install_info.htm"><tt>steam_ugc_get_item_install_info()</tt></a>.</li>
<li>If the item is <i>not</i> installed, you'll need a check using <a href="steam_ugc_get_item_update_info.htm"><tt>steam_ugc_get_item_update_info()</tt></a> to track the download progress.</li>
</ol>
<p>The following sections explain all the functions required to get UGC functioning in GameMaker Studio 2:</p>
<p> </p>
<h2><label for="a">Creating And Editing Content</label></h2>
<p>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: <a href="https://partner.steamgames.com/documentation/ugc#CreateUploadContent" target="_blank">Creating And Uploading Content</a>.</p>
<p> </p>
<ul class="colour">
<li><a href="steam_ugc_create_item.htm">steam_ugc_create_item</a></li>
<li><a href="steam_ugc_start_item_update.htm">steam_ugc_start_item_update</a></li>
<li><a href="steam_ugc_set_item_title.htm">steam_ugc_set_item_title</a></li>
<li><a href="steam_ugc_set_item_description.htm">steam_ugc_set_item_description</a></li>
<li><a href="steam_ugc_set_item_visibility.htm">steam_ugc_set_item_visibility</a></li>
<li><a href="steam_ugc_set_item_tags.htm">steam_ugc_set_item_tags</a></li>
<li><a href="steam_ugc_set_item_content.htm">steam_ugc_set_item_content</a></li>
<li><a href="steam_ugc_set_item_preview.htm">steam_ugc_set_item_preview</a></li>
<li><a href="steam_ugc_submit_item_update.htm">steam_ugc_submit_item_update</a></li>
<li><a href="steam_ugc_get_item_update_progress.htm">steam_ugc_get_item_update_progress</a></li>
</ul>
<p> </p>
<p> </p>
<h2><label for="b">Consuming Content</label></h2>
<p>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 2 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:</p>
<p> </p>
<ul class="colour">
<li><a href="steam_ugc_subscribe_item.htm">steam_ugc_subscribe_item</a></li>
<li><a href="steam_ugc_unsubscribe_item.htm">steam_ugc_unsubscribe_item</a></li>
<li><a href="steam_ugc_num_subscribed_items.htm">steam_ugc_num_subscribed_items</a></li>
<li><a href="steam_ugc_get_subscribed_items.htm">steam_ugc_get_subscribed_items</a></li>
<li><a href="steam_ugc_get_item_install_info.htm">steam_ugc_get_item_install_info</a></li>
<li><a href="steam_ugc_get_item_update_info.htm">steam_ugc_get_item_update_info</a></li>
<li><a href="steam_ugc_request_item_details.htm">steam_ugc_request_item_details</a></li>
</ul>
<p> </p>
<p> </p>
<h2><label for="c">Querying Content</label></h2>
<p>There are also a large number of functions available to query the Steam API about the UGC items available:</p>
<p> </p>
<ul class="colour">
<li><a href="steam_ugc_create_query_user.htm">steam_ugc_create_query_user</a></li>
<li><a href="steam_ugc_create_query_user_ex.htm">steam_ugc_create_query_user_ex</a></li>
<li><a href="steam_ugc_create_query_all.htm">steam_ugc_create_query_all</a></li>
<li><a href="steam_ugc_create_query_all_ex.htm">steam_ugc_create_query_all_ex</a></li>
<li><a href="steam_ugc_query_set_cloud_filename_filter.htm">steam_ugc_query_set_cloud_filename_filter</a></li>
<li><a href="steam_ugc_query_set_match_any_tag.htm">steam_ugc_query_set_match_any_tag</a></li>
<li><a href="steam_ugc_query_set_search_text.htm">steam_ugc_query_set_search_text</a></li>
<li><a href="steam_ugc_query_set_ranked_by_trend_days.htm">steam_ugc_query_set_ranked_by_trend_days</a></li>
<li><a href="steam_ugc_query_add_required_tag.htm">steam_ugc_query_add_required_tag</a></li>
<li><a href="steam_ugc_query_add_excluded_tag.htm">steam_ugc_query_add_excluded_tag</a></li>
<li><a href="steam_ugc_query_set_return_long_description.htm">steam_ugc_query_set_return_long_description</a></li>
<li><a href="steam_ugc_query_set_return_total_only.htm">steam_ugc_query_set_return_total_only</a></li>
<li><a href="steam_ugc_query_set_allow_cached_response.htm">steam_ugc_query_set_allow_cached_response</a></li>
<li><a href="steam_ugc_send_query.htm">steam_ugc_send_query</a></li>
</ul>
<p> </p>
<p>You can get a preview image of any UGC item from the workshop by using the function <tt>steam_ugc_send_query()</tt> to get the preview file handle of the image, and then calling the following function:</p>
<ul class="colour">
<li><a href="steam_ugc_download.htm">steam_ugc_download</a></li>
</ul>
<p> </p>
<p> </p>
<p> </p>
<div class="footer">
<div class="buttons">
<div class="clear">
<div style="float:left">Back: <a href="../Steam.htm">Steam</a></div>
<div style="float:right">Next: <a href="../Steam_API/Steam_API.htm">General Steam API</a></div>
</div>
</div>
<h5>© Copyright YoYo Games Ltd. 2020 All Rights Reserved</h5>
</div>
</body></html>