Pixel-Composer/datafiles/Steamworks_Extension_Documentation.html

13665 lines
850 KiB
HTML
Raw Normal View History

2023-02-19 02:13:19 +01:00
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Documentation </title>
<style>/*!
* Bootstrap v3.4.1 (https://getbootstrap.com/)
* Copyright 2011-2019 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*//*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;-moz-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:700}dfn{font-style:italic}h1{font-size:2em;margin:.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type=checkbox],input[type=radio]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}input[type=search]{-webkit-appearance:textfield;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:700}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}/*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */@media print{*,:after,:before{color:#000!important;text-shadow:none!important;background:0 0!important;-webkit-box-shadow:none!important;box-shadow:none!important}a,a:visited{text-decoration:underline}a[href]:after{content:" (" attr(href) ")"}abbr[title]:after{content:" (" attr(title) ")"}a[href^="#"]:after,a[href^="javascript:"]:after{content:""}blockquote,pre{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}img,tr{page-break-inside:avoid}img{max-width:100%!important}h2,h3,p{orphans:3;widows:3}h2,h3{page-break-after:avoid}.navbar{display:none}.btn>.caret,.dropup>.btn>.caret{border-top-color:#000!important}.label{border:1px solid #000}.table{border-collapse:collapse!important}.table td,.table th{background-color:#fff!important}.table-bordered td,.table-bordered th{border:1px solid #ddd!important}}@font-face{font-family:"Glyphicons Halflings";src:url(../fonts/glyphicons-halflings-regular.eot);src:url(../fonts/glyphicons-halflings-regular.eot?#iefix) format("embedded-opentype"),url(../fonts/glyphicons-halflings-regular.woff2) format("woff2"),url(../fonts/glyphicons-halflings-regular.woff) format("woff"),url(../fonts/glyphicons-halflings-regular.ttf) format("truetype"),url(../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular) format("svg")}.glyphicon{position:relative;top:1px;display:inline-block;font-family:"Glyphicons Halflings";font-style:normal;font-weight:400;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.glyphicon-asterisk:before{content:"\002a"}.glyphicon-plus:before{content:"\002b"}.glyphicon-eur:before,.glyphicon-euro:before{content:"\20ac"}.glyphicon-minus:before{content:"\2212"}.glyphicon-cloud:before{content:"\2601"}.glyphicon-envelope:before{content:"\2709"}.glyphicon
/*# sourceMappingURL=bootstrap.min.css.map */</style>
<style>/*
Original highlight.js style (c) Ivan Sagalaev <maniac@softwaremaniacs.org>
*/
.hljs {
display: block;
overflow-x: auto;
padding: 0.5em;
background: #F0F0F0;
}
/* Base color: saturation 0; */
.hljs,
.hljs-subst {
color: #444;
}
.hljs-comment {
color: #888888;
}
.hljs-keyword,
.hljs-attribute,
.hljs-selector-tag,
.hljs-meta-keyword,
.hljs-doctag,
.hljs-name {
font-weight: bold;
}
/* User color: hue: 0 */
.hljs-type,
.hljs-string,
.hljs-number,
.hljs-selector-id,
.hljs-selector-class,
.hljs-quote,
.hljs-template-tag,
.hljs-deletion {
color: #880000;
}
.hljs-title,
.hljs-section {
color: #880000;
font-weight: bold;
}
.hljs-regexp,
.hljs-symbol,
.hljs-variable,
.hljs-template-variable,
.hljs-link,
.hljs-selector-attr,
.hljs-selector-pseudo {
color: #BC6060;
}
/* Language color: hue: 90; */
.hljs-literal {
color: #78A960;
}
.hljs-built_in,
.hljs-bullet,
.hljs-code,
.hljs-addition {
color: #397300;
}
/* Meta color: hue: 200 */
.hljs-meta {
color: #1f7199;
}
.hljs-meta-string {
color: #4d99bf;
}
/* Misc effects */
.hljs-emphasis {
font-style: italic;
}
.hljs-strong {
font-weight: bold;
}
</style>
<style>/*
github.com style (c) Vasily Polovnyov <vast@whiteants.net>
*/
.hljs {
display: block;
overflow-x: auto;
padding: 0.5em;
color: #333;
background: #f8f8f8;
}
.hljs-comment,
.hljs-quote {
color: #998;
font-style: italic;
}
.hljs-keyword,
.hljs-selector-tag,
.hljs-subst {
color: #333;
font-weight: bold;
}
.hljs-number,
.hljs-literal,
.hljs-variable,
.hljs-template-variable,
.hljs-tag .hljs-attr {
color: #008080;
}
.hljs-string,
.hljs-doctag {
color: #d14;
}
.hljs-title,
.hljs-section,
.hljs-selector-id {
color: #900;
font-weight: bold;
}
.hljs-subst {
font-weight: normal;
}
.hljs-type,
.hljs-class .hljs-title {
color: #458;
font-weight: bold;
}
.hljs-tag,
.hljs-name,
.hljs-attribute {
color: #000080;
font-weight: normal;
}
.hljs-regexp,
.hljs-link {
color: #009926;
}
.hljs-symbol,
.hljs-bullet {
color: #990073;
}
.hljs-built_in,
.hljs-builtin-name {
color: #0086b3;
}
.hljs-meta {
color: #999;
font-weight: bold;
}
.hljs-deletion {
background: #fdd;
}
.hljs-addition {
background: #dfd;
}
.hljs-emphasis {
font-style: italic;
}
.hljs-strong {
font-weight: bold;
}
</style>
<style> /*General for HTML and PDF*/
body {
font-family: Helvetica, arial, sans-serif;
font-size: 14px;
line-height: 1.6;
padding-top: 10px;
padding-bottom: 10px;
background-color: white;
padding: 30px; }
body > *:first-child {
margin-top: 0 !important; }
body > *:last-child {
margin-bottom: 0 !important; }
a {
color: #4183C4; }
a.absent {
color: #cc0000; }
a.anchor {
display: block;
padding-left: 30px;
margin-left: -30px;
cursor: pointer;
position: absolute;
top: 0;
left: 0;
bottom: 0; }
h1, h2, h3, h4, h5, h6 {
margin: 20px 0 10px;
padding: 0;
font-weight: bold;
-webkit-font-smoothing: antialiased;
cursor: text;
position: relative; }
h1:hover a.anchor, h2:hover a.anchor, h3:hover a.anchor, h4:hover a.anchor, h5:hover a.anchor, h6:hover a.anchor {
background: url("../../images/modules/styleguide/para.png") no-repeat 10px center;
text-decoration: none; }
h1 tt, h1 code {
font-size: inherit; }
h2 tt, h2 code {
font-size: inherit; }
h3 tt, h3 code {
font-size: inherit; }
h4 tt, h4 code {
font-size: inherit; }
h5 tt, h5 code {
font-size: inherit; }
h6 tt, h6 code {
font-size: inherit; }
h1 {
font-size: 28px;
color: black; }
h2 {
font-size: 24px;
border-bottom: 1px solid #cccccc;
color: black; }
h3 {
font-size: 18px; }
h4 {
font-size: 16px; }
h5 {
font-size: 14px; }
h6 {
color: #777777;
font-size: 14px; }
pre.hljs {
border:none;
padding: 12px;
}
code {
background-color: #EDEDED;
}
p, blockquote, ul, ol, dl, li, table, pre.hljs {
margin: 15px 0; }
hr {
background: transparent url("../../images/modules/pulls/dirty-shade.png") repeat-x 0 0;
border: 0 none;
color: #cccccc;
height: 4px;
padding: 0; }
body > h2:first-child {
margin-top: 0;
padding-top: 0; }
body > h1:first-child {
margin-top: 0;
padding-top: 0; }
body > h1:first-child + h2 {
margin-top: 0;
padding-top: 0; }
body > h3:first-child, body > h4:first-child, body > h5:first-child, body > h6:first-child {
margin-top: 0;
padding-top: 0; }
a:first-child h1, a:first-child h2, a:first-child h3, a:first-child h4, a:first-child h5, a:first-child h6 {
margin-top: 0;
padding-top: 0; }
h1 p, h2 p, h3 p, h4 p, h5 p, h6 p {
margin-top: 0; }
li p.first {
display: inline-block; }
ul, ol {
padding-left: 30px; }
ul :first-child, ol :first-child {
margin-top: 0; }
ul :last-child, ol :last-child {
margin-bottom: 0; }
dl {
padding: 0; }
dl dt {
font-size: 14px;
font-weight: bold;
font-style: italic;
padding: 0;
margin: 15px 0 5px; }
dl dt:first-child {
padding: 0; }
dl dt > :first-child {
margin-top: 0; }
dl dt > :last-child {
margin-bottom: 0; }
dl dd {
margin: 0 0 15px;
padding: 0 15px; }
dl dd > :first-child {
margin-top: 0; }
dl dd > :last-child {
margin-bottom: 0; }
blockquote {
border-left: 4px solid #dddddd;
padding: 0 15px;
font-size: 14px;
color: #777777; }
blockquote > :first-child {
margin-top: 0; }
blockquote > :last-child {
margin-bottom: 0; }
table {
padding: 0; }
table tr {
border-top: 1px solid #cccccc;
background-color: white;
margin: 0;
padding: 0; }
table tr:nth-child(2n) {
background-color: #f8f8f8; }
table tr th {
font-weight: bold;
border: 1px solid #cccccc;
text-align: left;
margin: 0;
padding: 6px 13px; }
table tr td {
border: 1px solid #cccccc;
text-align: left;
margin: 0;
padding: 6px 13px; }
table tr th :first-child, table tr td :first-child {
margin-top: 0; }
table tr th :last-child, table tr td :last-child {
margin-bottom: 0; }
img {
max-width: 100%; }
span.frame {
display: block;
overflow: hidden; }
span.frame > span {
border: 1px solid #dddddd;
display: block;
float: left;
overflow: hidden;
margin: 13px 0 0;
padding: 7px;
width: auto; }
span.frame span img {
display: block;
float: left; }
span.frame span span {
clear: both;
color: #333333;
display: block;
padding: 5px 0 0; }
span.align-center {
display: block;
overflow: hidden;
clear: both; }
span.align-center > span {
display: block;
overflow: hidden;
margin: 13px auto 0;
text-align: center; }
span.align-center span img {
margin: 0 auto;
text-align: center; }
span.align-right {
display: block;
overflow: hidden;
clear: both; }
span.align-right > span {
display: block;
overflow: hidden;
margin: 13px 0 0;
text-align: right; }
span.align-right span img {
margin: 0;
text-align: right; }
span.float-left {
display: block;
margin-right: 13px;
overflow: hidden;
float: left; }
span.float-left span {
margin: 13px 0 0; }
span.float-right {
display: block;
margin-left: 13px;
overflow: hidden;
float: right; }
span.float-right > span {
display: block;
overflow: hidden;
margin: 13px auto 0;
text-align: right; }
.nav-container ul, .nav-container ol {
margin-left: 0px;
padding-left: 0px;
}
.nav {
margin:0;
}
.nav-inner > .nav, .nav-inner > .nav > li > .nav {
border-bottom: 1px solid #e0e0e0;
margin-bottom: 2px;
margin-top: 2px;
}
.nav-inner > .nav > li:last-child > .nav {
border-bottom: none;
}
.nav > li {
margin: 0;
}
.nav > li > a {
display: block;
padding: 3px 18px;
font-size: 1em;
font-weight: 500;
}
.nav > li > .nav > li > a {
padding:2px 28px;
font-size: 0.92em;
font-weight: 400;
}
.nav > li > .nav > li > .nav > li > a {
padding:2px 36px;
font-size: 0.86em;
font-weight: 400;
}
.nav > li > .nav > li > .nav > li > .nav > li > a {
padding:2px 44px;
font-size: 0.86em;
font-weight: 400;
}
.nav li span {
margin: 0 0;
padding: 3px 18px;
font-size: inherit;
color:#888
}
/*For HTML*/
.html-doc {
padding-top: 60px !important;
}
.html-doc .footer {
font-size: 85%;
margin-top: 20px;
width: 250px;
}
.page:before {
content:"";
display:block;
height:55px; /* fixed header height*/
margin:-55px 0 0; /* negative fixed header height */
}
.page {
height:1px;
font-size:1px;
width: 1px;
padding:50px 0 0 0;
margin: -50px 0 0 0;
}
.html-doc .nav-container {
margin-top: 10px;
position: relative;
}
.html-doc .logo-img {
padding: 10px;
margin:7px 0 0 0;
max-width:75%;
max-height:25%;
}
.html-doc .nav-container .toc {
display: block;
color:#888;
text-transform: uppercase;
padding: 4px 18px;
font-weight: 500;
font-size:90%
}
.html-doc .nav-container > .nav-inner {
position: fixed;
}
.html-doc .nav li a:before, .html-doc .nav li span:before {
content: "\00B7 ";
}
.html-doc .nav li.active > a {
color:darkred;
}
.html-doc .nav li.active > a:before {
content: "\25b8 ";
}
.navbar-default .navbar-nav>li>a.generated-by,
.navbar-default .navbar-nav>li>a.generated-by:visited {
font-size: 85%;
color:#ADADAD;
text-shadow: 1px 1px 0 #fff;
}
.navbar-default .navbar-nav>li>a.generated-by:hover {
color:#666
}
@media (max-width: 992px) {
.html-doc .nav-container > .nav-inner {
position: relative;
}
}
@media (min-width: 768px) {
.navbar > .container .doc-title {
margin-left: 0;
}
.navbar-right {
margin-right: 0;
}
}
@media (min-width: 992px) {
.nav-inner {
min-width: 210px;
}
}
@media (min-width: 1200px) {
.nav-inner {
min-width: 250px;
}
}
/*For PDF*/
.pdf-doc{
padding: 0px;
}
.pdf-doc .navbar-toggle {
display: none;
}
.pdf-doc .coverimg {
max-width:50%;
}
.pdf-doc .covertitle {
padding-top: 40%;
text-align: right;
font-size: 40px;
}
.pdf-doc .nav-container {
page-break-before: always !important;
display: block;
}
.pdf-doc pre.hljs, .pdf-doc code {
font-size: 80%;
}
.pdf-doc .nav > li > a {
padding: 3px 6px;
}
.pdf-doc .nav > li > .pdf-doc .nav > li > a {
padding:2px 16px;
}
.pdf-doc .nav > li > .pdf-doc .nav > li > .pdf-doc .nav > li > a {
padding:2px 24px;
}
.pdf-doc .nav > li > .pdf-doc .nav > li > .pdf-doc .nav > li > .pdf-doc .nav > li > a {
padding:2px 32px;
}
.pdf-doc .nav li span {
padding: 3px 6px;
}
</style>
<style>.nav > li > .nav > li > .nav > li > .nav > li {display: none;}</style>
<script>/*! jQuery v2.2.4 | (c) jQuery Foundation | jquery.org/license */
!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=a.document,e=c.slice,f=c.concat,g=c.push,h=c.indexOf,i={},j=i.toString,k=i.hasOwnProperty,l={},m="2.2.4",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return e.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:e.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a){return n.each(this,a)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(e.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor()},push:g,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(n.isPlainObject(d)||(e=n.isArray(d)))?(e?(e=!1,f=c&&n.isArray(c)?c:[]):f=c&&n.isPlainObject(c)?c:{},g[b]=n.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray,isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){var b=a&&a.toString();return!n.isArray(a)&&b-parseFloat(b)+1>=0},isPlainObject:function(a){var b;if("object"!==n.type(a)||a.nodeType||n.isWindow(a))return!1;if(a.constructor&&!k.call(a,"constructor")&&!k.call(a.constructor.prototype||{},"isPrototypeOf"))return!1;for(b in a);return void 0===b||k.call(a,b)},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?i[j.call(a)]||"object":typeof a},globalEval:function(a){var b,c=eval;a=n.trim(a),a&&(1===a.indexOf("use strict")?(b=d.createElement("script"),b.text=a,d.head.appendChild(b).parentNode.removeChild(b)):c(a))},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b){var c,d=0;if(s(a)){for(c=a.length;c>d;d++)if(b.call(a[d],d,a[d])===!1)break}else for(d in a)if(b.call(a[d],d,a[d])===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):g.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:h.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;c>d;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,e,g=0,h=[];if(s(a))for(d=a.length;d>g;g++)e=b(a[g],g,c),null!=e&&h.push(e);else for(g in a)e=b(a[g],g,c),null!=e&&h.push(e);return f.apply([],h)},guid:1,proxy:function(a,b){var c,d,f;return"string"==typeof b&&(c=a[b],b=a,a=c),n.isFunction(a)?(d=e.call(arguments,2),f=function(){return a.apply(b||this,d.concat(e.call(arguments)))},f.guid=a.guid=a.guid||n.guid++,f):void 0},now:Date.now,support:l}),"function"==typeof Symbol&&(n.fn[Symbol.iterator]=c[Symbol.iterator]),n.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(a,b){i["[object "+b+"]"]=b.toLowerCase()});function s(a){var b=!!a&&"length"in a&&a.length,c=n.type(a);return"function"
}catch(e){}O.set(a,b,c)}else c=void 0;return c}n.extend({hasData:function(a){return O.hasData(a)||N.hasData(a)},data:function(a,b,c){return O.access(a,b,c)},removeData:function(a,b){O.remove(a,b)},_data:function(a,b,c){return N.access(a,b,c)},_removeData:function(a,b){N.remove(a,b)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=O.get(f),1===f.nodeType&&!N.get(f,"hasDataAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),R(f,d,e[d])));N.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){O.set(this,a)}):K(this,function(b){var c,d;if(f&&void 0===b){if(c=O.get(f,a)||O.get(f,a.replace(Q,"-$&").toLowerCase()),void 0!==c)return c;if(d=n.camelCase(a),c=O.get(f,d),void 0!==c)return c;if(c=R(f,d,void 0),void 0!==c)return c}else d=n.camelCase(a),this.each(function(){var c=O.get(this,d);O.set(this,d,b),a.indexOf("-")>-1&&void 0!==c&&O.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){O.remove(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=N.get(a,b),c&&(!d||n.isArray(c)?d=N.access(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return N.get(a,c)||N.access(a,c,{empty:n.Callbacks("once memory").add(function(){N.remove(a,[b+"queue",c])})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?n.queue(this[0],a):void 0===b?this:this.each(function(){var c=n.queue(this,a,b);n._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&n.dequeue(this,a)})},dequeue:function(a){return this.each(function(){n.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=n.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=N.get(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var S=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,T=new RegExp("^(?:([+-])=|)("+S+")([a-z%]*)$","i"),U=["Top","Right","Bottom","Left"],V=function(a,b){return a=b||a,"none"===n.css(a,"display")||!n.contains(a.ownerDocument,a)};function W(a,b,c,d){var e,f=1,g=20,h=d?function(){return d.cur()}:function(){return n.css(a,b,"")},i=h(),j=c&&c[3]||(n.cssNumber[b]?"":"px"),k=(n.cssNumber[b]||"px"!==j&&+i)&&T.exec(n.css(a,b));if(k&&k[3]!==j){j=j||k[3],c=c||[],k=+i||1;do f=f||".5",k/=f,n.style(a,b,k+j);while(f!==(f=h()/i)&&1!==f&&--g)}return c&&(k=+k||+i||0,e=c[1]?k+(c[1]+1)*c[2]:+c[2],d&&(d.unit=j,d.start=k,d.end=e)),e}var X=/^(?:checkbox|radio)$/i,Y=/<([\w:-]+)/,Z=/^$|\/(?:java|ecma)script/i,$={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};$.optgroup=$.option,$.tbody=$.tfoot=$.colgroup=$.caption=$.thead,$.th=$.td;function _(a,b){var c="undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName(b||"*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&n.nodeName(a,b)?n.merge([a],c):c}function aa(a,b){for(var c=0,d=a.length;d>c;c++)N.set(a[c],"globalEval",!b||N.get(b[c],"globalEval"))}var ba=/<|&#?\w+;/;function ca(a,b,c,d,e){for(var f,g,h,i,j,k,l=b.createDocumentFragment(),m=[],o=0,p=a.length;p>o;o++)if(f=a[o],f||0===f)if("object"===n.type(f))n.merge(m,f.nodeType?[f]:f);else if(ba.test(f)){g=g||l.appendChild(b.createElement("div")),h=(Y.exec(f)||["",""])[1].toLowerCase(),i=$[h]||$._default,g.innerHTML=i[1]+n.htmlPrefilter(f)+i[2],k=i[0];while(k--)g=g.lastChild;n.merge(m,g.childNodes),g=l.firstChild,g.textContent=""}else m.push
void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=n.find.attr(a,"tabindex");return b?parseInt(b,10):cb.test(a.nodeName)||db.test(a.nodeName)&&a.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),l.optSelected||(n.propHooks.selected={get:function(a){var b=a.parentNode;return b&&b.parentNode&&b.parentNode.selectedIndex,null},set:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}}),n.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){n.propFix[this.toLowerCase()]=this});var eb=/[\t\r\n\f]/g;function fb(a){return a.getAttribute&&a.getAttribute("class")||""}n.fn.extend({addClass:function(a){var b,c,d,e,f,g,h,i=0;if(n.isFunction(a))return this.each(function(b){n(this).addClass(a.call(this,b,fb(this)))});if("string"==typeof a&&a){b=a.match(G)||[];while(c=this[i++])if(e=fb(c),d=1===c.nodeType&&(" "+e+" ").replace(eb," ")){g=0;while(f=b[g++])d.indexOf(" "+f+" ")<0&&(d+=f+" ");h=n.trim(d),e!==h&&c.setAttribute("class",h)}}return this},removeClass:function(a){var b,c,d,e,f,g,h,i=0;if(n.isFunction(a))return this.each(function(b){n(this).removeClass(a.call(this,b,fb(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof a&&a){b=a.match(G)||[];while(c=this[i++])if(e=fb(c),d=1===c.nodeType&&(" "+e+" ").replace(eb," ")){g=0;while(f=b[g++])while(d.indexOf(" "+f+" ")>-1)d=d.replace(" "+f+" "," ");h=n.trim(d),e!==h&&c.setAttribute("class",h)}}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):n.isFunction(a)?this.each(function(c){n(this).toggleClass(a.call(this,c,fb(this),b),b)}):this.each(function(){var b,d,e,f;if("string"===c){d=0,e=n(this),f=a.match(G)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else void 0!==a&&"boolean"!==c||(b=fb(this),b&&N.set(this,"__className__",b),this.setAttribute&&this.setAttribute("class",b||a===!1?"":N.get(this,"__className__")||""))})},hasClass:function(a){var b,c,d=0;b=" "+a+" ";while(c=this[d++])if(1===c.nodeType&&(" "+fb(c)+" ").replace(eb," ").indexOf(b)>-1)return!0;return!1}});var gb=/\r/g,hb=/[\x20\t\r\n\f]+/g;n.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=n.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,n(this).val()):a,null==e?e="":"number"==typeof e?e+="":n.isArray(e)&&(e=n.map(e,function(a){return null==a?"":a+""})),b=n.valHooks[this.type]||n.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=n.valHooks[e.type]||n.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(gb,""):null==c?"":c)}}}),n.extend({valHooks:{option:{get:function(a){var b=n.find.attr(a,"value");return null!=b?b:n.trim(n.text(a)).replace(hb," ")}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],(c.selected||i===e)&&(l.optDisabled?!c.disabled:null===c.getAttribute("disabled"))&&(!c.parentNode.disabled||!n.nodeName(c.parentNode,"optgroup"))){if(b=n(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=n.makeArray(b),g=e.length;while(g--)d=e[g],(d.selected=n.inArray(n.valHooks.option.get(d),f)>-1)&&(c=!0);return c||(a.selectedIndex=-1),f}}}}),n.each(["radio","checkbox"],function(){n.valHooks[this]={set:function(a,b){return n.isArray(b)?a.checked=n.inArray(n(a).val(),b)>-1:void 0}},l.checkOn||(n.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var ib=/^(?:focusinfocus|focusoutblur)$/;n.extend(n.event,{trigger:function(b,c,e,f){var g,h,i,j,l,m,o,p=[e||d],q=k.call(b,"type")?b.type:b,r=k.call(b,"namespace")?b.namespace.split("."):[];if(h=i=e=e||d,3!==e.nodeType&&8!==e.nodeType&&!ib.test(q+n.event.triggered)&&(q.inde
</script>
<script>/*!
* Bootstrap v3.4.1 (https://getbootstrap.com/)
* Copyright 2011-2019 Twitter, Inc.
* Licensed under the MIT license
*/
if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");!function(t){"use strict";var e=jQuery.fn.jquery.split(" ")[0].split(".");if(e[0]<2&&e[1]<9||1==e[0]&&9==e[1]&&e[2]<1||3<e[0])throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4")}(),function(n){"use strict";n.fn.emulateTransitionEnd=function(t){var e=!1,i=this;n(this).one("bsTransitionEnd",function(){e=!0});return setTimeout(function(){e||n(i).trigger(n.support.transition.end)},t),this},n(function(){n.support.transition=function o(){var t=document.createElement("bootstrap"),e={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var i in e)if(t.style[i]!==undefined)return{end:e[i]};return!1}(),n.support.transition&&(n.event.special.bsTransitionEnd={bindType:n.support.transition.end,delegateType:n.support.transition.end,handle:function(t){if(n(t.target).is(this))return t.handleObj.handler.apply(this,arguments)}})})}(jQuery),function(s){"use strict";var e='[data-dismiss="alert"]',a=function(t){s(t).on("click",e,this.close)};a.VERSION="3.4.1",a.TRANSITION_DURATION=150,a.prototype.close=function(t){var e=s(this),i=e.attr("data-target");i||(i=(i=e.attr("href"))&&i.replace(/.*(?=#[^\s]*$)/,"")),i="#"===i?[]:i;var o=s(document).find(i);function n(){o.detach().trigger("closed.bs.alert").remove()}t&&t.preventDefault(),o.length||(o=e.closest(".alert")),o.trigger(t=s.Event("close.bs.alert")),t.isDefaultPrevented()||(o.removeClass("in"),s.support.transition&&o.hasClass("fade")?o.one("bsTransitionEnd",n).emulateTransitionEnd(a.TRANSITION_DURATION):n())};var t=s.fn.alert;s.fn.alert=function o(i){return this.each(function(){var t=s(this),e=t.data("bs.alert");e||t.data("bs.alert",e=new a(this)),"string"==typeof i&&e[i].call(t)})},s.fn.alert.Constructor=a,s.fn.alert.noConflict=function(){return s.fn.alert=t,this},s(document).on("click.bs.alert.data-api",e,a.prototype.close)}(jQuery),function(s){"use strict";var n=function(t,e){this.$element=s(t),this.options=s.extend({},n.DEFAULTS,e),this.isLoading=!1};function i(o){return this.each(function(){var t=s(this),e=t.data("bs.button"),i="object"==typeof o&&o;e||t.data("bs.button",e=new n(this,i)),"toggle"==o?e.toggle():o&&e.setState(o)})}n.VERSION="3.4.1",n.DEFAULTS={loadingText:"loading..."},n.prototype.setState=function(t){var e="disabled",i=this.$element,o=i.is("input")?"val":"html",n=i.data();t+="Text",null==n.resetText&&i.data("resetText",i[o]()),setTimeout(s.proxy(function(){i[o](null==n[t]?this.options[t]:n[t]),"loadingText"==t?(this.isLoading=!0,i.addClass(e).attr(e,e).prop(e,!0)):this.isLoading&&(this.isLoading=!1,i.removeClass(e).removeAttr(e).prop(e,!1))},this),0)},n.prototype.toggle=function(){var t=!0,e=this.$element.closest('[data-toggle="buttons"]');if(e.length){var i=this.$element.find("input");"radio"==i.prop("type")?(i.prop("checked")&&(t=!1),e.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==i.prop("type")&&(i.prop("checked")!==this.$element.hasClass("active")&&(t=!1),this.$element.toggleClass("active")),i.prop("checked",this.$element.hasClass("active")),t&&i.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var t=s.fn.button;s.fn.button=i,s.fn.button.Constructor=n,s.fn.button.noConflict=function(){return s.fn.button=t,this},s(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(t){var e=s(t.target).closest(".btn");i.call(e,"toggle"),s(t.target).is('input[type="radio"], input[type="checkbox"]')||(t.preventDefault(),e.is("input,button")?e.trigger("focus"):e.find("input:visible,button:visible").first().trigger("focus"))}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(t){s(t.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(t.type))})}(jQuery),function(p){"use strict";var c=function(t,e){this.$element=p(t),this.$indicators=this.$element.find(".carousel-indi
</head>
<body id="page-top" class="html-doc">
<!-- Fixed navbar -->
<div class="navbar navbar-default navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand doc-title" href="#page-top">Documentation </a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
</ul></div><!--/.nav-collapse -->
</div>
</div>
<div id="documentation-container" class="container">
<div class="row">
<div class="col-md-3">
<div class="nav-container">
<div class="nav-inner" id="scroll-spy" style="width: min-content; overflow: auto; top: 60px; bottom: 0; padding 10px 0 10px 0;">
<span class="toc">Table of contents</span>
<ul class="nav"><li><h3 id="steamworks-extension"><a href="#Home">Steamworks Extension</a></h3>
</li><li><h3 id="guides"><a href="#Guides">Guides</a></h3>
</li><li><h3 id="management"><a href="#Management">Management</a></h3>
</li><li><h3 id="general"><a href="#General">General</a></h3>
</li><li><h3 id="overlay"><a href="#Overlay">Overlay</a></h3>
</li><li><h3 id="leaderboards"><a href="#Leaderboards">Leaderboards</a></h3>
</li><li><h3 id="lobbies"><a href="#Lobbies">Lobbies</a></h3>
</li><li><h3 id="achievements"><a href="#Stats-and-Achievements">Achievements</a></h3>
</li><li><h3 id="cloud"><a href="#Cloud">Cloud</a></h3>
</li><li><h3 id="dlc"><a href="#DLC">DLC</a></h3>
</li><li><h3 id="ugc"><a href="#UGC">UGC</a></h3>
</li><li><h3 id="social"><a href="#Social">Social</a></h3>
</li><li><h3 id="inventory"><a href="#Inventory">Inventory</a></h3>
</li><li><h3 id="networking"><a href="#Networking">Networking</a></h3>
</li><li><h3 id="steam-input"><a href="#Input">Steam Input</a></h3>
</li><li><h3 id="steam-utilities"><a href="#Utils">Steam Utilities</a></h3>
</li></ul>
</div>
</div>
</div>
<div class="col-md-9">
<p class="page" id="Home"></p><h1>Steamworks Extension</h1>
<p><a id="top"></a>
<!--<div class="body-scroll" style="top: 150px;">--></p>
<p> <img class="center" width="1041" src="https://github.com/YoYoGames/GMEXT-Steamworks/raw/main/docs/assets/steamworks_banner.png" style="background:darkgrey">
This section is for those users that have been given access to the Steam API for publishing your game to that platform. To be able to use these functions you <i>must</i> have been accepted onto Steam previously, either through a publisher or through the self-publishing system.</p>
<h2 id="guides">Guides</h2>
<p> This sections provides a variety of important guides to get you started using the extension:</p>
<ul>
<li><a href="#setup-guide-ide-runtime-2022-6-">Setup Guide (IDE/Runtime 2022.6+)</a></li>
<li><a href="#migration-changes">Migration Changes</a> (what changed from the built-in Steam functionality)</li>
</ul>
<h2 id="management">Management</h2>
<p> This extension provides the following management functions:</p>
<ul>
<li><a href="#steam_init">steam_init</a> (automatically called by the extension)</li>
<li><a href="#steam_update">steam_update</a> <g-emoji class="g-emoji" alias="warning" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/26a0.png">⚠️</g-emoji> REQUIRED</li>
<li><a href="#steam_shutdown">steam_shutdown</a> <g-emoji class="g-emoji" alias="warning" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/26a0.png">⚠️</g-emoji> REQUIRED</li>
</ul>
<h2 id="modules">Modules</h2>
<p> There are a great number of different functions related to the Steam API. We&#39;ve split them up into the following sections to make it easier to navigate:</p>
<ul>
<li><a href="#General">General Steam API</a></li>
<li><a href="#Overlay">The Steam Overlay</a></li>
<li><a href="#Leaderboards">Leaderboards</a></li>
<li><a href="#Stats-and-Achievements">Achievements And Statistics</a></li>
<li><a href="#Cloud">Steam Cloud</a></li>
<li><a href="#DLC">DLC (Downloadable Content)</a></li>
<li><a href="#UGC">UGC (User Generated Content)</a></li>
<li><a href="#Social">Social</a> <g-emoji class="g-emoji" alias="information_source" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2139.png"></g-emoji> NEW</li>
<li><a href="#Inventory">Inventory</a> <g-emoji class="g-emoji" alias="information_source" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2139.png"></g-emoji> NEW</li>
<li><a href="#Networking">Networking</a> <g-emoji class="g-emoji" alias="information_source" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2139.png"></g-emoji> NEW</li>
<li><a href="#Input">Steam Input</a> <g-emoji class="g-emoji" alias="information_source" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2139.png"></g-emoji> NEW</li>
<li><p><a href="#utilities">Steam Utilities</a> <g-emoji class="g-emoji" alias="information_source" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2139.png"></g-emoji> NEW</p>
<!-- KEYWORDS
Steam
-->
<!-- TAGS
steam_functions
-->
</li>
</ul>
<p><br><br></p>
<hr>
<p class="page" id="Guides"></p><h1>Guides</h1>
<p><a id="top"></a>
<!-- Page HTML do not touch -->
<a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="setup-guide-ide-runtime-2022-6-">Setup Guide (IDE/Runtime 2022.6+)</h1>
<p>To use the Steam API extension you should follow these steps:</p>
<ol>
<li>Import this Steamworks extension into your project, if you haven&#39;t done that already.</li>
<li>The Steam app needs to be <strong>installed</strong>, <strong>running</strong> and with an account <strong>logged in</strong> (<a href="https://store.steampowered.com/">official site</a>).</li>
<li>Download Steamworks SDK (1.55) from Steam&#39;s <a href="https://partner.steamgames.com/dashboard">partner site</a> and extract the contents of the zip into a directory of your choice (e.g.: <code>C:\steamworks\sdk</code>).<br>
<img class="center_shadow" src="https://github.com/YoYoGames/GMEXT-Steamworks/raw/main/docs/assets/steamworks_setup_sdk.jpg" style="background:darkgrey"></li>
<li>To set up your AppID and environment status, double click on the Steamworks extension in your Asset Browser in the IDE.<br>
<img class="center_shadow" src="https://github.com/YoYoGames/GMEXT-Steamworks/raw/main/docs/assets/steamworks_setup_asset_browser.jpg" style="background:darkgrey"></li>
<li>In the bottom section you will see the new extension options. Those are all you will need to configure to use this extension. The build options require the path to the SDK downloaded on step 3 and the application options required your Application ID.<br>
<img class="center_shadow" src="https://github.com/YoYoGames/GMEXT-Steamworks/raw/main/docs/assets/steamworks_setup_ext_options.png" style="background:darkgrey"></li>
</ol>
<p><br><br></p>
<hr>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="migration-changes">Migration Changes</h1>
<p> During the migration of the Steamworks function library from the base GameMaker runner into this extension, there were some new functions that were added, and others that were slightly changed. This document covers the changes that happened during that migration.</p>
<h2 id="changed-functions">Changed Functions</h2>
<p> These are the functions that changed:</p>
<ul>
<li><a href="#steam_create_leaderboard">steam_create_leaderboard</a></li>
</ul>
<blockquote>
<p>This function is now asynchronous, meaning it will return an Async request ID that should be used inside a <a href="https://manual-en.yoyogames.com/The_Asset_Editors/Object_Properties/Async_Events/Steam.htm">Steam Async Event</a> to check when the task is finished.</p>
</blockquote>
<h2 id="new-functions">New Functions</h2>
<p> These are the new functions that were added to the Steam extension:</p>
<ul>
<li><a href="#steam_update">steam_update</a> <g-emoji class="g-emoji" alias="warning" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/26a0.png">⚠️</g-emoji> REQUIRED</li>
<li><a href="#steam_is_subscribed">steam_is_subscribed</a></li>
<li><a href="#steam_set_warning_message_hook">steam_set_warning_message_hook</a></li>
<li><a href="#steam_upload_score_ext">steam_upload_score_ext</a></li>
<li><a href="#steam_upload_score_buffer_ext">steam_upload_score_buffer_ext</a></li>
<li><a href="#steam_ugc_delete_item">steam_ugc_delete_item</a></li>
</ul>
<p><br><br></p>
<hr>
<p class="page" id="Management"></p><h1>Management</h1>
<p><a id="top"></a>
<!-- Page HTML do not touch -->
<a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_init">steam_init</h1>
<p> This function initialises the steam APIs.</p>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="information_source" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2139.png"></g-emoji> NOTE</strong></p>
<p>This function is already configured to be called at Game Start by the extension, and should not be called from your game code.</p>
</blockquote>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_init();</pre><p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">N/A</pre><p><br><br></p>
<hr>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_update">steam_update</h1>
<p> This function updates the steam APIs.</p>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="warning" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/26a0.png">⚠️</g-emoji> IMPORTANT</strong></p>
<p>This function is required to be called in order for the Steamworks extension to work. We recommend you place this function in a persistent controller object that calls it inside its <span style="font-weight:bold;">Step Event.</span></p>
</blockquote>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_update();</pre><p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">N/A</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs">steam_update();</pre><p> The above code will update the steam APIs.</p>
<p><br><br></p>
<hr>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_shutdown">steam_shutdown</h1>
<p> This function shuts down the Steamworks API, releases pointers and frees memory.</p>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="warning" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/26a0.png">⚠️</g-emoji> IMPORTANT</strong></p>
<p>This function is required to be called in order for the Steamworks extension to work. We recommend you place this function in the <span style="font-weight:bold;">GameEnd Event of a controller object. You need to check if this is not a <code>game_restart()</code>.</span></p>
</blockquote>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_shutdown();</pre><p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">N/A</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-literal">global</span>.is_game_restarting = <span class="hljs-literal">true</span>;
<span class="hljs-built_in">game_restart</span>();</pre><p> The code above should be used when you want to restart your game. We set the <code>is_game_restarting</code> global variable to <code>true</code> announcing the game being restarted to true (this global variable should already be declared at the begining of your game and be set to <code>false</code> by default).
Now inside our <a href="https://manual.yoyogames.com/The_Asset_Editors/Object_Properties/Other_Events.htm">Game End Event</a> we can use the following code.</p>
<pre class="hljs"><span class="hljs-keyword">if</span> (<span class="hljs-literal">global</span>.is_game_restarting == <span class="hljs-literal">false</span>) {
steam_shutdown();
}
<span class="hljs-literal">global</span>.is_game_restarting = <span class="hljs-literal">false</span>;</pre><p> First we check if the game is not restarting and in that case we know we are actually ending so we call the <code>steam_shutdown</code> method.</p>
<p><br><br></p>
<hr>
<p class="page" id="General"></p><h1>General</h1>
<p><a id="top"></a>
<a id="top"></a>
<!--<div class="body-scroll" style="top: 150px;">--></p>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="general">General</h1>
<p> The following set of functions are all for checking the availability of certain aspects of the Steam client or server API. This means that these functions should be used before any other Steam API function call to ensure that the client/server setup is correct and communicating with your game:</p>
<ul>
<li><a href="#steam_initialised">steam_initialised</a></li>
<li><a href="#steam_stats_ready">steam_stats_ready</a></li>
<li><a href="#steam_get_app_id">steam_get_app_id</a></li>
<li><a href="#steam_get_user_account_id">steam_get_user_account_id</a></li>
<li><a href="#steam_get_user_steam_id">steam_get_user_steam_id</a></li>
<li><a href="#steam_get_persona_name">steam_get_persona_name</a></li>
<li><a href="#steam_get_user_persona_name">steam_get_user_persona_name</a></li>
<li><a href="#steam_is_user_logged_on">steam_is_user_logged_on</a></li>
<li><a href="#steam_current_game_language">steam_current_game_language</a></li>
<li><a href="#steam_available_languages">steam_available_languages</a></li>
<li><a href="#steam_is_subscribed">steam_is_subscribed</a></li>
<li><p><a href="#steam_set_warning_message_hook">steam_set_warning_message_hook</a></p>
<!-- KEYWORDS
Steam API
-->
<!-- TAGS
api_functions
-->
</li>
</ul>
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_initialised">steam_initialised</h1>
<p> When using the Steam API, this function can be called to check that the Steam client API has been initialised correctly before any doing any further calls to Steam specific functions in your game.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs"><span class="hljs-built_in">steam_initialised</span>();</pre><p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Bool</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-literal">global</span>.steam_api = <span class="hljs-literal">false</span>;
<span class="hljs-keyword">if</span> (<span class="hljs-built_in">steam_initialised</span>())
{
<span class="hljs-keyword">if</span> (<span class="hljs-built_in">steam_stats_ready</span>() &amp;&amp; <span class="hljs-built_in">steam_is_overlay_enabled</span>())
{
<span class="hljs-literal">global</span>.steam_api = <span class="hljs-literal">true</span>;
}
}</pre><p> The above code will set a global variable to true if the Steam client API is correctly initialised, along with the Steam statistics and overlay functionality, or it will set the variable to false otherwise.</p>
<!-- KEYWORDS
steam_initialised
-->
<!-- TAGS
steam_initialised
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_stats_ready">steam_stats_ready</h1>
<p> When using the Steam API, this function can be called to check that the Steam client API has correctly initialised the statistics for your game.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs"><span class="hljs-built_in">steam_stats_ready</span>();</pre><p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Bool</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-literal">global</span>.steam_api = <span class="hljs-literal">false</span>;
<span class="hljs-keyword">if</span> <span class="hljs-built_in">steam_initialised</span>()
{
<span class="hljs-keyword">if</span> <span class="hljs-built_in">steam_stats_ready</span>() &amp;&amp; <span class="hljs-built_in">steam_is_overlay_enabled</span>()
{
<span class="hljs-literal">global</span>.steam_api = <span class="hljs-literal">true</span>;
}
}</pre><p> The above code will set a global variable to true if the Steam client API is correctly initialised, along with the Steam statistics and overlay functionality, or it will set the variable to false otherwise.</p>
<!-- KEYWORDS
steam_stats_ready
-->
<!-- TAGS
steam_stats_ready
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_get_app_id">steam_get_app_id</h1>
<p> This function is used retrieve the unique app ID that Steam assigns for your game, which is required for using some of the <a href="#UGC">User Generated Content</a> functions.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs"><span class="hljs-built_in">steam_get_app_id</span>();</pre><p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Real</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-literal">global</span>.app_id = <span class="hljs-built_in">steam_get_app_id</span>();</pre><p> The above code gets the unique app ID for your game on Steam and stores it in a global variable.</p>
<!-- KEYWORDS
steam_get_app_id
-->
<!-- TAGS
steam_get_app_id
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_get_user_account_id">steam_get_user_account_id</h1>
<p> This function is used retrieve the unique User ID that Steam assigns to each user, which is required for using some of the <a href="#UGC">User Generated Content</a> functions.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs"><span class="hljs-built_in">steam_get_user_account_id</span>();</pre><p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Real</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-literal">global</span>.user_id = <span class="hljs-built_in">steam_get_user_account_id</span>();</pre><p> The above code gets the unique user ID for the person who owns the game and stores it in a global variable.</p>
<!-- KEYWORDS
steam_get_user_account_id
-->
<!-- TAGS
steam_get_user_account_id
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_get_user_steam_id">steam_get_user_steam_id</h1>
<p> You can use this function to return the unique Steam user id of the user currently logged into the Steam client. If you need to get the user&#39;s on screen user name you should refer to the function <a href="#steam_get_persona_name">steam_get_persona_name</a>.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs"><span class="hljs-built_in">steam_get_user_steam_id</span>();</pre><p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs"><span class="hljs-built_in">int64</span></pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">if</span> <span class="hljs-built_in">steam_initialised</span>()
{
<span class="hljs-literal">global</span>.u_id = <span class="hljs-built_in">steam_get_user_steam_id</span>();
}</pre><p> The above code will set a global variable to the current users unique Steam ID if the Steam client API is correctly initialised.</p>
<!-- KEYWORDS
steam_get_user_steam_id
-->
<!-- TAGS
steam_get_user_steam_id
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_get_persona_name">steam_get_persona_name</h1>
<p> You can use this function to return the user name of the user currently logged into the Steam client. This is the visible screen name and <i>not</i> the unique user id (this can be found using the function <a href="#steam_get_user_steam_id">steam_get_user_steam_id</a>).</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs"><span class="hljs-built_in">steam_get_persona_name</span>();</pre><p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">String</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">if</span> <span class="hljs-built_in">steam_initialised</span>()
{
<span class="hljs-literal">global</span>.p_name = <span class="hljs-built_in">steam_get_persona_name</span>();
}</pre><p> The above code will set a global variable to current users screen name if the Steam client API is correctly initialised.</p>
<!-- KEYWORDS
steam_get_persona_name
-->
<!-- TAGS
steam_get_persona_name
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_get_user_persona_name">steam_get_user_persona_name</h1>
<p> This function can be used to retrieve the user name (screen name) for any specific user ID.
This is an asynchronous function that will return an asynchronous id and trigger the <a href="https://manual-en.yoyogames.com/The_Asset_Editors/Object_Properties/Async_Events/Steam.htm">Steam Async Event</a> when the task is finished.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs"><span class="hljs-built_in">steam_get_user_persona_name</span>(steamID);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>steamID</td>
<td>int64</td>
<td>The unique Steam ID for a user.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Real</pre><p><br></p>
<p><strong>Triggers:</strong></p>
<pre class="hljs">Asynchronous Steam Event</pre><table>
<thead>
<tr>
<th>Key</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>id</td>
<td>real</td>
<td>The asynchronous request ID</td>
</tr>
<tr>
<td>event_type</td>
<td>string</td>
<td>The string value <code>&quot;user_persona_name&quot;</code></td>
</tr>
<tr>
<td>steamid</td>
<td>int64</td>
<td>The unique user id of the user currently logged into the Steam client</td>
</tr>
<tr>
<td>persona_name</td>
<td>string</td>
<td>The visible screen name of the user currently logged into the Steam client</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs">request = <span class="hljs-built_in">steam_get_user_persona_name</span>(<span class="hljs-literal">global</span>.UGC_UserID);</pre><p> The above code will request the user name of the user ID stored in the global variable &quot;UGC_UserID&quot;, storing the returned value in a variable for parsing in the Async Event.</p>
<!-- KEYWORDS
steam_get_user_persona_name
-->
<!-- TAGS
steam_get_user_persona_name
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_is_user_logged_on">steam_is_user_logged_on</h1>
<p> This function will return <code>true</code> if the Steam client currently has a live connection to the Steam servers. If it returns <code>false</code>, it means there is no active connection due to either a networking issue on the local machine, or the Steam server being down or busy.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs"><span class="hljs-built_in">steam_is_user_logged_on</span>();</pre><p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Bool</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">if</span> (<span class="hljs-built_in">steam_is_user_logged_on</span>())
{
<span class="hljs-literal">global</span>.user_id = <span class="hljs-built_in">steam_get_user_account_id</span>();
}</pre><p> The above code will check to see if the user is logged onto the Steam server and if it stores the user ID in a global variable.</p>
<!-- KEYWORDS
steam_is_user_logged_on
-->
<!-- TAGS
steam_is_user_logged_on
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_current_game_language">steam_current_game_language</h1>
<p> This function is used retrieve the current language that Steam is using (as a string), for example &quot;english&quot;.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs"><span class="hljs-built_in">steam_current_game_language</span>();</pre><p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">String</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs">language = <span class="hljs-built_in">steam_current_game_language</span>();</pre><p> The above code gets the language used for the current game.</p>
<!-- KEYWORDS
steam_current_game_language
-->
<!-- TAGS
steam_current_game_language
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_available_languages">steam_available_languages</h1>
<p> This function can be used to retrieve a list of all available languages for Steam. The returned value is simply a comma-separated list of languages.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs"><span class="hljs-built_in">steam_available_languages</span>();</pre><p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">String</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs">language = <span class="hljs-built_in">steam_available_languages</span>();</pre><p> The above gets the available languages for Steam as a string and stores it in a variable.</p>
<!-- KEYWORDS
steam_available_languages
-->
<!-- TAGS
steam_available_languages
-->
<p><br><br></p>
<hr>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_is_subscribed">steam_is_subscribed</h1>
<p> This function checks if the active user is subscribed to the current App ID.</p>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="information_source" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2139.png"></g-emoji> NOTE</strong></p>
<p>This will always return <code>true</code> if you&#39;re using Steam DRM.</p>
</blockquote>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_is_subscribed();</pre><p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Bool</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">if</span> (steam_is_subscribed())
{
<span class="hljs-built_in">show_debug_message</span>(<span class="hljs-string">&quot;is_subscribed&quot;</span>)
}</pre><p> The above code will check to see if the user is logged onto the Steam server and if it stores the user ID in a global variable.</p>
<p><br><br></p>
<hr>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_set_warning_message_hook">steam_set_warning_message_hook</h1>
<p> This function sets a warning message hook to receive SteamAPI warnings and info messages in the console.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_set_warning_message_hook();</pre><p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">N/A</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs">steam_set_warning_message_hook();</pre><p> The above code start Steamworks logging messages in console.</p>
<p><br><br></p>
<hr>
<p class="page" id="Overlay"></p><h1>Overlay</h1>
<p><a id="top"></a>
<a id="top"></a>
<!--<div class="body-scroll" style="top: 150px;">--></p>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="overlay">Overlay</h1>
<p> The Steam Overlay is the visual display that can be brought up to display the Steam interface to the user. This is normally done by the user themselves using a combination of keys, but you also have the possibility of doing it from within your game, so that you can map a button or an event to show the overlay.</p>
<h2 id="functions">Functions</h2>
<p> The extension provides you with the following functions:</p>
<ul>
<li><a href="#steam_is_overlay_enabled">steam_is_overlay_enabled</a></li>
<li><a href="#steam_is_overlay_activated">steam_is_overlay_activated</a></li>
<li><a href="#steam_activate_overlay">steam_activate_overlay</a></li>
<li><a href="#steam_activate_overlay_browser">steam_activate_overlay_browser</a></li>
<li><a href="#steam_activate_overlay_store">steam_activate_overlay_store</a></li>
<li><a href="#steam_activate_overlay_user">steam_activate_overlay_user</a></li>
<li><a href="#steam_set_overlay_notification_inset">steam_set_overlay_notification_inset</a></li>
<li><a href="#steam_set_overlay_notification_position">steam_set_overlay_notification_position</a></li>
</ul>
<h2 id="constants">Constants</h2>
<p> This section also provides the following constants to use with the functions:</p>
<ul>
<li><a href="#overlaytype">OverlayType</a></li>
<li><p><a href="#overlaynotificationposition">OverlayNotificationPosition</a></p>
<!-- KEYWORDS
Steam Overlay
-->
<!-- TAGS
overlay_functions
-->
</li>
</ul>
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_is_overlay_enabled">steam_is_overlay_enabled</h1>
<p> When using the Steam API, this function can be called to check that the Steam client API has the overlay functionality enabled.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs"><span class="hljs-built_in">steam_is_overlay_enabled</span>();</pre><p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Bool</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-literal">global</span>.steam_api = <span class="hljs-literal">false</span>;
<span class="hljs-keyword">if</span> <span class="hljs-built_in">steam_initialised</span>()
{
<span class="hljs-keyword">if</span> <span class="hljs-built_in">steam_stats_ready</span>() &amp;&amp; <span class="hljs-built_in">steam_is_overlay_enabled</span>()
{
<span class="hljs-literal">global</span>.steamapi = <span class="hljs-literal">true</span>;
}
}</pre><p> The above code will set a global variable to <code>true</code> if the Steam client API is correctly initialized, along with the Steam statistics and overlay functionality, or it will set the variable to <code>false</code> otherwise.</p>
<!-- KEYWORDS
steam_is_overlay_enabled
-->
<!-- TAGS
steam_is_overlay_enabled
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_is_overlay_activated">steam_is_overlay_activated</h1>
<p> This function can be used to find out if the user has the Steam Overlay active or not. If the overlay is active and visible to the user the function will return <code>true</code>, and if it is not, then it will return <code>false</code>. An example of what this function can be used for would be for polling the Steam API for the overlay so that you can pause your game while the overlay is being shown.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs"><span class="hljs-built_in">steam_is_overlay_activated</span>();</pre><p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Bool</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">if</span> <span class="hljs-built_in">steam_is_overlay_activated</span>()
{
<span class="hljs-literal">global</span>.Pause = <span class="hljs-literal">true</span>;
}</pre><p> The above code will check to see if the Steam overlay is active and if it is it will set the global variable &quot;Pause&quot; to true.</p>
<!-- KEYWORDS
steam_is_overlay_enabled
-->
<!-- TAGS
steam_is_overlay_enabled
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_activate_overlay">steam_activate_overlay</h1>
<p> The Steam overlay is a piece of the Steam user interface that can be activated over the top of almost any game launched through Steam. It lets the user access their friends list, web browser, chat, and in-game DLC purchasing. The default key for a user to access the overlay while in a game is SHIFT + TAB, but you can also bring up any page of the overlay using this function. It takes one of six constants that are listed below:</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs"><span class="hljs-built_in">steam_activate_overlay</span>(overlay_type);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>overlay_type</td>
<td>constant.OverlayType</td>
<td>The page index of the Steam API UI to show (see <a href="#overlaytype">OverlayType</a> constants).</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">N/A</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">var</span> key = <span class="hljs-symbol">keyboard_lastkey</span>;
<span class="hljs-keyword">switch</span> (key)
{
<span class="hljs-keyword">case</span> <span class="hljs-literal">vk_f1</span>: <span class="hljs-built_in">steam_activate_overlay</span>(<span class="hljs-literal">ov_friends</span>); <span class="hljs-keyword">break</span>;
<span class="hljs-keyword">case</span> <span class="hljs-literal">vk_f2</span>: <span class="hljs-built_in">steam_activate_overlay</span>(<span class="hljs-literal">ov_community</span>); <span class="hljs-keyword">break</span>;
<span class="hljs-keyword">case</span> <span class="hljs-literal">vk_f3</span>: <span class="hljs-built_in">steam_activate_overlay</span>(<span class="hljs-literal">ov_players</span>); <span class="hljs-keyword">break</span>;
<span class="hljs-keyword">case</span> <span class="hljs-literal">vk_f4</span>: <span class="hljs-built_in">steam_activate_overlay</span>(<span class="hljs-literal">ov_settings</span>); <span class="hljs-keyword">break</span>;
<span class="hljs-keyword">case</span> <span class="hljs-literal">vk_f5</span>: <span class="hljs-built_in">steam_activate_overlay</span>(<span class="hljs-literal">ov_gamegroup</span>); <span class="hljs-keyword">break</span>;
<span class="hljs-keyword">case</span> <span class="hljs-literal">vk_f6</span>: <span class="hljs-built_in">steam_activate_overlay</span>(<span class="hljs-literal">ov_achievements</span>); <span class="hljs-keyword">break</span>;
}</pre><p> The above code polls the last keyboard key pressed and if it is any of the function keys from 1 to 6 it will open the corresponding page of the Steam overlay.</p>
<!-- KEYWORDS
steam_activate_overlay
ov_friends
ov_community
ov_players
ov_settings
ov_gamegroup
ov_achievements
-->
<!-- TAGS
steam_activate_overlay
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_activate_overlay_browser">steam_activate_overlay_browser</h1>
<p> With this function you can open the Steam game overlay to its web browser and then have it load the specified URL. you need to use the full URL as a string for this to resolve correctly, for example: <code>&amp;quot;http://www.steamgames.com/&amp;quot;</code>.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs"><span class="hljs-built_in">steam_activate_overlay</span>(url);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>url</td>
<td>string</td>
<td>The (full) URL for the overlay to open.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">N/A</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">if</span> <span class="hljs-built_in">keyboard_check_pressed</span>(<span class="hljs-literal">vk_f1</span>)
{
<span class="hljs-built_in">steam_activate_overlay_browser</span>(<span class="hljs-string">&quot;http://www.steamgames.com/&quot;</span>);
}</pre><p> The above code polls the keyboard for the F1 key and if it is then Steam overlay will be opened and resolve to the given URL.</p>
<!-- KEYWORDS
steam_activate_overlay_browser
-->
<!-- TAGS
steam_activate_overlay_browser
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_activate_overlay_store">steam_activate_overlay_store</h1>
<p> With this function you can open the Steam overlay on the store page for a game so that users can buy or download DLC (for example). You need to supply the unique App ID for the game or DLC which you would get from the Steam dashboard when you set it up.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs"><span class="hljs-built_in">steam_activate_overlay_store</span>(app_id);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>app_id</td>
<td>integer</td>
<td>The unique App ID for your game.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">N/A</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">if</span> <span class="hljs-built_in">keyboard_check_pressed</span>(<span class="hljs-literal">vk_f1</span>)
{
<span class="hljs-built_in">steam_activate_overlay_store</span>(<span class="hljs-literal">global</span>.DLC_id);
}</pre><p> The above code polls the keyboard for the F1 key and if it is then Steam overlay will be opened on the page for the game content using the app ID stored in the global variable.</p>
<!-- KEYWORDS
steam_activate_overlay_store
-->
<!-- TAGS
steam_activate_overlay_store
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_activate_overlay_user">steam_activate_overlay_user</h1>
<p> This function will open the Steam overlay to one of the chosen dialogues relating to the user ID given.
Note that Steam IDs can be large numbers and so you may need to cast your ID value as an <a href="#int64.htm">int64()</a> before supplying it to the function.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs"><span class="hljs-built_in">steam_activate_overlay_user</span>(dialog_name, steamid);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>dialog_name</td>
<td>string</td>
<td>The dialogue to open the overlay on (see below).</td>
</tr>
<tr>
<td>steamid</td>
<td>int64</td>
<td>The Steam user ID or group ID to use.</td>
</tr>
</tbody>
</table>
<table>
<thead>
<tr>
<th>Dialog Names</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>&quot;steamid&quot;</code></td>
<td>Opens the Steam Community web browser to the page of the user or group</td>
</tr>
<tr>
<td><code>&quot;chat&quot;</code></td>
<td>Opens a chat window to the specified user</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">N/A</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">var</span> key = <span class="hljs-symbol">keyboard_lastkey</span>;
<span class="hljs-keyword">switch</span> (key)
{
<span class="hljs-keyword">case</span> <span class="hljs-literal">vk_f1</span>: <span class="hljs-built_in">steam_activate_overlay_user</span>(<span class="hljs-string">&quot;steamid&quot;</span>, <span class="hljs-literal">global</span>.GameGroupID); <span class="hljs-keyword">break</span>;
<span class="hljs-keyword">case</span> <span class="hljs-literal">vk_f2</span>: <span class="hljs-built_in">steam_activate_overlay_user</span>(<span class="hljs-string">&quot;chat&quot;</span>, <span class="hljs-literal">global</span>.FriendID); <span class="hljs-keyword">break</span>;
}</pre><p> The above code polls the last keyboard key pressed and if it is function key 1 or function key 2, it will open the Steam overlay to either see the Steam group stored in the global variable &quot;GamegroupID&quot;, or it will open the chat window to chat with the user stored in the global &quot;FriendID&quot; variable.</p>
<!-- KEYWORDS
steam_activate_overlay_user
-->
<!-- TAGS
steam_activate_overlay_user
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_set_overlay_notification_inset">steam_set_overlay_notification_inset</h1>
<p> Sets the inset of the overlay notification from the corner specified by <a href="#steam_set_overlay_notification_position">steam_set_overlay_notification_position</a></p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_set_overlay_notification_inset(hor_inset, vert_inset);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>hor_inset</td>
<td>real</td>
<td>The horizontal (left-right) distance in pixels from the corner.</td>
</tr>
<tr>
<td>vert_inset</td>
<td>real</td>
<td>The vertical (up-down) distance in pixels from the corner.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Bool</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs">steam_set_overlay_notification_inset(<span class="hljs-number">10</span>, <span class="hljs-number">10</span>);</pre><p> The code above will inset the over lay 10px on the horizontal axis and 10px in the vertical axis.</p>
<!-- KEYWORDS
steam_stats_ready
-->
<!-- TAGS
steam_stats_ready
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_set_overlay_notification_position">steam_set_overlay_notification_position</h1>
<p> Changes the corner in which the overlay notifications will appear.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_set_overlay_notification_position(position);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>position</td>
<td><a href="#overlaynotificationposition">OverlayNotificationPosition</a></td>
<td>A constant that indicates the position where the notification overlay should render</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">N/A</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs">steam_set_overlay_notification_position(steam_overlay_notification_position_bottom_right);</pre><p> The above code will change the notification position to the bottom right corner.</p>
<!-- KEYWORDS
steam_stats_ready
-->
<!-- TAGS
steam_stats_ready
-->
<p><br><br></p>
<hr>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="overlaytype">OverlayType</h1>
<p> These constants specify the type of overlay to be activated when using the function <a href="#steam_activate_overlay">steam_activate_overlay</a>.</p>
<table>
<thead>
<tr>
<th>Overlay Type Constant</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>ov_friends</code></td>
<td>The friends page for the current user</td>
</tr>
<tr>
<td><code>ov_community</code></td>
<td>The community page for your game</td>
</tr>
<tr>
<td><code>ov_players</code></td>
<td>The page showing others that are playing the same game or that you have recently played with</td>
</tr>
<tr>
<td><code>ov_settings</code></td>
<td>The Steam client overlay settings</td>
</tr>
<tr>
<td><code>ov_gamegroup</code></td>
<td>Opens the Steam Community web browser to the official game group for this game</td>
</tr>
<tr>
<td><code>ov_achievements</code></td>
<td>The achievements page for your game</td>
</tr>
</tbody>
</table>
<p><br><br></p>
<hr>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="overlaynotificationposition">OverlayNotificationPosition</h1>
<p> These constants specify the position of the notification overlay onscreen an should be used with the function <a href="#steam_set_overlay_notification_position">steam_set_overlay_notification_position</a>.</p>
<table>
<thead>
<tr>
<th>Overlay Notification Position Constant</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>steam_overlay_notification_position_top_left</code></td>
<td>Point to the top left position</td>
</tr>
<tr>
<td><code>steam_overlay_notification_position_top_right</code></td>
<td>Point to the top right position</td>
</tr>
<tr>
<td><code>steam_overlay_notification_position_bottom_left</code></td>
<td>Point to the bottom left position</td>
</tr>
<tr>
<td><code>steam_overlay_notification_position_bottom_right</code></td>
<td>Point to the bottom right position</td>
</tr>
</tbody>
</table>
<p><br><br></p>
<hr>
<p class="page" id="Leaderboards"></p><h1>Leaderboards</h1>
<p><a id="top"></a>
<a id="top"></a>
<!--<div class="body-scroll" style="top: 150px;">--></p>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="leaderboards">Leaderboards</h1>
<p> The Steam API supports persistent leaderboards with automatically ordered entries. These leaderboards can be used to display global and friend leaderboards in your game and on the community web page for your game. Each game can have up to 10,000 leaderboards, and each leaderboard can be retrieved immediately after a player&#39;s score has been inserted into it, but note that for each leaderboard, a player can have only <i>one</i> entry, although there is no limit on the number of players per leaderboard.</p>
<h2 id="functions">Functions</h2>
<p> Each leaderboard entry contains a name, a score and a rank for the leaderboard, and this data will be replaced when a new leaderboard entry is created for the user, and the following functions can be used to add and retrieve this data form the leaderboards for your game:</p>
<ul>
<li><a href="#steam_create_leaderboard">steam_create_leaderboard</a></li>
<li><a href="#steam_upload_score">steam_upload_score</a></li>
<li><a href="#steam_upload_score_ext">steam_upload_score_ext</a></li>
<li><a href="#steam_upload_score_buffer">steam_upload_score_buffer</a></li>
<li><a href="#steam_upload_score_buffer_ext">steam_upload_score_buffer_ext</a></li>
<li><a href="#steam_download_scores">steam_download_scores</a></li>
<li><a href="#steam_download_scores_around_user">steam_download_scores_around_user</a></li>
<li><a href="#steam_download_friends_scores">steam_download_friends_scores</a></li>
</ul>
<h2 id="data-types">Data Types</h2>
<p> The following data types are used by the leaderboard functions:</p>
<ul>
<li><a href="#leaderboardentry">LeaderboardEntry</a></li>
</ul>
<h2 id="constants">Constants</h2>
<p> The following constants are used by the leaderboard functions:</p>
<ul>
<li><a href="#leaderboarddisplaytype">LeaderboardDisplayType</a></li>
<li><p><a href="#leaderboardsortorder">LeaderboardSortOrder</a></p>
<!-- KEYWORDS
Steam Leaderboards
-->
<!-- TAGS
leaderboard_functions
-->
</li>
</ul>
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_create_leaderboard">steam_create_leaderboard</h1>
<p> With this function you can create a new leaderboard for your game. The first argument is a string which defines the name of your leaderboard, and this name should be used in any further function calls relating to the leaderboard being created. You can then define the sort order (see <a href="#leaderboardsortorder">LeaderboardSortOrder</a> constants) as well as the way in which the information is displayed (see <a href="#leaderboarddisplaytype">LeaderboardDisplayType</a> constants).
This is an asynchronous function that will trigger the <a href="https://manual-en.yoyogames.com/The_Asset_Editors/Object_Properties/Async_Events/Steam.htm">Steam Async Event</a> when the task is finished.</p>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="information_source" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2139.png"></g-emoji> NOTE</strong></p>
<p>If you have previously created a leaderboard with the same name (either through code or through your Steam page for the game), then this function will not create a new one.</p>
</blockquote>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs"><span class="hljs-built_in">steam_create_leaderboard</span>(lb_name, sort_order, display_type);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>lb_name</td>
<td>string</td>
<td>The name of the leaderboard that you are creating</td>
</tr>
<tr>
<td>sort_order</td>
<td>LeaderboardSortOrder constant</td>
<td>The method for sorting the leaderboard entries (see <a href="#leaderboardsortorder">LeaderboardSortOrder</a> constants)</td>
</tr>
<tr>
<td>display_type</td>
<td>LeaderboardDisplayType constant</td>
<td>The way to display the leaderboard to the user (see <a href="#leaderboarddisplaytype">LeaderboardDisplayType</a> constants)</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Real</pre><p><br></p>
<p><strong>Triggers:</strong></p>
<pre class="hljs">Asynchronous Steam Event</pre><table>
<thead>
<tr>
<th>Key</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>id</td>
<td>real</td>
<td>The asynchronous request ID</td>
</tr>
<tr>
<td>event_type</td>
<td>string</td>
<td>The string value <code>&quot;create_leaderboard&quot;</code></td>
</tr>
<tr>
<td>status</td>
<td>real</td>
<td>The status code, <code>0</code> if the leaderboard was create and <code>1</code> if it already existed</td>
</tr>
<tr>
<td>lb_name</td>
<td>string</td>
<td>The name of the leaderboard</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-built_in">steam_create_leaderboard</span>(<span class="hljs-string">&quot;Game Times&quot;</span>, <span class="hljs-literal">lb_sort_ascending</span>, <span class="hljs-literal">lb_disp_time_sec</span>);</pre><p> The above code will create a leaderboard called &quot;Game Times&quot;, and set it to display the results in ascending order and with a display in seconds.</p>
<!-- KEYWORDS
steam_create_leaderboard
lb_sort_none
lb_sort_ascending
lb_sort_descending
lb_disp_none
lb_disp_numeric
lb_disp_time_sec
lb_disp_time_ms
-->
<!-- TAGS
steam_create_leaderboard
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_upload_score">steam_upload_score</h1>
<p> This function will send a score to the given leaderboard. The score to be uploaded is a real number, and the leaderboard name is a string that was defined when you created the leaderboard using the function <a href="#steam_create_leaderboard">steam_create_leaderboard</a>.
This is an asynchronous function that will trigger the <a href="https://manual-en.yoyogames.com/The_Asset_Editors/Object_Properties/Async_Events/Steam.htm">Steam Async Event</a> when the task is finished.</p>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="information_source" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2139.png"></g-emoji> NOTE</strong></p>
<p>If the function call fails for any reason it will return -1 and the Async event will not be triggered.</p>
</blockquote>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs"><span class="hljs-built_in">steam_upload_score</span>(lb_name, <span class="hljs-symbol">score</span>);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>lb_name</td>
<td>string</td>
<td>The name of the leaderboard that you are uploading the scores to</td>
</tr>
<tr>
<td>score</td>
<td>real</td>
<td>The score to upload</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Real</pre><p><br></p>
<p><strong>Triggers:</strong></p>
<pre class="hljs">Asynchronous Steam Event</pre><table>
<thead>
<tr>
<th>Key</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>post_id</td>
<td>real</td>
<td>The asynchronous request ID</td>
</tr>
<tr>
<td>event_type</td>
<td>string</td>
<td>The string value <code>&quot;leaderboard_upload&quot;</code></td>
</tr>
<tr>
<td>lb_name</td>
<td>string</td>
<td>The name of the leaderboard</td>
</tr>
<tr>
<td>num_entries</td>
<td>real</td>
<td>The number of returned entries</td>
</tr>
<tr>
<td>success</td>
<td>bool</td>
<td>Whether or not the request was successful</td>
</tr>
<tr>
<td>updated</td>
<td>bool</td>
<td>Whether or not the leaderboard was updated (ie: the new score was better)</td>
</tr>
<tr>
<td>score</td>
<td>real</td>
<td>The score that was posted to the leaderboard</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Extended Example:</strong></p>
<p> In this example, we first upload a score and then parse the <code>async_load</code> map returned if successful. The code below shows a typical example for uploading:</p>
<pre class="hljs"><span class="hljs-keyword">if</span> (hp &lt;= <span class="hljs-number">0</span>)
{
upload_ID = <span class="hljs-built_in">steam_upload_score</span>(<span class="hljs-string">&quot;Game Scores&quot;</span>, <span class="hljs-symbol">score</span>);
<span class="hljs-keyword">if</span> (!upload_ID)
{
<span class="hljs-symbol">alarm</span>[<span class="hljs-number">0</span>] = <span class="hljs-symbol">room_speed</span>;
}
}</pre><p> Note that we have set an alarm if the call fails. This would be used to try the upload again at a later time and you can add extra code there to retry the upload or to save the score to a text file should it continue to fail, etc... We now add the following into the <a href="https://manual-en.yoyogames.com/The_Asset_Editors/Object_Properties/Async_Events/Steam.htm">Steam Async Event</a> for the instance controlling the scores:</p>
<pre class="hljs"><span class="hljs-keyword">var</span> type = <span class="hljs-built_in">ds_map_find_value</span>(<span class="hljs-symbol">async_load</span>, <span class="hljs-string">&quot;event_type&quot;</span>);
<span class="hljs-keyword">if</span> (type == <span class="hljs-string">&quot;leaderboard_upload&quot;</span>)
{
<span class="hljs-keyword">var</span> lb_ID = <span class="hljs-built_in">ds_map_find_value</span>(<span class="hljs-symbol">async_load</span>, <span class="hljs-string">&quot;post_id&quot;</span>);
<span class="hljs-keyword">if</span> lb_ID == upload_ID
{
<span class="hljs-keyword">var</span> lb_name = <span class="hljs-built_in">ds_map_find_value</span>(<span class="hljs-symbol">async_load</span>, <span class="hljs-string">&quot;lb_name&quot;</span>);
<span class="hljs-keyword">var</span> lb_done = <span class="hljs-built_in">ds_map_find_value</span>(<span class="hljs-symbol">async_load</span>, <span class="hljs-string">&quot;success&quot;</span>);
<span class="hljs-keyword">var</span> lb_score = <span class="hljs-built_in">ds_map_find_value</span>(<span class="hljs-symbol">async_load</span>, <span class="hljs-string">&quot;score&quot;</span>);
<span class="hljs-keyword">var</span> lb_updated = <span class="hljs-built_in">ds_map_find_value</span>(<span class="hljs-symbol">async_load</span>, <span class="hljs-string">&quot;updated&quot;</span>);
<span class="hljs-built_in">show_debug_message</span>(<span class="hljs-string">&quot;leaderboard post id:&quot;</span> + <span class="hljs-built_in">string</span>(lb_ID) + <span class="hljs-string">&quot; to lb:&quot;</span> + <span class="hljs-built_in">string</span>(lb_name) + <span class="hljs-string">&quot; with score:&quot;</span> + <span class="hljs-built_in">string</span>(lb_score) + <span class="hljs-string">&quot; updated=&quot;</span> + <span class="hljs-built_in">string</span>(lb_updated));
<span class="hljs-keyword">if</span> (lb_done)
{
<span class="hljs-built_in">show_debug_message</span>(<span class="hljs-string">&quot;- Succeeded&quot;</span>);
}
<span class="hljs-keyword">else</span>
{
<span class="hljs-built_in">show_debug_message</span>(<span class="hljs-string">&quot;- Failed&quot;</span>);
}
}
}</pre><p> in the example we are simply outputting the return values to the compiler window as debug messages, but you can use this event to deal with the information in any way you choose.</p>
<!-- KEYWORDS
steam_upload_score
-->
<!-- TAGS
steam_upload_score
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_upload_score_ext">steam_upload_score_ext</h1>
<p> This function will send a score to the given leaderboard. It is similar to the function <a href="#steam_upload_score">steam_upload_score</a>but has an extra argument that will allow you to force the update of the score, as by default Steam only updates the score if it is better than the previous one.
This is an asynchronous function that will trigger the <a href="https://manual-en.yoyogames.com/The_Asset_Editors/Object_Properties/Async_Events/Steam.htm">Steam Async Event</a> when the task is finished.</p>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="information_source" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2139.png"></g-emoji> NOTE</strong></p>
<p>If the function call fails for any reason it will return -1 and the Async event will not be triggered.</p>
</blockquote>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs"><span class="hljs-built_in">steam_upload_score_ext</span>(lb_name, <span class="hljs-symbol">score</span>, force_update);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>lb_name</td>
<td>string</td>
<td>The name of the leaderboard that you are uploading the scores to</td>
</tr>
<tr>
<td>score</td>
<td>real</td>
<td>The score to upload</td>
</tr>
<tr>
<td>force_update</td>
<td>bool</td>
<td>Whether or not the value should be replaced</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Real</pre><p><br></p>
<p><strong>Triggers:</strong></p>
<pre class="hljs">Asynchronous Steam Event</pre><table>
<thead>
<tr>
<th>Key</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>post_id</td>
<td>real</td>
<td>The asynchronous request ID</td>
</tr>
<tr>
<td>event_type</td>
<td>string</td>
<td>The string value <code>&quot;leaderboard_upload&quot;</code></td>
</tr>
<tr>
<td>lb_name</td>
<td>string</td>
<td>The name of the leaderboard</td>
</tr>
<tr>
<td>num_entries</td>
<td>real</td>
<td>The number of returned entries</td>
</tr>
<tr>
<td>success</td>
<td>bool</td>
<td>Whether or not the request was successful</td>
</tr>
<tr>
<td>updated</td>
<td>bool</td>
<td>Whether or not the leaderboard was updated (ie: the new score was better or <code>forceUpdate</code> was set to <code>true</code>)</td>
</tr>
<tr>
<td>score</td>
<td>real</td>
<td>The score that was posted to the leaderboard</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Extended Example:</strong></p>
<p> In this example, we first upload a score and then parse the <code>async_load</code> map returned if successful. The code below shows a typical example for uploading:</p>
<pre class="hljs"><span class="hljs-keyword">if</span> (hp &lt;= <span class="hljs-number">0</span>)
{
upload_ID = <span class="hljs-built_in">steam_upload_score_ext</span>(<span class="hljs-string">&quot;Game Scores&quot;</span>, <span class="hljs-symbol">score</span>, <span class="hljs-literal">true</span>);
<span class="hljs-keyword">if</span> (!upload_ID)
{
<span class="hljs-symbol">alarm</span>[<span class="hljs-number">0</span>] = <span class="hljs-symbol">room_speed</span>;
}
}</pre><p> Note that we have set an alarm if the call fails. This would be used to try the upload again at a later time and you can add extra code there to retry the upload or to save the score to a text file should it continue to fail, etc... We now add the following into the <a href="https://manual-en.yoyogames.com/The_Asset_Editors/Object_Properties/Async_Events/Steam.htm">Steam Async Event</a> for the instance controlling the scores:</p>
<pre class="hljs"><span class="hljs-keyword">var</span> type = <span class="hljs-built_in">ds_map_find_value</span>(<span class="hljs-symbol">async_load</span>, <span class="hljs-string">&quot;event_type&quot;</span>);
<span class="hljs-keyword">if</span> (type == <span class="hljs-string">&quot;leaderboard_upload&quot;</span>)
{
<span class="hljs-keyword">var</span> lb_ID = <span class="hljs-built_in">ds_map_find_value</span>(<span class="hljs-symbol">async_load</span>, <span class="hljs-string">&quot;post_id&quot;</span>);
<span class="hljs-keyword">if</span> lb_ID == upload_ID
{
<span class="hljs-keyword">var</span> lb_name = <span class="hljs-built_in">ds_map_find_value</span>(<span class="hljs-symbol">async_load</span>, <span class="hljs-string">&quot;lb_name&quot;</span>);
<span class="hljs-keyword">var</span> lb_done = <span class="hljs-built_in">ds_map_find_value</span>(<span class="hljs-symbol">async_load</span>, <span class="hljs-string">&quot;success&quot;</span>);
<span class="hljs-keyword">var</span> lb_score = <span class="hljs-built_in">ds_map_find_value</span>(<span class="hljs-symbol">async_load</span>, <span class="hljs-string">&quot;score&quot;</span>);
<span class="hljs-keyword">var</span> lb_updated = <span class="hljs-built_in">ds_map_find_value</span>(<span class="hljs-symbol">async_load</span>, <span class="hljs-string">&quot;updated&quot;</span>);
<span class="hljs-built_in">show_debug_message</span>(<span class="hljs-string">&quot;leaderboard post id:&quot;</span> + <span class="hljs-built_in">string</span>(lb_ID) + <span class="hljs-string">&quot; to lb:&quot;</span> + <span class="hljs-built_in">string</span>(lb_name) + <span class="hljs-string">&quot; with score:&quot;</span> + <span class="hljs-built_in">string</span>(lb_score) + <span class="hljs-string">&quot; updated=&quot;</span> + <span class="hljs-built_in">string</span>(lb_updated));
<span class="hljs-keyword">if</span> (lb_done)
{
<span class="hljs-built_in">show_debug_message</span>(<span class="hljs-string">&quot;- Succeeded&quot;</span>);
}
<span class="hljs-keyword">else</span>
{
<span class="hljs-built_in">show_debug_message</span>(<span class="hljs-string">&quot;- Failed&quot;</span>);
}
}
}</pre><p> in the example we are simply outputting the return values to the compiler window as debug messages, but you can use this event to deal with the information in any way you choose.</p>
<!-- KEYWORDS
steam_upload_score
-->
<!-- TAGS
steam_upload_score
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_upload_score_buffer">steam_upload_score_buffer</h1>
<p> This function will send a score to the given leaderboard along with a data package created from a buffer. The buffer should be no more than 256 bytes in size - anything beyond that will be chopped off - and can contain any data you require. The score to be uploaded should be a real number, and the leaderboard name is a string that was defined when you created the leaderboard using the function <a href="#steam_create_leaderboard">steam_create_leaderboard</a>.
This is an asynchronous function that will trigger the <a href="https://manual-en.yoyogames.com/The_Asset_Editors/Object_Properties/Async_Events/Steam.htm">Steam Async Event</a> when the task is finished.</p>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="information_source" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2139.png"></g-emoji> NOTE</strong></p>
<p>If the function call fails for any reason it will return -1 and the Async event will not be triggered.</p>
</blockquote>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs"><span class="hljs-built_in">steam_upload_score_buffer</span>(lb_name, <span class="hljs-symbol">score</span>, buffer);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>lb_name</td>
<td>string</td>
<td>The name of the leaderboard that you are uploading the scores to</td>
</tr>
<tr>
<td>score</td>
<td>real</td>
<td>The score to upload</td>
</tr>
<tr>
<td>buffer</td>
<td>buffer ID</td>
<td>The ID of the buffer to attach</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Real</pre><p><br></p>
<p><strong>Triggers:</strong></p>
<pre class="hljs">Asynchronous Steam Event</pre><table>
<thead>
<tr>
<th>Key</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>post_id</td>
<td>real</td>
<td>The asynchronous request ID</td>
</tr>
<tr>
<td>event_type</td>
<td>string</td>
<td>The string value <code>&quot;leaderboard_upload&quot;</code></td>
</tr>
<tr>
<td>lb_name</td>
<td>string</td>
<td>The name of the leaderboard</td>
</tr>
<tr>
<td>num_entries</td>
<td>real</td>
<td>The number of returned entries</td>
</tr>
<tr>
<td>success</td>
<td>bool</td>
<td>Whether or not the request was successful</td>
</tr>
<tr>
<td>updated</td>
<td>bool</td>
<td>Whether or not the leaderboard was updated (ie: the new score was better). Note that if you score was not updated neither will be the data buffer.</td>
</tr>
<tr>
<td>score</td>
<td>real</td>
<td>The score that was posted to the leaderboard</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Extended Example:</strong></p>
<p> In this example, we first upload a score and then parse the <code>async_load</code> map returned if successful. The code below shows a typical example for uploading, with a buffer being created to hold a string telling us which level the score was uploaded from:</p>
<pre class="hljs"><span class="hljs-keyword">if</span> (hp &lt;= <span class="hljs-number">0</span>)
{
<span class="hljs-keyword">var</span> buff = <span class="hljs-built_in">buffer_create</span>(<span class="hljs-number">256</span>, <span class="hljs-literal">buffer_fixed</span>, <span class="hljs-number">1</span> );
<span class="hljs-built_in">buffer_write</span>(buff, <span class="hljs-literal">buffer_string</span>, <span class="hljs-string">&quot;Uploaded on level &quot;</span> + <span class="hljs-built_in">string</span>(<span class="hljs-literal">global</span>.Level));
upload_ID = <span class="hljs-built_in">steam_upload_score</span>(<span class="hljs-string">&quot;Game Scores&quot;</span>, <span class="hljs-symbol">score</span>, buff);
<span class="hljs-keyword">if</span> (!upload_ID)
{
<span class="hljs-symbol">alarm</span>[<span class="hljs-number">0</span>] = <span class="hljs-symbol">room_speed</span>;
}
<span class="hljs-built_in">buffer_delete</span>(buff);
}
</pre><p> Note that we have set an alarm if the call fails. This would be used to try the upload again at a later time and you can add extra code there to retry the upload or to save the score to a text file should it continue to fail, etc... Also note that we immediately delete the buffer, since it is no longer required for the function. We now add the following into the <a href="https://manual-en.yoyogames.com/The_Asset_Editors/Object_Properties/Async_Events/Steam.htm">Steam Async Event</a> for the instance controlling the scores:</p>
<pre class="hljs"><span class="hljs-keyword">var</span> type = <span class="hljs-built_in">ds_map_find_value</span>(<span class="hljs-symbol">async_load</span>, <span class="hljs-string">&quot;event_type&quot;</span>);
<span class="hljs-keyword">if</span> (type == <span class="hljs-string">&quot;leaderboard_upload&quot;</span>)
{
<span class="hljs-keyword">var</span> lb_ID = <span class="hljs-built_in">ds_map_find_value</span>(<span class="hljs-symbol">async_load</span>, <span class="hljs-string">&quot;post_id&quot;</span>);
<span class="hljs-keyword">if</span> lb_ID == upload_ID
{
<span class="hljs-keyword">var</span> lb_name = <span class="hljs-built_in">ds_map_find_value</span>(<span class="hljs-symbol">async_load</span>, <span class="hljs-string">&quot;lb_name&quot;</span>);
<span class="hljs-keyword">var</span> lb_done = <span class="hljs-built_in">ds_map_find_value</span>(<span class="hljs-symbol">async_load</span>, <span class="hljs-string">&quot;success&quot;</span>);
<span class="hljs-keyword">var</span> lb_score = <span class="hljs-built_in">ds_map_find_value</span>(<span class="hljs-symbol">async_load</span>, <span class="hljs-string">&quot;score&quot;</span>);
<span class="hljs-keyword">var</span> lb_updated = <span class="hljs-built_in">ds_map_find_value</span>(<span class="hljs-symbol">async_load</span>, <span class="hljs-string">&quot;updated&quot;</span>);
<span class="hljs-built_in">show_debug_message</span>(<span class="hljs-string">&quot;leaderboard post id:&quot;</span> + <span class="hljs-built_in">string</span>(lb_ID) + <span class="hljs-string">&quot; to lb:&quot;</span> + <span class="hljs-built_in">string</span>(lb_name) + <span class="hljs-string">&quot; with score:&quot;</span> + <span class="hljs-built_in">string</span>(lb_score) + <span class="hljs-string">&quot; updated=&quot;</span> + <span class="hljs-built_in">string</span>(lb_updated));
<span class="hljs-keyword">if</span> (lb_done)
{
<span class="hljs-built_in">show_debug_message</span>(<span class="hljs-string">&quot;- Succeeded&quot;</span>);
}
<span class="hljs-keyword">else</span>
{
<span class="hljs-built_in">show_debug_message</span>(<span class="hljs-string">&quot;- Failed&quot;</span>);
}
}
}</pre><p> In the example we are simply outputting the return values to the compiler window as debug messages, but you can use this event to deal with the information in any way you choose.</p>
<!-- KEYWORDS
steam_upload_score_buffer
-->
<!-- TAGS
steam_upload_score_buffer
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_upload_score_buffer_ext">steam_upload_score_buffer_ext</h1>
<p> This function will send a score to the given leaderboard along with a data package created from a buffer. The buffer should be no more than 256 bytes in size - anything beyond that will be chopped off - and can contain any data you require. This function is similar to <a href="#steam_upload_score_buffer">steam_upload_score_buffer</a> but has an extra argument that will allow you to force the update of the score, as by default Steam only updates the score if it is better than the previous one.
This is an asynchronous function that will trigger the <a href="https://manual-en.yoyogames.com/The_Asset_Editors/Object_Properties/Async_Events/Steam.htm">Steam Async Event</a> when the task is finished.</p>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="information_source" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2139.png"></g-emoji> NOTE</strong></p>
<p>If the function call fails for any reason it will return -1 and the Async event will not be triggered.</p>
</blockquote>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs"><span class="hljs-built_in">steam_upload_score_buffer_ext</span>(lb_name, <span class="hljs-symbol">score</span>, buffer, force_update);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>lb_name</td>
<td>string</td>
<td>The name of the leaderboard that you are uploading the scores to</td>
</tr>
<tr>
<td>score</td>
<td>real</td>
<td>The score to upload</td>
</tr>
<tr>
<td>buffer</td>
<td>buffer ID</td>
<td>The ID of the buffer to attach</td>
</tr>
<tr>
<td>force_update</td>
<td>bool</td>
<td>Whether or not the value should be replaced</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Real</pre><p><br></p>
<p><strong>Triggers:</strong></p>
<pre class="hljs">Asynchronous Steam Event</pre><table>
<thead>
<tr>
<th>Key</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>post_id</td>
<td>real</td>
<td>The asynchronous request ID</td>
</tr>
<tr>
<td>event_type</td>
<td>string</td>
<td>The string value <code>&quot;leaderboard_upload&quot;</code></td>
</tr>
<tr>
<td>lb_name</td>
<td>string</td>
<td>The name of the leaderboard</td>
</tr>
<tr>
<td>num_entries</td>
<td>real</td>
<td>The number of returned entries</td>
</tr>
<tr>
<td>success</td>
<td>bool</td>
<td>Whether or not the request was successful</td>
</tr>
<tr>
<td>updated</td>
<td>bool</td>
<td>Whether or not the leaderboard was updated (ie: the new score was better or <code>forceUpdate</code> was set to <code>true</code>). Note that if you score was not updated neither will be the data buffer.</td>
</tr>
<tr>
<td>score</td>
<td>real</td>
<td>The score that was posted to the leaderboard</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Extended Example:</strong></p>
<p> In this example, we first upload a score and then parse the <code>async_load</code> map returned if successful. The code below shows a typical example for uploading, with a buffer being created to hold a string telling us which level the score was uploaded from:</p>
<pre class="hljs"><span class="hljs-keyword">if</span> (hp &lt;= <span class="hljs-number">0</span>)
{
<span class="hljs-keyword">var</span> buff = <span class="hljs-built_in">buffer_create</span>(<span class="hljs-number">256</span>, <span class="hljs-literal">buffer_fixed</span>, <span class="hljs-number">1</span> );
<span class="hljs-built_in">buffer_write</span>(buff, <span class="hljs-literal">buffer_string</span>, <span class="hljs-string">&quot;Uploaded on level &quot;</span> + <span class="hljs-built_in">string</span>(<span class="hljs-literal">global</span>.Level));
upload_ID = <span class="hljs-built_in">steam_upload_score_buffer_ext</span>(<span class="hljs-string">&quot;Game Scores&quot;</span>, <span class="hljs-symbol">score</span>, buff, <span class="hljs-literal">true</span>);
<span class="hljs-keyword">if</span> (!upload_ID)
{
<span class="hljs-symbol">alarm</span>[<span class="hljs-number">0</span>] = <span class="hljs-symbol">room_speed</span>;
}
<span class="hljs-built_in">buffer_delete</span>(buff);
}
</pre><p> Note that we have set an alarm if the call fails. This would be used to try the upload again at a later time and you can add extra code there to retry the upload or to save the score to a text file should it continue to fail, etc... Also note that we immediately delete the buffer, since it is no longer required for the function. We now add the following into the <a href="https://manual-en.yoyogames.com/The_Asset_Editors/Object_Properties/Async_Events/Steam.htm">Steam Async Event</a> for the instance controlling the scores:</p>
<pre class="hljs"><span class="hljs-keyword">var</span> type = <span class="hljs-built_in">ds_map_find_value</span>(<span class="hljs-symbol">async_load</span>, <span class="hljs-string">&quot;event_type&quot;</span>);
<span class="hljs-keyword">if</span> (type == <span class="hljs-string">&quot;leaderboard_upload&quot;</span>)
{
<span class="hljs-keyword">var</span> lb_ID = <span class="hljs-built_in">ds_map_find_value</span>(<span class="hljs-symbol">async_load</span>, <span class="hljs-string">&quot;post_id&quot;</span>);
<span class="hljs-keyword">if</span> lb_ID == upload_ID
{
<span class="hljs-keyword">var</span> lb_name = <span class="hljs-built_in">ds_map_find_value</span>(<span class="hljs-symbol">async_load</span>, <span class="hljs-string">&quot;lb_name&quot;</span>);
<span class="hljs-keyword">var</span> lb_done = <span class="hljs-built_in">ds_map_find_value</span>(<span class="hljs-symbol">async_load</span>, <span class="hljs-string">&quot;success&quot;</span>);
<span class="hljs-keyword">var</span> lb_score = <span class="hljs-built_in">ds_map_find_value</span>(<span class="hljs-symbol">async_load</span>, <span class="hljs-string">&quot;score&quot;</span>);
<span class="hljs-keyword">var</span> lb_updated = <span class="hljs-built_in">ds_map_find_value</span>(<span class="hljs-symbol">async_load</span>, <span class="hljs-string">&quot;updated&quot;</span>);
<span class="hljs-built_in">show_debug_message</span>(<span class="hljs-string">&quot;leaderboard post id:&quot;</span> + <span class="hljs-built_in">string</span>(lb_ID) + <span class="hljs-string">&quot; to lb:&quot;</span> + <span class="hljs-built_in">string</span>(lb_name) + <span class="hljs-string">&quot; with score:&quot;</span> + <span class="hljs-built_in">string</span>(lb_score) + <span class="hljs-string">&quot; updated=&quot;</span> + <span class="hljs-built_in">string</span>(lb_updated));
<span class="hljs-keyword">if</span> (lb_done)
{
<span class="hljs-built_in">show_debug_message</span>(<span class="hljs-string">&quot;- Succeeded&quot;</span>);
}
<span class="hljs-keyword">else</span>
{
<span class="hljs-built_in">show_debug_message</span>(<span class="hljs-string">&quot;- Failed&quot;</span>);
}
}
}</pre><p> In the example we are simply outputting the return values to the compiler window as debug messages, but you can use this event to deal with the information in any way you choose.</p>
<!-- KEYWORDS
steam_upload_score_buffer
-->
<!-- TAGS
steam_upload_score_buffer
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_download_scores">steam_download_scores</h1>
<p> This function is used retrieve a sequential range of leaderboard entries by leaderboard ranking. The <code>start_idx</code> and <code>end_idx</code> parameters control the requested range of ranks, for example, you can display the top 10 on a leaderboard for your game by setting the start value to 1 and the end value to 10. The leaderboard name is a string that was defined when you created the leaderboard using the function <a href="#steam_create_leaderboard">steam_create_leaderboard</a>.
This is an asynchronous function that will trigger the <a href="https://manual-en.yoyogames.com/The_Asset_Editors/Object_Properties/Async_Events/Steam.htm">Steam Async Event</a> when the task is finished.</p>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="information_source" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2139.png"></g-emoji> NOTE</strong></p>
<p>If the function call fails for any reason it will return -1 and the async event will not be triggered.</p>
</blockquote>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs"><span class="hljs-built_in">steam_download_scores</span>(lb_name, start_idx, end_idx);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>lb_name</td>
<td>string</td>
<td>The name of the leaderboard that you are downloading the scores from</td>
</tr>
<tr>
<td>start_idx</td>
<td>integer</td>
<td>The start position within the leaderboard</td>
</tr>
<tr>
<td>end_idx</td>
<td>integer</td>
<td>The end position within the leaderboard</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Real</pre><p><br></p>
<p><strong>Triggers:</strong></p>
<pre class="hljs">Asynchronous Steam Event</pre><table>
<thead>
<tr>
<th>Key</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>id</td>
<td>real</td>
<td>The asynchronous request ID</td>
</tr>
<tr>
<td>event_type</td>
<td>string</td>
<td>The string value <code>&quot;leaderboard_download&quot;</code></td>
</tr>
<tr>
<td>status</td>
<td>int64</td>
<td>The status code if download fails</td>
</tr>
<tr>
<td>lb_name</td>
<td>string</td>
<td>The name of the leaderboard</td>
</tr>
<tr>
<td>num_entries</td>
<td>real</td>
<td>The number of returned entries</td>
</tr>
<tr>
<td>entries</td>
<td>string</td>
<td>A json formatted string with all the downloaded entries (see <a href="#leaderboardentry">LeaderboardEntry</a> for details)</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Extended Example:</strong></p>
<p> In this extended example we will request the top ten ranking for the given leaderboard and parse its results in the <a href="https://manual-en.yoyogames.com/The_Asset_Editors/Object_Properties/Async_Events/Steam.htm">Steam Async Event</a>. to start with we need to request the scores with the following code:</p>
<pre class="hljs">score_get = <span class="hljs-built_in">steam_download_scores</span>(<span class="hljs-string">&quot;Game Scores&quot;</span>, <span class="hljs-number">1</span>, <span class="hljs-number">10</span>);</pre><p> This will send off a request to the Steam Server for the scores from the leaderboard &quot;Game Scores&quot;, storing the async id of the request in the variable &quot;score_get&quot;. this will then be handled in the Steam Async Event in the following way:</p>
<pre class="hljs"><span class="hljs-keyword">var</span> async_id = <span class="hljs-built_in">ds_map_find_value</span>(<span class="hljs-symbol">async_load</span>, <span class="hljs-string">&quot;id&quot;</span>);
<span class="hljs-keyword">if</span> async_id == score_get
{
<span class="hljs-keyword">var</span> entries = <span class="hljs-built_in">ds_map_find_value</span>(<span class="hljs-symbol">async_load</span>, <span class="hljs-string">&quot;entries&quot;</span>);
<span class="hljs-keyword">var</span> map = <span class="hljs-built_in">json_decode</span>(entries);
<span class="hljs-keyword">if</span> <span class="hljs-built_in">ds_map_exists</span>(map, <span class="hljs-string">&quot;default&quot;</span>)
{
<span class="hljs-built_in">ds_map_destroy</span>(map);
<span class="hljs-keyword">exit</span>;
}
<span class="hljs-keyword">else</span>
{
<span class="hljs-keyword">var</span> list = <span class="hljs-built_in">ds_map_find_value</span>(map, <span class="hljs-string">&quot;entries&quot;</span>);
<span class="hljs-keyword">var</span> len = <span class="hljs-built_in">ds_list_size</span>(list);
<span class="hljs-keyword">var</span> entry;
<span class="hljs-keyword">for</span>(<span class="hljs-keyword">var</span> i = <span class="hljs-number">0</span>; i &lt; len; i++;)
{
entry = <span class="hljs-built_in">ds_list_find_value</span>(list, i );
steam_name[i] = <span class="hljs-built_in">ds_map_find_value</span>(entry, <span class="hljs-string">&quot;name&quot;</span>);
steam_score[i] = <span class="hljs-built_in">ds_map_find_value</span>(entry, <span class="hljs-string">&quot;score&quot;</span>);
steam_rank[i] = <span class="hljs-built_in">ds_map_find_value</span>(entry, <span class="hljs-string">&quot;rank&quot;</span>);
steam_data[i] = <span class="hljs-built_in">ds_map_find_value</span>(entry, <span class="hljs-string">&quot;data&quot;</span>);
}
}
<span class="hljs-built_in">ds_map_destroy</span>(map)
}</pre><p> What we do here is first check the &quot;id&quot; key of the special <a href="https://manual-en.yoyogames.com/GameMaker_Language/GML_Overview/Variables/Builtin_Global_Variables/async_load.htm">async_load</a> DS map. If this value is the same as the value of the original call-back function (stored in the &quot;score_get&quot; variable) we then continue to process the data. The first thing we do is parse the <code>async_load</code> DS map for the key &quot;entries&quot; which will contain a JSON formatted string containing the leaderboard data. This JSON object is then decoded (see <a href="https://manual-en.yoyogames.com/GameMaker_Language/GML_Reference/File_Handling/Encoding_And_Hashing/json_decode.htm">json_decode</a>) as another <a href="https://manual.yoyogames.com/GameMaker_Language/GML_Reference/Data_Structures/DS_Maps/DS_Maps.htm">DS map</a>, and this new map id is stored in the variable &quot;map&quot;.
This map is checked for the key &quot;default&quot; and if that is found then the map is destroyed and the event is exited. If no &quot;default&quot; key is found, the code will then parse the map to extract the necessary information about the leaderboard, by first extracting a DS list from the &quot;entries&quot; key of the DS map, and then looping through each entry of the list to get <i>another</i> DS map with the name, score and rank of each entry. These values are then stored to arrays.
Once the loop has finished, the JSON <a href="https://manual.yoyogames.com/GameMaker_Language/GML_Reference/Data_Structures/DS_Maps/DS_Maps.htm">DS map</a> is destroyed (which in turn destroys all the internal maps and lists). There is no need to destroy the <a href="https://manual-en.yoyogames.com/GameMaker_Language/GML_Overview/Variables/Builtin_Global_Variables/async_load.htm">async_load</a> DS map as this is handled for you by GameMaker Studio 2.</p>
<!-- KEYWORDS
steam_download_scores
-->
<!-- TAGS
steam_download_scores
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_download_scores_around_user">steam_download_scores_around_user</h1>
<p> This function is used to retrieve leaderboard entries relative the current users entry. The <code>range_start</code> parameter is the number of entries to retrieve <i>before</i> the current users entry, and the <code>range_end</code> parameter is the number of entries after the current user&#39;s entry, and the current user&#39;s entry is <i>always</i> included in the results. For example, if the current user is number 5 on a given leaderboard, then setting the start range to -2 and the end range to 2 will return 5 entries: 3 through 7. If there are not enough entries in the leaderboard before or after the user&#39;s entry, Steam will adjust the range start and end points trying to maintained the range size. For example, if the user is #1 on the leaderboard, start is set to -2, and end is set to 2, Steam will return the first 5 entries in the leaderboard.
This is an asynchronous function that will trigger the <a href="https://manual-en.yoyogames.com/The_Asset_Editors/Object_Properties/Async_Events/Steam.htm">Steam Async Event</a> when the task is finished.</p>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="information_source" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2139.png"></g-emoji> NOTE</strong></p>
<p>If the function call fails for any reason it will return -1 and the async event will not be triggered.</p>
</blockquote>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs"><span class="hljs-built_in">steam_download_scores_around_user</span>(lb_name, range_start, range_end);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>lb_name</td>
<td>string</td>
<td>The name of the leaderboard that you are downloading the scores from</td>
</tr>
<tr>
<td>range_start</td>
<td>integer</td>
<td>The start position within the leaderboard</td>
</tr>
<tr>
<td>range_end</td>
<td>integer</td>
<td>The end position within the leaderboard</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Real</pre><p><br></p>
<p><strong>Triggers:</strong></p>
<pre class="hljs">Asynchronous Steam Event</pre><table>
<thead>
<tr>
<th>Key</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>id</td>
<td>real</td>
<td>The asynchronous request ID</td>
</tr>
<tr>
<td>event_type</td>
<td>string</td>
<td>The string value <code>&quot;leaderboard_download&quot;</code></td>
</tr>
<tr>
<td>status</td>
<td>int64</td>
<td>The status code if download fails</td>
</tr>
<tr>
<td>lb_name</td>
<td>string</td>
<td>The name of the leaderboard</td>
</tr>
<tr>
<td>num_entries</td>
<td>real</td>
<td>The number of returned entries</td>
</tr>
<tr>
<td>entries</td>
<td>string</td>
<td>A json formatted string with all the downloaded entries (see <a href="#leaderboardentry">LeaderboardEntry</a> for details)</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs">request_id = <span class="hljs-built_in">steam_download_scores_around_user</span>(<span class="hljs-string">&quot;Game Scores&quot;</span>, <span class="hljs-number">-4</span>, <span class="hljs-number">5</span>);</pre><p> This will send off a request to the Steam Server for a range of 10 scores from the leaderboard <code>&amp;quot;Game Scores&amp;quot;</code>, centered on the player and will store the async id of the request in the variable <code>request_id</code>. This will then be handled in the <a href="#Steam.htm">Steam Async Event</a>, as shown in the Extended Example for <a href="#steam_download_scores">steam_download_scores</a>.</p>
<!-- KEYWORDS
steam_download_scores_around_user
-->
<!-- TAGS
steam_download_scores_around_user
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_download_friends_scores">steam_download_friends_scores</h1>
<p> With this function you can retrieve <i>only</i> the scores on the leaderboard that belong to those people that are marked as &quot;friends&quot; in the Steam client. So, if your leaderboard has 200 entries, and 50 of them are your friends, this function will retrieve only those 50 results. The leaderboard name is a string that was defined when you created the leaderboard using the function <a href="#steam_create_leaderboard">steam_create_leaderboard</a>.
This is an asynchronous function that will trigger the <a href="https://manual-en.yoyogames.com/The_Asset_Editors/Object_Properties/Async_Events/Steam.htm">Steam Async Event</a> when the task is finished.</p>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="information_source" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2139.png"></g-emoji> NOTE</strong></p>
<p>If the function call fails for any reason it will return -1 and the async event will not be triggered.</p>
</blockquote>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs"><span class="hljs-built_in">steam_download_friends_scores</span>(lb_name);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>lb_name</td>
<td>string</td>
<td>The name of the leaderboard that you are downloading the scores from</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Real</pre><p><br></p>
<p><strong>Triggers:</strong></p>
<pre class="hljs">Asynchronous Steam Event</pre><table>
<thead>
<tr>
<th>Key</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>id</td>
<td>real</td>
<td>The asynchronous request ID</td>
</tr>
<tr>
<td>event_type</td>
<td>string</td>
<td>The string value <code>&quot;leaderboard_download&quot;</code></td>
</tr>
<tr>
<td>status</td>
<td>int64</td>
<td>The status code if download fails</td>
</tr>
<tr>
<td>lb_name</td>
<td>string</td>
<td>The name of the leaderboard</td>
</tr>
<tr>
<td>num_entries</td>
<td>real</td>
<td>The number of returned entries</td>
</tr>
<tr>
<td>entries</td>
<td>string</td>
<td>A json formatted string with all the downloaded entries (see <a href="#leaderboardentry">LeaderboardEntry</a> for details)</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs">request_id = <span class="hljs-built_in">steam_download_friends_scores</span>(<span class="hljs-string">&quot;Game Scores&quot;</span>);</pre><p> This will send off a request to the Steam Server for the users friends scores from the given leaderboard and will store the async id of the request in the variable <code>request_id</code>. This will then be handled in the <a href="https://manual-en.yoyogames.com/The_Asset_Editors/Object_Properties/Async_Events/Steam.htm">Steam Async Event</a>, as shown in the Extended Example for <a href="#steam_download_scores">steam_download_scores</a>.</p>
<!-- KEYWORDS
steam_download_friends_scores
-->
<!-- TAGS
steam_download_friends_scores
-->
<p><br><br></p>
<hr>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="leaderboardentry">LeaderboardEntry</h1>
<p> A leaderboard entry is represented by a json formatted string that can be returned by the async callback event of the following functions:</p>
<ul>
<li><a href="#steam_download_scores">steam_download_scores</a></li>
<li><a href="#steam_download_scores_around_user">steam_download_scores_around_user</a></li>
<li><p><a href="#steam_download_friends_scores">steam_download_friends_scores</a></p>
<p>This string can be decoded into a <a href="https://manual.yoyogames.com/GameMaker_Language/GML_Reference/Data_Structures/DS_Maps/DS_Maps.htm">DS map</a> (see <a href="https://manual-en.yoyogames.com/GameMaker_Language/GML_Reference/File_Handling/Encoding_And_Hashing/json_decode.htm">json_decode</a>, needs to be destroyed afterwards) or into a <a href="https://manual-en.yoyogames.com/GameMaker_Language/GML_Overview/Structs.htm">struct</a> (see <a href="https://manual-en.yoyogames.com/GameMaker_Language/GML_Reference/File_Handling/Encoding_And_Hashing/json_parse.htm">json_parse</a>, recommended) and will provide the following members.</p>
</li>
</ul>
<table>
<thead>
<tr>
<th>Key</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>rank</td>
<td>real</td>
<td>The rank of the entry on the specified leaderboard</td>
</tr>
<tr>
<td>data</td>
<td>string</td>
<td>The base64 encoded string with the data provided when uploading scores using the <a href="#steam_upload_score_buffer">steam_upload_score_buffer</a> or <br> <a href="#steam_upload_score_buffer_ext">steam_upload_score_buffer_ext</a> functions <g-emoji class="g-emoji" alias="eight_pointed_black_star" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2734.png">✴️</g-emoji> OPTIONAL</td>
</tr>
<tr>
<td>score</td>
<td>real</td>
<td>The score attributed to this entry</td>
</tr>
<tr>
<td>name</td>
<td>string</td>
<td>The display name of the player for this entry</td>
</tr>
<tr>
<td>userID</td>
<td>int64</td>
<td>The unique user id of the player for this entry</td>
</tr>
</tbody>
</table>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="information_source" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2139.png"></g-emoji> NOTE</strong></p>
<p>If <a href="#steam_upload_score_buffer">steam_upload_score_buffer</a> or <a href="#steam_upload_score_buffer_ext">steam_upload_score_buffer_ext</a> were used to upload the score, the decoded entry will now have a <code>&amp;quot;data&amp;quot;</code> key so you can retrieve the data of the uploaded buffer (see the <a href="https://manual-en.yoyogames.com/The_Asset_Editors/Object_Properties/Async_Events/Steam.htm">Steam Async Event</a> extended code example for further details). This data will be base64 encoded and so you will need to use the function <a href="https://manual-en.yoyogames.com/GameMaker_Language/GML_Reference/Buffers/buffer_base64_decode.htm">buffer_base64_decode</a> on the data before reading from the buffer.</p>
</blockquote>
<p><br><br></p>
<hr>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="leaderboarddisplaytype">LeaderboardDisplayType</h1>
<p> These constants specify the display type of a leaderboard and should be used with the function <a href="#steam_create_leaderboard">steam_create_leaderboard</a>.</p>
<table>
<thead>
<tr>
<th>Leaderboard Display Type Constant</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>lb_disp_none</code></td>
<td>Show the leaderboard &quot;as is&quot;.</td>
</tr>
<tr>
<td><code>lb_disp_numeric</code></td>
<td>Show the leaderboard as a numeric display.</td>
</tr>
<tr>
<td><code>lb_disp_time_sec</code></td>
<td>Show the leaderboard values as times, with the base value being seconds.</td>
</tr>
<tr>
<td><code>lb_disp_time_ms</code></td>
<td>Show the leaderboard values as times, with the base value being milliseconds</td>
</tr>
</tbody>
</table>
<p><br><br></p>
<hr>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="leaderboardsortorder">LeaderboardSortOrder</h1>
<p> These constants specify the sort order of a leaderboard and should be used with the function <a href="#steam_create_leaderboard">steam_create_leaderboard</a>.</p>
<table>
<thead>
<tr>
<th>Leaderboard Sort Order Constant</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>lb_sort_none</code></td>
<td>No sorting. The information will be displayed &quot;as is&quot;.</td>
</tr>
<tr>
<td><code>lb_sort_ascending</code></td>
<td>Sort the leaderboard in ascending order.</td>
</tr>
<tr>
<td><code>lb_sort_descending</code></td>
<td>Sort the leaderboard in descending order.</td>
</tr>
</tbody>
</table>
<p><br><br></p>
<hr>
<p class="page" id="Lobbies"></p><h1>Lobbies</h1>
<p><a id="top"></a>
<a id="top"></a>
<!-- Page HTML do not touch -->
<a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="lobbies-matchmaking">Lobbies &amp; Matchmaking</h1>
<p> The following functions and constants allow you to use Steam&#39;s Lobbies and Matchmaking functionality.</p>
<h2 id="current-lobby">Current Lobby</h2>
<p> These functions are provided for handling the current lobby:</p>
<ul>
<li><a href="#steam_lobby_activate_invite_overlay">steam_lobby_activate_invite_overlay</a></li>
<li><a href="#steam_lobby_create">steam_lobby_create</a></li>
<li><a href="#steam_lobby_get_data">steam_lobby_get_data</a></li>
<li><a href="#steam_lobby_get_lobby_id">steam_lobby_get_lobby_id</a></li>
<li><a href="#steam_lobby_get_member_count">steam_lobby_get_member_count</a></li>
<li><a href="#steam_lobby_get_member_id">steam_lobby_get_member_id</a></li>
<li><a href="#steam_lobby_get_owner_id">steam_lobby_get_owner_id</a></li>
<li><a href="#steam_lobby_is_owner">steam_lobby_is_owner</a></li>
<li><a href="#steam_lobby_join_id">steam_lobby_join_id</a></li>
<li><a href="#steam_lobby_leave">steam_lobby_leave</a></li>
<li><a href="#steam_lobby_set_data">steam_lobby_set_data</a></li>
<li><a href="#steam_lobby_set_joinable">steam_lobby_set_joinable</a></li>
<li><a href="#steam_lobby_set_owner_id">steam_lobby_set_owner_id</a></li>
<li><a href="#steam_lobby_set_type">steam_lobby_set_type</a></li>
<li><a href="#steam_lobby_send_chat_message-copy">steam_lobby_get_chat_message_data</a></li>
<li><a href="#steam_lobby_get_chat_message_size">steam_lobby_get_chat_message_size</a></li>
<li><a href="#steam_lobby_get_chat_message_text">steam_lobby_get_chat_message_text</a></li>
<li><a href="#steam_lobby_send_chat_message">steam_lobby_send_chat_message</a></li>
<li><a href="#steam_lobby_send_chat_message_buffer">steam_lobby_send_chat_message_buffer</a></li>
</ul>
<h2 id="matchmaking">Matchmaking</h2>
<p> The following functions allow retrieving and handling lists of public lobbies.</p>
<ul>
<li><a href="#steam_lobby_list_add_distance_filter">steam_lobby_list_add_distance_filter</a></li>
<li><a href="#steam_lobby_list_add_near_filter">steam_lobby_list_add_near_filter</a></li>
<li><a href="#steam_lobby_list_add_numerical_filter">steam_lobby_list_add_numerical_filter</a></li>
<li><a href="#steam_lobby_list_add_string_filter">steam_lobby_list_add_string_filter</a></li>
<li><a href="#steam_lobby_list_request">steam_lobby_list_request</a></li>
<li><a href="#steam_lobby_list_get_count">steam_lobby_list_get_count</a></li>
<li><a href="#steam_lobby_list_get_data">steam_lobby_list_get_data</a></li>
<li><a href="#steam_lobby_list_get_lobby_id">steam_lobby_list_get_lobby_id</a></li>
<li><a href="#steam_lobby_list_get_lobby_member_count">steam_lobby_list_get_lobby_member_count</a></li>
<li><a href="#steam_lobby_list_get_lobby_member_id">steam_lobby_list_get_lobby_member_id</a></li>
<li><a href="#steam_lobby_list_get_lobby_owner_id">steam_lobby_list_get_lobby_owner_id</a></li>
<li><a href="#steam_lobby_list_is_loading">steam_lobby_list_is_loading</a></li>
</ul>
<h2 id="constants">Constants</h2>
<p> These are the constants used by this API:</p>
<ul>
<li><a href="#lobbyfiltercomparisontype">LobbyFilterComparisonType</a></li>
<li><a href="#lobbyfilterdistancemode">LobbyFilterDistanceMode</a></li>
<li><a href="#lobbytype">LobbyType</a></li>
</ul>
<p><br><br></p>
<hr>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_lobby_activate_invite_overlay">steam_lobby_activate_invite_overlay</h1>
<p> Displays an invitation overlay if currently in a lobby.
The invitation overlay is much akin to the friends-list overlay, but only shows online friends, and shows an &quot;invite&quot; buttons on each row.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_lobby_activate_invite_overlay();</pre><p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">bool</pre><p><br></p>
<p><strong>Triggers:</strong></p>
<pre class="hljs">Asynchronous Steam Event (when an invitation is accepted)</pre><table>
<thead>
<tr>
<th>Key</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>event_type</td>
<td>string</td>
<td>The string value <code>&quot;lobby_join_requested&quot;</code></td>
</tr>
<tr>
<td>lobby_id</td>
<td>int64</td>
<td>The lobby unique identifier</td>
</tr>
<tr>
<td>success</td>
<td>bool</td>
<td>Whether or not the task was successful</td>
</tr>
<tr>
<td>result</td>
<td>real</td>
<td>The code of the result</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs">steam_lobby_activate_invite_overlay();</pre><p> The above code will show the Steam invite overlay.</p>
<p><br><br></p>
<hr>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_lobby_create">steam_lobby_create</h1>
<p> Starts creating a lobby. Returns whether or not the task was successfully created.
This is an asynchronous function that will trigger the <a href="https://manual-en.yoyogames.com/The_Asset_Editors/Object_Properties/Async_Events/Steam.htm">Steam Async Event</a> when the task is finished.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_lobby_create(type, max_members);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>type</td>
<td><a href="#lobbytype">LobbyType</a></td>
<td>Constant that indicate the status of the lobby</td>
</tr>
<tr>
<td>max_members</td>
<td>real</td>
<td>Indicates the maximum allowed number of users in the lobby (including the lobby&#39;s creator)</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">bool</pre><p><br></p>
<p><strong>Triggers:</strong></p>
<pre class="hljs">Asynchronous Steam Event</pre><table>
<thead>
<tr>
<th>Key</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>event_type</td>
<td>string</td>
<td>The string value <code>&quot;lobby_created&quot;</code></td>
</tr>
<tr>
<td>lobby_id</td>
<td>int64</td>
<td>The name of the leaderboard</td>
</tr>
<tr>
<td>success</td>
<td>real</td>
<td>Whether or not the request was successful</td>
</tr>
<tr>
<td>result</td>
<td>bool</td>
<td>The status code (descriptions can be found in Steam API documentation)</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs">steam_lobby_create(steam_lobby_type_public, <span class="hljs-number">4</span>);</pre><p> The above code will create a lobby with a maximum of 4 users. We now add the following into the <a href="https://manual-en.yoyogames.com/The_Asset_Editors/Object_Properties/Async_Events/Steam.htm">Steam Async Event</a> for checking the success of task:</p>
<pre class="hljs"><span class="hljs-keyword">var</span> type = <span class="hljs-symbol">async_load</span>[? <span class="hljs-string">&quot;type&quot;</span>];
<span class="hljs-keyword">if</span> (type == <span class="hljs-string">&quot;lobby_created&quot;</span>)
{
<span class="hljs-keyword">if</span> (<span class="hljs-symbol">async_load</span>[? <span class="hljs-string">&quot;success&quot;</span>])
<span class="hljs-built_in">show_debug_message</span>(<span class="hljs-string">&quot;Lobby created&quot;</span>);
<span class="hljs-keyword">else</span>
<span class="hljs-built_in">show_debug_message</span>(<span class="hljs-string">&quot;Failed to create lobby&quot;</span>);
}</pre><p> in the example we are simply outputting the success of the lobby creation task.</p>
<p><br><br></p>
<hr>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_lobby_get_chat_message_data">steam_lobby_get_chat_message_data</h1>
<p> Returns the data of a message sent using <a href="#steam_lobby_send_chat_message_buffer">steam_lobby_send_chat_message_buffer</a>. Returns whether or not the buffer was successfully filled with the message data.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_lobby_get_chat_message_data(message_index, buffer);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>message_index</td>
<td>real</td>
<td>The message unique identifier</td>
</tr>
<tr>
<td>buffer</td>
<td>buffer ID</td>
<td>The buffer to write the data to</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">bool</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs">chat_message_buf = <span class="hljs-built_in">buffer_create</span>(steam_lobby_max_chat_message_size, <span class="hljs-literal">buffer_fixed</span>, <span class="hljs-number">1</span>);
steam_lobby_get_chat_message_data(_msg_index, chat_message_buf)</pre><p> The code above will get the current message data and place it into a buffer (resizing if required and allowed, ie.: <strong>buffer_grow</strong> ).</p>
<p><br><br></p>
<hr>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_lobby_get_chat_message_size">steam_lobby_get_chat_message_size</h1>
<p> Return the size of a message</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_lobby_get_chat_message_size(message_index)</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>message_index</td>
<td>real</td>
<td>The argument to be passed in</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs"><span class="hljs-built_in">real</span></pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-comment">// ... INSIDE A STEAM ASYNC EVENT ...</span>
<span class="hljs-keyword">switch</span> (async[? <span class="hljs-string">&quot;event_type&quot;</span>])
{
<span class="hljs-keyword">case</span> <span class="hljs-string">&quot;lobby_chat_message&quot;</span>:
size = steam_lobby_get_chat_message_size(<span class="hljs-symbol">async_load</span>[?<span class="hljs-string">&quot;message_index&quot;</span>]);
<span class="hljs-keyword">break</span>;
}</pre><p> The code above will get the current message size in bytes.</p>
<p><br><br></p>
<hr>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_lobby_get_chat_message_text">steam_lobby_get_chat_message_text</h1>
<p> Return the text of a message.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_lobby_get_chat_message_text(index);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>index</td>
<td>real</td>
<td>Message index</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs"><span class="hljs-built_in">string</span></pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-comment">// ... INSIDE A STEAM ASYNC EVENT ...</span>
<span class="hljs-keyword">switch</span> (async[? <span class="hljs-string">&quot;event_type&quot;</span>])
{
<span class="hljs-keyword">case</span> <span class="hljs-string">&quot;lobby_chat_message&quot;</span>:
text = steam_lobby_get_chat_message_text(<span class="hljs-symbol">async_load</span>[?<span class="hljs-string">&quot;message_index&quot;</span>]);
<span class="hljs-keyword">break</span>;
}</pre><p> The code above will get the current message text.</p>
<p><br><br></p>
<hr>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_lobby_get_data">steam_lobby_get_data</h1>
<p> Returns a lobby field value, as set by <a href="#steam_lobby_set_data">steam_lobby_set_data</a>.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_lobby_get_data(key);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>key</td>
<td>string</td>
<td>String representation of the data</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs"><span class="hljs-built_in">string</span></pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">var</span> title = steam_lobby_get_data(<span class="hljs-string">&quot;title&quot;</span>);</pre><p> The code above will return the data of the <code>title</code> field of the current value.</p>
<p><br><br></p>
<hr>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_lobby_get_lobby_id">steam_lobby_get_lobby_id</h1>
<section>
<article>
Returns the Steam ID of the current lobby.
</article>
</section>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_lobby_get_lobby_id();</pre><p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs"><span class="hljs-built_in">int64</span></pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">var</span> lobby_id = steam_lobby_get_lobby_id()</pre><p> The code above will get the current lobby id and store it in a variable.</p>
<p><br><br></p>
<hr>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_lobby_get_member_count">steam_lobby_get_member_count</h1>
<p> Returns the number of users in the current lobby (including you).
If the lobby is not valid, returns 0.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_lobby_get_member_count();</pre><p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs"><span class="hljs-built_in">real</span></pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">for</span>(<span class="hljs-keyword">var</span> i = <span class="hljs-number">0</span> ; i &lt; steam_lobby_get_member_count() ; i++)
{
<span class="hljs-keyword">var</span> user_id = steam_lobby_get_member_id(i)
<span class="hljs-comment">//Do something with the user id</span>
}</pre><p> The code sample above will get the total number of member in the current lobby and iterate over all of them getting their unique ids, using the <a href="#steam_lobby_get_member_id">steam_lobby_get_member_id</a> function.</p>
<p><br><br></p>
<hr>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_lobby_get_member_id">steam_lobby_get_member_id</h1>
<p> Returns the user ID of the member at the given index in the current lobby.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_lobby_get_member_id(index);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>index</td>
<td>real</td>
<td>Position of the member of the lobby to return</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs"><span class="hljs-built_in">int64</span></pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">for</span>(<span class="hljs-keyword">var</span> i = <span class="hljs-number">0</span> ; i &lt; steam_lobby_get_member_count() ; i++)
{
<span class="hljs-keyword">var</span> user_id = steam_lobby_get_member_id(i)
<span class="hljs-comment">//Do something with the user id</span>
}</pre><p> The code sample above will iterate over all of the members inside a lobby and get their unique ids.</p>
<p><br><br></p>
<hr>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_lobby_get_owner_id">steam_lobby_get_owner_id</h1>
<p> Returns the lobby&#39;s owner&#39;s Steam ID. If the lobby is not valid, returns ID 0.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_lobby_get_owner_id();</pre><p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs"><span class="hljs-built_in">int64</span></pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">var</span> lobby_owner = steam_lobby_get_owner_id()</pre><p> The code above will return the unique id of the owner of the current lobby.</p>
<p><br><br></p>
<hr>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_lobby_is_owner">steam_lobby_is_owner</h1>
<p> Returns whether the local player is the lobby&#39;s owner.</p>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="information_source" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2139.png"></g-emoji> NOTE</strong></p>
<p>If the lobby is not valid, returns false.</p>
</blockquote>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_lobby_is_owner()</pre><p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">bool</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">for</span> (<span class="hljs-keyword">var</span> i = <span class="hljs-number">0</span>; i &lt; steam_lobby_get_member_count(); i++)
{
<span class="hljs-keyword">if</span> (!steam_lobby_is_owner())
{
<span class="hljs-keyword">var</span> user_id = steam_lobby_get_member_id(i)
steam_lobby_set_owner_id(user_id)
<span class="hljs-keyword">break</span>;
}
}</pre><p> The code example will loop through all the members in a lobby and transfers ownership to the first member that is not the owner.</p>
<p><br><br></p>
<hr>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_lobby_join_id">steam_lobby_join_id</h1>
<p> Starts joining a lobby with the given ID. Returns whether or not the API was correctly initialized.
This is an asynchronous function that will trigger the <a href="https://manual-en.yoyogames.com/The_Asset_Editors/Object_Properties/Async_Events/Steam.htm">Steam Async Event</a> when the task is finished.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_lobby_join_id(lobby_id);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>lobby_id</td>
<td>int64</td>
<td>Identifier of the lobby</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">N/A</pre><p><br></p>
<p><strong>Triggers:</strong></p>
<pre class="hljs">Asynchronous Steam Event</pre><table>
<thead>
<tr>
<th>Key</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>event_type</td>
<td>string</td>
<td>The string value <code>&quot;lobby_joined&quot;</code></td>
</tr>
<tr>
<td>lobby_id</td>
<td>int64</td>
<td>The lobby unique identifier</td>
</tr>
<tr>
<td>success</td>
<td>bool</td>
<td>Whether or not the task was successful</td>
</tr>
<tr>
<td>result</td>
<td>real</td>
<td>The code of the result</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs">steam_lobby_join_id(lobbyID)</pre><p> The code will attempt the join a lobby with a given id, the task callback can be listened to inside the the <a href="https://manual-en.yoyogames.com/The_Asset_Editors/Object_Properties/Async_Events/Steam.htm">Steam Async Event</a> with the folllowing sample code:</p>
<pre class="hljs"><span class="hljs-keyword">var</span> type = <span class="hljs-symbol">async_load</span>[? <span class="hljs-string">&quot;type&quot;</span>];
<span class="hljs-keyword">if</span> (type == <span class="hljs-string">&quot;lobby_joined&quot;</span>)
{
<span class="hljs-keyword">var</span> lobby_id = <span class="hljs-symbol">async_load</span>[? <span class="hljs-string">&quot;lobby_id&quot;</span>];
<span class="hljs-keyword">var</span> success = <span class="hljs-symbol">async_load</span>[? <span class="hljs-string">&quot;success&quot;</span>];
<span class="hljs-comment">// Do something with the data</span>
}
</pre><p> In the example we are simply caching the data into variables.</p>
<p><br><br></p>
<hr>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_lobby_leave">steam_lobby_leave</h1>
<p> Leaves the current lobby (if any). Does not raise any errors if currently not in a lobby.</p>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="information_source" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2139.png"></g-emoji> NOTE</strong></p>
<p>If you are the lobby owner and leave the lobby, Steam transfers lobby ownership to any other available user, so you may need to manually handle ownership transfer using <a href="#steam_lobby_set_owner_id">steam_lobby_set_owner_id</a> before leaving.</p>
</blockquote>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_lobby_leave();</pre><p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">N/A</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs">steam_lobby_leave();</pre><p> The code sample above will make the user leave the current lobby.</p>
<p><br><br></p>
<hr>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_lobby_send_chat_message">steam_lobby_send_chat_message</h1>
<p> Broadcasts a chat text message to all the users in the lobby.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_lobby_send_chat_message(text);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>text</td>
<td>string</td>
<td>The string to be sent (up to 4000 characters)</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">bool</pre><p><br></p>
<p><strong>Triggers:</strong></p>
<pre class="hljs">Asynchronous Steam Event</pre><table>
<thead>
<tr>
<th>Key</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>event_type</td>
<td>string</td>
<td>The string value <code>&quot;lobby_chat_message&quot;</code></td>
</tr>
<tr>
<td>user_id</td>
<td>string</td>
<td>The sender unique identifier</td>
</tr>
<tr>
<td>message_index</td>
<td>real</td>
<td>The message unique identifier</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs">steam_lobby_send_chat_message(<span class="hljs-string">&quot;Hello World&quot;</span>);</pre><p> The code will broadcast a text message to all the members in the current lobby, the message can be read using the <a href="https://manual-en.yoyogames.com/The_Asset_Editors/Object_Properties/Async_Events/Steam.htm">Steam Async Event</a> callback:</p>
<pre class="hljs"><span class="hljs-keyword">var</span> type = <span class="hljs-symbol">async_load</span>[? <span class="hljs-string">&quot;type&quot;</span>];
<span class="hljs-keyword">if</span> (type == <span class="hljs-string">&quot;lobby_chat_message&quot;</span>)
{
<span class="hljs-keyword">var</span> user_id = <span class="hljs-symbol">async_load</span>[? <span class="hljs-string">&quot;user_id&quot;</span>];
<span class="hljs-keyword">var</span> msg_id = <span class="hljs-symbol">async_load</span>[? <span class="hljs-string">&quot;message_index&quot;</span>];
<span class="hljs-keyword">var</span> user_name = steam_get_user_persona_name_sync(user_id);
<span class="hljs-keyword">var</span> message = steam_lobby_get_chat_message_text(msg_id);
<span class="hljs-comment">// Do something with the data</span>
}
</pre><p> In the example we are simply caching the data into variables notice that use use the function <a href="#steam_get_user_persona_name_sync.htm">steam_get_user_persona_name_sync</a> and <a href="#steam_lobby_get_chat_message_text">steam_lobby_get_chat_message_text</a> to get both the user name and the text inside the message, respectively.</p>
<p><br><br></p>
<hr>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_lobby_send_chat_message_buffer">steam_lobby_send_chat_message_buffer</h1>
<p> Broadcasts a chat (text or binary data) message to all the users in the lobby.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_lobby_send_chat_message_buffer(buffer, size);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>buffer</td>
<td>buffer ID</td>
<td>The buffer to be sent (up to 4 Kilobytes in size)</td>
</tr>
<tr>
<td>size</td>
<td>real</td>
<td>The amount of byte to be sent (there is no offset).</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">bool</pre><p><br></p>
<p><strong>Triggers:</strong></p>
<pre class="hljs">Asynchronous Steam Event</pre><table>
<thead>
<tr>
<th>Key</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>event_type</td>
<td>string</td>
<td>The string value <code>&quot;lobby_chat_message&quot;</code></td>
</tr>
<tr>
<td>user_id</td>
<td>string</td>
<td>The sender unique identifier</td>
</tr>
<tr>
<td>entry_type</td>
<td>real</td>
<td>Type of message received.</td>
</tr>
<tr>
<td>message_index</td>
<td>real</td>
<td>The message unique identifier</td>
</tr>
<tr>
<td>message_size</td>
<td>real</td>
<td>The size of the message being broadcasted</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">var</span> buff = <span class="hljs-built_in">buffer_create</span>(<span class="hljs-number">256</span>, <span class="hljs-literal">buffer_fixed</span>, <span class="hljs-number">1</span>);
<span class="hljs-built_in">buffer_write</span>(buff, <span class="hljs-literal">buffer_string</span>, <span class="hljs-string">&quot;This is a buffer!&quot;</span>);
steam_lobby_send_chat_message_buffer(buff);</pre><p> The code will broadcast a message (text or binary data) to all the members in the current lobby, the message can be read using the <a href="https://manual-en.yoyogames.com/The_Asset_Editors/Object_Properties/Async_Events/Steam.htm">Steam Async Event</a> callback:</p>
<pre class="hljs"><span class="hljs-keyword">var</span> type = <span class="hljs-symbol">async_load</span>[? <span class="hljs-string">&quot;type&quot;</span>];
<span class="hljs-keyword">if</span> (type == <span class="hljs-string">&quot;lobby_chat_message&quot;</span>)
{
<span class="hljs-keyword">var</span> user_id = <span class="hljs-symbol">async_load</span>[? <span class="hljs-string">&quot;user_id&quot;</span>];
<span class="hljs-keyword">var</span> msg_id = <span class="hljs-symbol">async_load</span>[? <span class="hljs-string">&quot;message_index&quot;</span>];
<span class="hljs-keyword">var</span> user_name = steam_get_user_persona_name_sync(user_id);
<span class="hljs-keyword">var</span> data = steam_lobby_get_chat_message_data(<span class="hljs-literal">global</span>.chat_buffer, msg_id);
<span class="hljs-comment">// Do something with the data</span>
}
</pre><p> In the example we are simply caching the data into variables notice that use use the function <a href="#steam_get_user_persona_name_sync.htm">steam_get_user_persona_name_sync</a> and <a href="#steam_lobby_send_chat_message-copy">steam_lobby_get_chat_message_data</a> to get both the user name and the data inside the message, respectively.</p>
<p><br><br></p>
<hr>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_lobby_set_data">steam_lobby_set_data</h1>
<p> Changes a lobby&#39;s field. You must be the lobby&#39;s owner to do this. Returns whether or not the data was set.
Fields can then be used to filter lobbies via matchmaking functions.</p>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="information_source" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2139.png"></g-emoji> NOTE</strong></p>
<p>If your value is numeric, convert it to string prior to passing it to the function.</p>
</blockquote>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_lobby_set_data(key, value);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>key</td>
<td>string</td>
<td>The key to set the data for</td>
</tr>
<tr>
<td>value</td>
<td>string</td>
<td>The value to set</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">bool</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs">steam_lobby_set_data(<span class="hljs-string">&quot;LobbyName&quot;</span>,<span class="hljs-string">&quot;GreatLobby&quot;</span>)</pre><p> The code sample will set the <code>&amp;quot;LobbyName&amp;quot;</code> lobby field to the provided value (<code>&amp;quot;GreatLobby&amp;quot;</code>).</p>
<p><br><br></p>
<hr>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_lobby_set_joinable">steam_lobby_set_joinable</h1>
<p> Sets whether or not a lobby is join-able by other players. This always defaults to enabled for a new lobby. Returns whether or not the property was set.</p>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="information_source" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2139.png"></g-emoji> NOTE</strong></p>
<p>If joining is disabled, then no players can join, even if they are a friend or have been invited.</p>
</blockquote>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="information_source" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2139.png"></g-emoji> NOTE</strong></p>
<p>Lobbies with joining disabled will not be returned from a lobby search.</p>
</blockquote>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_lobby_set_joinable(joinable);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>joinable</td>
<td>bool</td>
<td>Allow ( <strong>true</strong> ) or prevent ( <strong>false</strong> ) users from joining this lobby</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">bool</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs">steam_lobby_set_joinable(<span class="hljs-literal">false</span>);</pre><p> The code above will prevent user from joining the current lobby.</p>
<p><br><br></p>
<hr>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_lobby_set_owner_id">steam_lobby_set_owner_id</h1>
<p> If you are a lobby owner, transfers the lobby ownership to the specified player, which must be in this same lobby. Returns whether or not the property was set.</p>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="information_source" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2139.png"></g-emoji> NOTE</strong></p>
<p>You need to be the lobby owner in order to use the function.</p>
</blockquote>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_lobby_set_owner_id(user_id);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>user_id</td>
<td>bool</td>
<td>The user to set as owner of the lobby</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">bool</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">for</span>(<span class="hljs-keyword">var</span> i = <span class="hljs-number">0</span> ; i &lt; steam_lobby_get_member_count() ; i++)
{
<span class="hljs-keyword">if</span>(!steam_lobby_is_owner())
{
<span class="hljs-keyword">var</span> user_id = steam_lobby_get_member_id(i)
steam_lobby_set_owner_id(user_id)
<span class="hljs-keyword">break</span>;
}
}</pre><p> The code example will loop through all the members in a lobby and transfers ownership to the first member that is not the owner.</p>
<p><br><br></p>
<hr>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_lobby_set_type">steam_lobby_set_type</h1>
<p> Changes the lobby&#39;s type. Useful, if you don&#39;t allow mid-session joining, you could have the game make lobbies private on session start (or use <a href="#steam_lobby_set_joinable">steam_lobby_set_joinable</a>).</p>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="information_source" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2139.png"></g-emoji> NOTE</strong></p>
<p>You need to be the lobby owner in order to use the function.</p>
</blockquote>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_lobby_set_type(type)</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>type</td>
<td><a href="#lobbytype">LobbyType</a></td>
<td>The lobby visibility</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">N/A</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs">steam_lobby_set_type(steam_lobby_type_private)</pre><p> The code above will change the lobby joining policy.</p>
<p><br><br></p>
<hr>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_lobby_list_add_distance_filter">steam_lobby_list_add_distance_filter</h1>
<p> Restricts results by region and sorts them based on geographical proximity.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_lobby_list_add_distance_filter(mode);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>mode</td>
<td><a href="#lobbyfilterdistancemode">LobbyFilterDistanceMode</a></td>
<td>Distance filter to be applied</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">bool</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs">steam_lobby_list_add_distance_filter(steam_lobby_list_distance_filter_far);
steam_lobby_list_add_near_filter(<span class="hljs-string">&quot;myNearFilter&quot;</span>, <span class="hljs-number">77</span>);
steam_lobby_list_add_numerical_filter(<span class="hljs-string">&quot;level&quot;</span>, <span class="hljs-number">10</span>, steam_lobby_list_filter_gt);
steam_lobby_list_add_string_filter(<span class="hljs-string">&quot;Stage&quot;</span>,<span class="hljs-string">&quot;BattleZone&quot;</span>, steam_lobby_list_filter_eq)
steam_lobby_list_request();</pre><p> The code above will apply some filters to be lobby list request before requesting the results.</p>
<p><br><br></p>
<hr>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_lobby_list_add_near_filter">steam_lobby_list_add_near_filter</h1>
<p> Sorts the results based on how close their field&#39;s (key)&#39;s value is to the provided one.</p>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="information_source" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2139.png"></g-emoji> NOTE</strong></p>
<p>If multiple near-filters are specified, the earlier-set ones take precedence.</p>
</blockquote>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_lobby_list_add_near_filter(key, value);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>key</td>
<td>string</td>
<td>The filter key name to match.</td>
</tr>
<tr>
<td>value</td>
<td>real</td>
<td>The value that lobbies will be sorted on.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">bool</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs">steam_lobby_list_add_distance_filter(steam_lobby_list_distance_filter_far);
steam_lobby_list_add_near_filter(<span class="hljs-string">&quot;myNearFilter&quot;</span>, <span class="hljs-number">77</span>);
steam_lobby_list_add_numerical_filter(<span class="hljs-string">&quot;level&quot;</span>, <span class="hljs-number">10</span>, steam_lobby_list_filter_gt);
steam_lobby_list_add_string_filter(<span class="hljs-string">&quot;Stage&quot;</span>,<span class="hljs-string">&quot;BattleZone&quot;</span>, steam_lobby_list_filter_eq)
steam_lobby_list_request();</pre><p> The code above will apply some filters to be lobby list request before requesting the results.</p>
<p><br><br></p>
<hr>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_lobby_list_add_numerical_filter">steam_lobby_list_add_numerical_filter</h1>
<p> Sets up a numeric filter for the next lobby list request. That is, lobbies not matching the condition will be excluded from results.</p>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="information_source" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2139.png"></g-emoji> NOTE</strong></p>
<p>Lobbies without the given field (key) will be excluded.</p>
</blockquote>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_lobby_list_add_numerical_filter(key, value, comparison_type)</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>key</td>
<td>string</td>
<td>The filter key name to match</td>
</tr>
<tr>
<td>value</td>
<td>real</td>
<td>The number to compare.</td>
</tr>
<tr>
<td>comparison_type</td>
<td><a href="#lobbyfiltercomparisontype">LobbyFilterComparisonType</a></td>
<td>The type of comparison to make.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">bool</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs">steam_lobby_list_add_distance_filter(steam_lobby_list_distance_filter_far);
steam_lobby_list_add_near_filter(<span class="hljs-string">&quot;myNearFilter&quot;</span>, <span class="hljs-number">77</span>);
steam_lobby_list_add_numerical_filter(<span class="hljs-string">&quot;level&quot;</span>, <span class="hljs-number">10</span>, steam_lobby_list_filter_gt);
steam_lobby_list_add_string_filter(<span class="hljs-string">&quot;Stage&quot;</span>,<span class="hljs-string">&quot;BattleZone&quot;</span>, steam_lobby_list_filter_eq)
steam_lobby_list_request();</pre><p> The code above will apply some filters to be lobby list request before requesting the results.</p>
<p><br><br></p>
<hr>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_lobby_list_add_string_filter">steam_lobby_list_add_string_filter</h1>
<p> Sets up a string filter for the next lobby list request. That is, lobbies not matching the condition will be excluded from results.</p>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="information_source" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2139.png"></g-emoji> NOTE</strong></p>
<p>Lobbies without the given field (<code>key</code>) will be assumed to have it as <code>&amp;quot;&amp;quot;</code>.</p>
</blockquote>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_lobby_list_add_string_filter(key, value, comparison_type)</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>key</td>
<td>string</td>
<td>The filter key name to match</td>
</tr>
<tr>
<td>value</td>
<td>string</td>
<td>The string to compare</td>
</tr>
<tr>
<td>comparison_type</td>
<td><a href="#lobbyfiltercomparisontype">LobbyFilterComparisonType</a></td>
<td>The type of comparison to make (strings only accepts equal or not equal comparison)</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">bool</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs">steam_lobby_list_add_distance_filter(steam_lobby_list_distance_filter_far);
steam_lobby_list_add_near_filter(<span class="hljs-string">&quot;myNearFilter&quot;</span>, <span class="hljs-number">77</span>);
steam_lobby_list_add_numerical_filter(<span class="hljs-string">&quot;level&quot;</span>, <span class="hljs-number">10</span>, steam_lobby_list_filter_gt);
steam_lobby_list_add_string_filter(<span class="hljs-string">&quot;Stage&quot;</span>,<span class="hljs-string">&quot;BattleZone&quot;</span>, steam_lobby_list_filter_eq)
steam_lobby_list_request();</pre><p> The code above will apply some filters to be lobby list request before requesting the results.</p>
<p><br><br></p>
<hr>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_lobby_list_get_count">steam_lobby_list_get_count</h1>
<p> Return count of lobbies, after a successful call to <a href="#steam_lobby_list_request">steam_lobby_list_request</a>.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_lobby_list_get_count();</pre><p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs"><span class="hljs-built_in">real</span></pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">for</span>(<span class="hljs-keyword">var</span> a = <span class="hljs-number">0</span> ; a &lt; steam_lobby_list_get_count() ; a++)
{
ins = <span class="hljs-built_in">instance_create_depth</span>(<span class="hljs-number">600</span>,<span class="hljs-number">200</span>+<span class="hljs-number">90</span>*a,<span class="hljs-number">0</span>,Obj_Steam_Networking_List_Slot);
ins.index = a
ins.lobby_id = steam_lobby_list_get_lobby_id(a)
ins.creator = steam_lobby_list_get_data(a, <span class="hljs-string">&quot;Creator&quot;</span>)
}</pre><p> After a successful <a href="#steam_lobby_list_request">steam_lobby_list_request</a> this function will return the number of results in the lobby query.</p>
<p><br><br></p>
<hr>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_lobby_list_get_data">steam_lobby_list_get_data</h1>
<p> Gets the metadata associated with the specified key from the specified lobby.</p>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="information_source" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2139.png"></g-emoji> NOTE</strong></p>
<p>The argument <code>lobby_index</code> is not a lobby id but instead the position of the lobby (from 0 to <a href="#steam_lobby_list_get_count">steam_lobby_list_get_count</a>) on the query array after a <a href="#steam_lobby_list_request">steam_lobby_list_request</a> async event is triggered.</p>
</blockquote>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_lobby_list_get_data(lobby_index, key);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>lobby_index</td>
<td>real</td>
<td>The lobby list index from the queried result.</td>
</tr>
<tr>
<td>key</td>
<td>string</td>
<td>The key to get the value of.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs"><span class="hljs-built_in">string</span></pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">for</span>(<span class="hljs-keyword">var</span> a = <span class="hljs-number">0</span> ; a &lt; steam_lobby_list_get_count() ; a++)
{
ins = <span class="hljs-built_in">instance_create_depth</span>(<span class="hljs-number">600</span>,<span class="hljs-number">200</span>+<span class="hljs-number">90</span>*a,<span class="hljs-number">0</span>,Obj_Steam_Networking_List_Slot);
ins.index = a
ins.lobby_id = steam_lobby_list_get_lobby_id(a)
ins.creator = steam_lobby_list_get_data(a, <span class="hljs-string">&quot;Creator&quot;</span>)
}</pre><p> The above code will show a code example.</p>
<p><br><br></p>
<hr>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_lobby_list_get_lobby_id">steam_lobby_list_get_lobby_id</h1>
<p> Gets the lobby id associated to the index.</p>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="information_source" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2139.png"></g-emoji> NOTE</strong></p>
<p>The argument <code>lobby_index</code> is not a lobby id but instead the position of the lobby (from 0 to <a href="#steam_lobby_list_get_count">steam_lobby_list_get_count</a>) on the query array after a <a href="#steam_lobby_list_request">steam_lobby_list_request</a> async event is triggered.</p>
</blockquote>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_lobby_list_get_lobby_id(lobby_index);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>lobby_index</td>
<td>real</td>
<td>The lobby index in the current lobby list</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs"><span class="hljs-built_in">int64</span></pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">for</span>(<span class="hljs-keyword">var</span> a = <span class="hljs-number">0</span>; a &lt; steam_lobby_list_get_count(); a++)
{
ins = <span class="hljs-built_in">instance_create_depth</span>(<span class="hljs-number">600</span>, <span class="hljs-number">200</span>+<span class="hljs-number">90</span>*a, <span class="hljs-number">0</span>, Obj_Steam_Networking_List_Slot);
ins.index = a;
ins.lobby_id = steam_lobby_list_get_lobby_id(a);
ins.creator = steam_lobby_list_get_data(a, <span class="hljs-string">&quot;Creator&quot;</span>);
}</pre><p> The above code will show a code example.</p>
<p><br><br></p>
<hr>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_lobby_list_get_lobby_member_count">steam_lobby_list_get_lobby_member_count</h1>
<p> Gets the number of users in a lobby. <em>**</em> </p>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="information_source" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2139.png"></g-emoji> NOTE</strong></p>
<p>The argument <code>lobby_index</code> is not a lobby id but instead the position of the lobby (from 0 to <a href="#steam_lobby_list_get_count">steam_lobby_list_get_count</a>) on the query array after a <a href="#steam_lobby_list_request">steam_lobby_list_request</a> async event is triggered.</p>
</blockquote>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_lobby_list_get_lobby_member_count(lobby_index);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>lobby_index</td>
<td>real</td>
<td>The lobby ID of the lobby to get the number of members of.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs"><span class="hljs-built_in">real</span></pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs">steam_lobby_list_get_lobby_member_count(steam_lobby_get_lobby_id());</pre><p> The above code will show a code example.</p>
<p><br><br></p>
<hr>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_lobby_list_get_lobby_member_id">steam_lobby_list_get_lobby_member_id</h1>
<p> Gets the Steam ID of the lobby member at the given index.</p>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="information_source" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2139.png"></g-emoji> NOTE</strong></p>
<p>The argument <code>lobby_index</code> is not a lobby id but instead the index representation of the lobby (ranging from 0 to <a href="#steam_lobby_list_get_count">steam_lobby_list_get_count</a>) on the query array after a <a href="#steam_lobby_list_request">steam_lobby_list_request</a> async event is triggered. By the same logic the <code>member_index</code> is also not the user id but the indexed representation of the user within the lobby (this value ranges from 0 to <a href="#steam_lobby_list_get_lobby_member_count">steam_lobby_list_get_lobby_member_count</a>).</p>
</blockquote>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_lobby_list_get_lobby_member_id(lobby_index, member_index);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>lobby_index</td>
<td>real</td>
<td>This MUST be an index ranging from 0 to <a href="#steam_lobby_list_get_count">steam_lobby_list_get_count</a></td>
</tr>
<tr>
<td>member_index</td>
<td>real</td>
<td>This MUST be an index ranging from 0 to <a href="#steam_lobby_list_get_lobby_member_count">steam_lobby_list_get_lobby_member_count</a> of the lobby index</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs"><span class="hljs-built_in">int64</span></pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">var</span> count = steam_lobby_list_get_lobby_member_count(steam_lobby_get_lobby_id())
<span class="hljs-keyword">for</span>(<span class="hljs-keyword">var</span> i = <span class="hljs-number">0</span> ; i &lt; count ; i++)
{
<span class="hljs-keyword">var</span> member = steam_lobby_list_get_lobby_member_id(i)
<span class="hljs-comment">//do something with the member id</span>
}</pre><p> The above code will show a code example.</p>
<p><br><br></p>
<hr>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_lobby_list_get_lobby_owner_id">steam_lobby_list_get_lobby_owner_id</h1>
<p> Returns the current lobby owner.</p>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="information_source" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2139.png"></g-emoji> NOTE</strong></p>
<p>The argument <code>lobby_index</code> is not a lobby id but instead the position of the lobby (from 0 to <a href="#steam_lobby_list_get_count">steam_lobby_list_get_count</a>) on the query array after a <a href="#steam_lobby_list_request">steam_lobby_list_request</a> async event is triggered.</p>
</blockquote>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_lobby_list_get_lobby_owner_id(index);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>index</td>
<td>real</td>
<td>The lobby index from the lobby list request result</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs"><span class="hljs-built_in">int64</span></pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs">steam_lobby_list_get_lobby_owner_id(steam_lobby_get_lobby_id());</pre><p> The above code will show a code example.</p>
<p><br><br></p>
<hr>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_lobby_list_is_loading">steam_lobby_list_is_loading</h1>
<p> Returns whether a lobby list request is currently underway.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_lobby_list_is_loading();</pre><p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">bool</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs">steam_lobby_list_request();
<span class="hljs-comment">// Later in code</span>
<span class="hljs-keyword">if</span> (steam_lobby_list_is_loading)
<span class="hljs-built_in">show_message</span>(<span class="hljs-string">&quot;Loading&quot;</span>);
</pre><p> The above will code will check to see if the lobby list request is still loading or has finished.</p>
<p><br><br></p>
<hr>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_lobby_list_join">steam_lobby_list_join</h1>
<p> Starts joining a lobby with the given ID.
This is an asynchronous function that will trigger the <a href="https://manual-en.yoyogames.com/The_Asset_Editors/Object_Properties/Async_Events/Steam.htm">Steam Async Event</a> when the task is finished.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_lobby_list_join(index);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>index</td>
<td>Position of the lobby in the list</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">N/A</pre><p><br></p>
<p><strong>Triggers:</strong></p>
<pre class="hljs">Asynchronous Steam Event</pre><table>
<thead>
<tr>
<th>Key</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>event_type</td>
<td>string</td>
<td>The string value <code>&quot;lobby_joined&quot;</code></td>
</tr>
<tr>
<td>lobby_id</td>
<td>int64</td>
<td>The lobby unique identifier</td>
</tr>
<tr>
<td>success</td>
<td>bool</td>
<td>Whether or not the task was successful</td>
</tr>
<tr>
<td>result</td>
<td>real</td>
<td>The code of the result</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs">steam_lobby_list_join(<span class="hljs-number">0</span>)</pre><p> The code sample above can be used to join a lobby with the given index after a <a href="#steam_lobby_list_request">steam_lobby_list_request</a> as been preformed.</p>
<p><br><br></p>
<hr>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_lobby_list_request">steam_lobby_list_request</h1>
<p> Starts loading the list of lobbies matching the current filters.
This is an asynchronous function that will trigger the <a href="https://manual-en.yoyogames.com/The_Asset_Editors/Object_Properties/Async_Events/Steam.htm">Steam Async Event</a> when the task is finished.</p>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="information_source" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2139.png"></g-emoji> NOTE</strong></p>
<p>Filters are reset afterwards and have to be set again for subsequent request(s).</p>
</blockquote>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="information_source" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2139.png"></g-emoji> NOTE</strong></p>
<p>Existing results are kept up until the event is dispatched.</p>
</blockquote>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_lobby_list_request()</pre><p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">N/A</pre><p><br></p>
<p><strong>Triggers:</strong></p>
<pre class="hljs">Asynchronous Steam Event</pre><table>
<thead>
<tr>
<th>Key</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>event_type</td>
<td>string</td>
<td>The string value <code>&quot;lobby_list&quot;</code></td>
</tr>
<tr>
<td>lobby_count</td>
<td>int64</td>
<td>The number of lobbies in retrieved (same as <a href="#steam_lobby_list_get_count">steam_lobby_list_get_count</a>)</td>
</tr>
<tr>
<td>success</td>
<td>bool</td>
<td>Whether or not the task was successful</td>
</tr>
<tr>
<td>result</td>
<td>real</td>
<td>The code of the result</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs">steam_lobby_list_add_distance_filter(steam_lobby_list_distance_filter_far);
steam_lobby_list_add_near_filter(<span class="hljs-string">&quot;myNearFilter&quot;</span>, <span class="hljs-number">77</span>);
steam_lobby_list_add_numerical_filter(<span class="hljs-string">&quot;level&quot;</span>, <span class="hljs-number">10</span>, steam_lobby_list_filter_gt);
steam_lobby_list_add_string_filter(<span class="hljs-string">&quot;Stage&quot;</span>,<span class="hljs-string">&quot;BattleZone&quot;</span>, steam_lobby_list_filter_eq)
steam_lobby_list_request();</pre><p> In this extended example we will request the lobby list that matches the requested filter criteria and parse its results in the <a href="https://manual-en.yoyogames.com/The_Asset_Editors/Object_Properties/Async_Events/Steam.htm">Steam Async Event</a>. to start with we need to request the lobbies with the code above. And afterwards proceed to catch the results <strong>after/during</strong> the corresponding asynchronous event:</p>
<pre class="hljs"><span class="hljs-keyword">var</span> type = <span class="hljs-built_in">ds_map_find_value</span>(<span class="hljs-symbol">async_load</span>, <span class="hljs-string">&quot;event_type&quot;</span>);
<span class="hljs-keyword">if</span> (type == <span class="hljs-string">&quot;lobby_list&quot;</span>)
{
<span class="hljs-keyword">var</span> lb_count = steam_lobby_list_get_count();
<span class="hljs-keyword">for</span> (<span class="hljs-keyword">var</span> i = <span class="hljs-number">0</span>; i &lt; lb_count; i++)
{
<span class="hljs-keyword">var</span> lb_ID = steam_lobby_list_get_lobby_id(i);
<span class="hljs-keyword">var</span> lb_owner = steam_lobby_list_get_lobby_owner_id(i);
<span class="hljs-keyword">var</span> lb_members_count = steam_lobby_list_get_lobby_member_count(i);
<span class="hljs-keyword">for</span> (<span class="hljs-keyword">var</span> j = <span class="hljs-number">0</span>; j &lt; lb_members_count; j++)
{
<span class="hljs-keyword">var</span> lb_member_ID = steam_lobby_list_get_lobby_member_id(i, j);
<span class="hljs-comment">// Do what even you need with the queried information</span>
}
}
}</pre><p> This code will loop through all the loobies and respective members on the query result.</p>
<p><br><br></p>
<hr>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="lobbyfiltercomparisontype">LobbyFilterComparisonType</h1>
<p> These constants specify the comparison type when applying a filter to a lobby list request by calling the following functions:</p>
<ul>
<li><a href="#steam_lobby_list_add_numerical_filter">steam_lobby_list_add_numerical_filter</a></li>
<li><a href="#steam_lobby_list_add_string_filter">steam_lobby_list_add_string_filter</a></li>
</ul>
<table>
<thead>
<tr>
<th>Lobby Filter Comparison Type Constant</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>steam_lobby_list_filter_eq</code></td>
<td>Equal (==).</td>
</tr>
<tr>
<td><code>steam_lobby_list_filter_ne</code></td>
<td>Not-equal (!=)</td>
</tr>
<tr>
<td><code>steam_lobby_list_filter_lt</code></td>
<td>Less-than (&lt;), only applies to <a href="#steam_lobby_list_add_numerical_filter">steam_lobby_list_add_numerical_filter</a></td>
</tr>
<tr>
<td><code>steam_lobby_list_filter_gt</code></td>
<td>Greater-than (&gt;), only applies to <a href="#steam_lobby_list_add_numerical_filter">steam_lobby_list_add_numerical_filter</a></td>
</tr>
<tr>
<td><code>steam_lobby_list_filter_le</code></td>
<td>Less-than-or-equal (&lt;=), only applies to <a href="#steam_lobby_list_add_numerical_filter">steam_lobby_list_add_numerical_filter</a></td>
</tr>
<tr>
<td><code>steam_lobby_list_filter_ge</code></td>
<td>Greater-than-or-equal (&gt;=), only applies to <a href="#steam_lobby_list_add_numerical_filter">steam_lobby_list_add_numerical_filter</a></td>
</tr>
</tbody>
</table>
<p><br><br></p>
<hr>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="lobbyfilterdistancemode">LobbyFilterDistanceMode</h1>
<p> These constants specify the distance mode to be used when applying a filter to a lobby list request by calling the <a href="#steam_lobby_list_add_distance_filter">steam_lobby_list_add_distance_filter</a> function.</p>
<table>
<thead>
<tr>
<th>Constant</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>steam_lobby_list_distance_filter_close</code></td>
<td>Only allows lobbies in same immediate region</td>
</tr>
<tr>
<td><code>steam_lobby_list_distance_filter_default</code></td>
<td>Allows lobbies in same or nearby regions (same continent)</td>
</tr>
<tr>
<td><code>steam_lobby_list_distance_filter_far</code></td>
<td>Allows lobbies from up to half-way around the globe (nearby continents)</td>
</tr>
<tr>
<td><code>steam_lobby_list_distance_filter_worldwide</code></td>
<td>Allows any lobbies. May result in very high latencies, so use with care</td>
</tr>
</tbody>
</table>
<p><br><br></p>
<hr>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="lobbytype">LobbyType</h1>
<p> These constants specify the type of lobby should be used creating a new lobby using the <a href="#steam_lobby_create">steam_lobby_create</a> function.</p>
<table>
<thead>
<tr>
<th>Lobby Type Constant</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>steam_lobby_type_private</code></td>
<td>The lobby can only be joined by invitation</td>
</tr>
<tr>
<td><code>steam_lobby_type_friends_only</code></td>
<td>The lobby can be joined by invitation or via friends-list (by opening the user&#39;s menu and picking &quot;Join game&quot;)</td>
</tr>
<tr>
<td><code>steam_lobby_type_public</code></td>
<td>The lobby can be joined by invitation, via friends-list and shows up in the public list (see matchmaking functions)</td>
</tr>
</tbody>
</table>
<p><br><br></p>
<hr>
<p class="page" id="Stats-and-Achievements"></p><h1>Achievements</h1>
<p><a id="top"></a>
<a id="top"></a>
<!--<div class="body-scroll" style="top: 150px;">--></p>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="stats-and-achievements">Stats and Achievements</h1>
<p> The Steam Stats and Achievements API provides an easy way for your game to provide persistent, roaming achievement and statistics tracking for your users. The user&#39;s data is associated with their Steam account, and each user&#39;s achievements and statistics can be formatted and displayed in their Steam Community Profile.</p>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="information_source" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2139.png"></g-emoji> NOTE</strong></p>
<p>You must wait until <a href="#steam_stats_ready">steam_stats_ready</a> has returned true, before attempting to read or write stats and achievements.</p>
</blockquote>
<h2 id="achievements">Achievements</h2>
<p> In addition to providing highly-valued rewards to players of your games, achievements are useful for encouraging and rewarding teamwork and player interaction, providing extra dimensionality to the game objectives, and rewarding users for spending more of their time in-game, and as such it is recommended that your game has a few. They are easily set up from the Steam Dashboard, but will require that you create special Icons for them.
The following functions are provided for working with achievements:</p>
<ul>
<li><a href="#steam_set_achievement">steam_set_achievement</a></li>
<li><a href="#steam_get_achievement">steam_get_achievement</a></li>
<li><a href="#steam_clear_achievement">steam_clear_achievement</a></li>
</ul>
<h2 id="statistics-functions">Statistics Functions</h2>
<p> Statistics track fine-grained pieces of information, such as play time, number of power-ups used, etc. You may choose to use them simply for tracking internal game data - so that, for instance, you can grant an achievement based on multi-session game-play statistics collected from the user across multiple computers. Or, you can track interesting game data for display on the user&#39;s Steam Community page, where users can compare their own stats against their friends.</p>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="information_source" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2139.png"></g-emoji> NOTE</strong></p>
<p>Previously to being used statistics must be initialized from the Steamworks control panel for your game.</p>
</blockquote>
<p> The following functions are provided for working with statistics:</p>
<ul>
<li><a href="#steam_set_stat_int">steam_set_stat_int</a></li>
<li><a href="#steam_set_stat_float">steam_set_stat_float</a></li>
<li><a href="#steam_set_stat_avg_rate">steam_set_stat_avg_rate</a></li>
<li><a href="#steam_get_stat_int">steam_get_stat_int</a></li>
<li><a href="#steam_get_stat_float">steam_get_stat_float</a></li>
<li><a href="#steam_get_stat_avg_rate">steam_get_stat_avg_rate</a></li>
</ul>
<h2 id="debug-functions">Debug Functions</h2>
<p> The following functions are provided for debugging purposes and are not recommended in the production version of you game:</p>
<ul>
<li><a href="#steam_reset_all_stats">steam_reset_all_stats</a></li>
<li><p><a href="#steam_reset_all_stats_achievements">steam_reset_all_stats_achievements</a></p>
<p>If the user is in Offline Mode, Steam keeps a local cache of the stats and achievement data so that the APIs can be use as normal. Any stats unable to be committed are saved for the next time the user is online. In the event that there have been modifications on more than one machine, Steam will automatically merge achievements and choose the set of stats that has had more progress. Because Steam keeps a local cache of stats data it is not necessary for the game to <i>also</i> keep a local cache of the data on disk, especially as such caches often come in conflict and when they do it looks to a users as if their progress has been reverted, which is a frustrating experience.</p>
<!-- KEYWORDS
Steam Achievements
Steam Statistics
-->
<!-- TAGS
achievement_stat_functions
-->
</li>
</ul>
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_set_achievement">steam_set_achievement</h1>
<p> With this function you can tell the Steam API to award (&quot;set&quot;) an achievement for the player. These achievements should have been defined on the Steamworks control panel accounts page for your game and the string that is passed to the function should match that used as the API Name on the control panel. The Steam Game Overlay will display a notification panel to the user informing them of the achievement that they have received, unless the achievement has already been awarded, in which case nothing will happen.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs"><span class="hljs-built_in">steam_set_achievement</span>(ach_name);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>ach_name</td>
<td>string</td>
<td>The name of the achievement to set.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">N/A</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">if</span> hp &lt;= <span class="hljs-number">0</span>
{
<span class="hljs-literal">global</span>.Deaths += <span class="hljs-number">1</span>;
<span class="hljs-keyword">if</span> <span class="hljs-literal">global</span>.Deaths == <span class="hljs-number">10</span>
{
<span class="hljs-keyword">if</span> !<span class="hljs-built_in">steam_get_achievement</span>(<span class="hljs-string">&quot;ach_Player_Dies_Ten_Times&quot;</span>) <span class="hljs-built_in">steam_set_achievement</span>(<span class="hljs-string">&quot;ach_Player_Dies_Ten_Times&quot;</span>);
}
}</pre><p> The above code will reward the player an achievement if the global variable &quot;Deaths&quot; is equal to 10 and if the achievement has not already been awarded.<br></p>
<!-- KEYWORDS
steam_set_achievement
-->
<!-- TAGS
steam_set_achievement
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_get_achievement">steam_get_achievement</h1>
<p> With this function you can check the Steam API to see if a specific achievement has been awarded. The achievement should have been previously defined on the Steamworks control panel accounts page for your game and the string that is passed to the function should match that used as the API Name on the control panel.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs"><span class="hljs-built_in">steam_get_achievement</span>(ach_name);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>ach_name</td>
<td>string</td>
<td>The name of the achievement to get.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Bool</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">if</span> hp &lt;= <span class="hljs-number">0</span>
{
<span class="hljs-literal">global</span>.Deaths += <span class="hljs-number">1</span>;
<span class="hljs-keyword">if</span> <span class="hljs-literal">global</span>.Deaths == <span class="hljs-number">10</span>
{
<span class="hljs-keyword">if</span> !<span class="hljs-built_in">steam_get_achievement</span>(<span class="hljs-string">&quot;ach_Player_Dies_Ten_Times&quot;</span>) <span class="hljs-built_in">steam_set_achievement</span>(<span class="hljs-string">&quot;ach_Player_Dies_Ten_Times&quot;</span>);
}
}</pre><p> The above code will reward the player an achievement if the global variable &quot;Deaths&quot; is equal to 10 and if the achievement has not already been awarded.</p>
<!-- KEYWORDS
steam_get_achievement
-->
<!-- TAGS
steam_get_achievement
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_clear_achievement">steam_clear_achievement</h1>
<p> With this function you can tell the Steam API to clear (reset) a specific achievement. The achievement should have been previously defined on the Steamworks control panel accounts page for your game and the string that is passed to the function should match that used as the API Name on the control panel.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs"><span class="hljs-built_in">steam_clear_achievement</span>(ach_name);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>ach_name</td>
<td>string</td>
<td>The name of the achievement to clear.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">N/A</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">if</span> <span class="hljs-built_in">mouse_check_button_pressed</span>(<span class="hljs-literal">mb_left</span>)
{
<span class="hljs-built_in">steam_clear_achievement</span>(<span class="hljs-string">&quot;Ach_Game_Win&quot;</span>);
<span class="hljs-built_in">steam_clear_achievement</span>(<span class="hljs-string">&quot;Ach_Died_10_Times&quot;</span>);
<span class="hljs-built_in">steam_clear_achievement</span>(<span class="hljs-string">&quot;Ach_Killed_100_Enemies&quot;</span>);
<span class="hljs-built_in">steam_clear_achievement</span>(<span class="hljs-string">&quot;Ach_Beat_Boss_Level_1&quot;</span>);
}</pre><p> The above code will reset the achievements of the game when the user clicks the left mouse button.</p>
<p> <br></p>
<!-- KEYWORDS
steam_clear_achievement
-->
<!-- TAGS
steam_clear_achievement
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_set_stat_int">steam_set_stat_int</h1>
<p> With this function you can set a specific statistic to a new, signed integer, value. The statistic should have been previously defined on the Steamworks control panel accounts page for your game and the string that is passed to the function should match that used as the API Name on the control panel. Examples of when you could use this are for tracking how many times the player dies or for tracking progress towards an achievement.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs"><span class="hljs-built_in">steam_set_stat_int</span>(stat_name, value);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>stat_name</td>
<td>string</td>
<td>The name of the statistic to set.</td>
</tr>
<tr>
<td>value</td>
<td>integer</td>
<td>The value to set the stat to.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">N/A</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs">xp += <span class="hljs-number">100</span>;
<span class="hljs-built_in">steam_set_stat_int</span>(<span class="hljs-string">&quot;Total_XP&quot;</span>, <span class="hljs-built_in">steam_get_stat_int</span>(<span class="hljs-string">&quot;Total_XP&quot;</span>) + <span class="hljs-number">100</span>);
<span class="hljs-keyword">if</span> <span class="hljs-built_in">steam_get_stat_int</span>(<span class="hljs-string">&quot;Total_XP&quot;</span>) &gt; <span class="hljs-number">1000</span>
{
<span class="hljs-keyword">if</span> !<span class="hljs-built_in">steam_get_achievement</span>(<span class="hljs-string">&quot;Ach_1000XP&quot;</span>) <span class="hljs-built_in">steam_set_achievement</span>(<span class="hljs-string">&quot;Ach_1000XP&quot;</span>);
}</pre><p> The above code sets a statistic and then checks the final value for it to decide whether to award an achievement or not.</p>
<!-- KEYWORDS
steam_set_stat_int
-->
<!-- TAGS
steam_set_stat_int
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_set_stat_float">steam_set_stat_float</h1>
<p> With this function you can set a specific statistic to a new, floating point, value. The statistic should have been previously defined on the Steamworks control panel accounts page for your game and the string that is passed to the function should match that used as the API Name on the control panel. Examples of when you could use this are for tracking how far your player has travelled, or what percentage of the game is complete.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs"><span class="hljs-built_in">steam_set_stat_float</span>(stat_name, value);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>stat_name</td>
<td>string</td>
<td>The name of the statistic to set.</td>
</tr>
<tr>
<td>value</td>
<td>real</td>
<td>The value to set the stat to.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">N/A</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">var</span> dist_pc = (dist / dist_max) * <span class="hljs-number">100</span>;
<span class="hljs-built_in">steam_set_stat_float</span>(<span class="hljs-string">&quot;Travelled&quot;</span>, dist_pc);</pre><p> The above code calculates a percentage based on the distance travelled variable &quot;dist&quot; and the maximum distance you can travel &quot;dist_max&quot; and then sets the stat &quot;Travelled&quot; to the new value.</p>
<!-- KEYWORDS
steam_set_stat_float
-->
<!-- TAGS
steam_set_stat_float
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_set_stat_avg_rate">steam_set_stat_avg_rate</h1>
<p> This function permits you to set an average statistic type with a &quot;sliding window&quot; effect on the average. The &quot;session_count&quot; value is the current value that you wish to average out, while the &quot;session_length&quot; is the amount of game time since the last call to the function. Please see the extended Example below for further details on how this can be used.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs"><span class="hljs-built_in">steam_set_stat_avg_rate</span>(stat_name, session_count, session_length);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>stat_name</td>
<td>string</td>
<td>The name of the statistic to set.</td>
</tr>
<tr>
<td>session_count</td>
<td>real</td>
<td>The value to get the average of.</td>
</tr>
<tr>
<td>session_length</td>
<td>real</td>
<td>The time that has been taken since the last time the stat was set.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">N/A</pre><p><br></p>
<p><strong>Extended Example:</strong></p>
<p> Since the average stat function can be complex to understand, we will illustrate its use with the following example. Consider the case where you&#39;d like to track an average statistic, such as &quot;Points earned per hour&quot;. One approach would be to have two stats: an <i>integer</i> stat, &quot;TotalPoints&quot;, and a <i>float</i> stat &quot;TotalPlayTimeHours&quot;, and then divide the total points by the total time to get the &quot;Points per Hour&quot; value.
However, once the player has accumulated a significant amount of playtime, the calculated average will change extremely slowly, and the more the user plays the game, the less responsive that average will be. If the user has spent 100 hours playing the game, the calculated average will &quot;lag&quot; by about 50 hours of that, and if they increase their skill, they will not see the increase in &quot;Points Per Hour&quot; that they expect. To get around that we can use a &quot;sliding window&quot; to only calculate the &quot;Points per hour&quot; for the last 10 hours played.
So, to use this function, we would need to create a Steam stat (in the control panel for the game on the Workshop) called &quot;AvgPointsPerHour&quot; and set its Window property to 10. Now in your game you would have to add some global variables into an instance at the start:</p>
<pre class="hljs"><span class="hljs-literal">global</span>.Points = <span class="hljs-number">0</span>;
<span class="hljs-literal">global</span>.Time = <span class="hljs-number">0</span>;</pre><p> You would then have some controller object to count up the global &quot;Time&quot; variable in an alarm (for example) every second, while your game-play would affect the global &quot;Points&quot; variable. At regular intervals while playing (again, in a controller object, perhaps in an Alarm, or at intervals from polling the &quot;Time&quot; value) you would set the stat like this:</p>
<pre class="hljs"><span class="hljs-built_in">steam_set_stat_avg_rate</span>(<span class="hljs-string">&quot;AvgPointsPerHour&quot;</span>, <span class="hljs-literal">global</span>.Points, (<span class="hljs-literal">global</span>.Time / <span class="hljs-number">3600</span>));
<span class="hljs-literal">global</span>.Points = <span class="hljs-number">0</span>;
<span class="hljs-literal">global</span>.Time = <span class="hljs-number">0</span>;</pre><p> Note that we divide time by 3600 since we want the time in <i>hours</i> and not in seconds, and afterward we reset the global &quot;Points&quot; variable and the global &quot;Time&quot; variable to 0 so that the next time the function is called, we get a new average for the statistic. Now, what Steam will do is take this value that you have sent and create an average value over the time that was set for our &quot;window&quot;.</p>
<!-- KEYWORDS
steam_set_avg_rate
-->
<!-- TAGS
steam_set_avg_rate
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_get_stat_int">steam_get_stat_int</h1>
<p> With this function you can get the value of a specific signed integer statistic. The statistic should have been previously defined on the Steamworks control panel accounts page for your game and the string that is passed to the function should match that used as the API Name on the control panel.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs"><span class="hljs-built_in">steam_get_stat_int</span>(stat_name);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>stat_name</td>
<td>string</td>
<td>The name of the statistic to get.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Real</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs">xp += <span class="hljs-number">100</span>;
<span class="hljs-built_in">steam_set_stat_int</span>(<span class="hljs-string">&quot;Total_XP&quot;</span>, <span class="hljs-built_in">steam_get_stat_int</span>(<span class="hljs-string">&quot;Total_XP&quot;</span>) + <span class="hljs-number">100</span>);
<span class="hljs-keyword">if</span> <span class="hljs-built_in">steam_get_stat_int</span>(<span class="hljs-string">&quot;Total_XP&quot;</span>) &gt; <span class="hljs-number">1000</span>
{
<span class="hljs-keyword">if</span> !<span class="hljs-built_in">steam_get_achievement</span>(<span class="hljs-string">&quot;Ach_1000XP&quot;</span>) <span class="hljs-built_in">steam_set_achievement</span>(<span class="hljs-string">&quot;Ach_1000XP&quot;</span>);
}</pre><p> The above code sets a statistic and then checks the final value for it to decide whether to award an achievement or not.</p>
<!-- KEYWORDS
steam_get_stat_int
-->
<!-- TAGS
steam_get_stat_int
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_get_stat_float">steam_get_stat_float</h1>
<p> With this function you can get the value of a specific floating point statistic. The statistic should have been previously defined on the Steamworks control panel accounts page for your game and the string that is passed to the function should match that used as the API Name on the control panel.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs"><span class="hljs-built_in">steam_get_stat_float</span>(stat_name);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>stat_name</td>
<td>string</td>
<td>The name of the statistic to get.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Real</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">var</span> dist_pc = (dist / dist_max) * <span class="hljs-number">100</span>;
<span class="hljs-keyword">if</span> <span class="hljs-built_in">steam_get_stat_float</span>(<span class="hljs-string">&quot;Travelled&quot;</span>) &lt; dist_pc
{
<span class="hljs-built_in">steam_set_stat_int</span>(<span class="hljs-string">&quot;Travelled&quot;</span>, dist_pc);
}</pre><p> The above code calculates a percentage based on the distance travelled variable &quot;dist&quot; and the maximum distance you can travel &quot;dist_max&quot;. It then polls the current value for the statistic &quot;Travelled&quot; and if it is less than the calculated value, it sets the stat again.</p>
<!-- KEYWORDS
steam_get_stat_float
-->
<!-- TAGS
steam_get_stat_float
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_get_stat_avg_rate">steam_get_stat_avg_rate</h1>
<p> With this function you can get the value of a specific average statistic. The statistic should have been previously defined on the Steamworks control panel accounts page for your game and the string that is passed to the function should match that used as the API Name on the control panel.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs"><span class="hljs-built_in">steam_get_stat_avg_rate</span>(stat_name);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>stat_name</td>
<td>string</td>
<td>The name of the statistic to get.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Real</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">var</span> avg = <span class="hljs-built_in">steam_get_stat_avg_rate</span>(<span class="hljs-string">&quot;PointsPerHour&quot;</span>);
<span class="hljs-built_in">draw_text</span>(<span class="hljs-number">8</span>, <span class="hljs-number">8</span>, <span class="hljs-string">&quot;PPH = &quot;</span> + <span class="hljs-built_in">string</span>(avg);</pre><p> The above code gets the current value for the average statistic &quot;PointsPerHour&quot; and draws it on the screen.</p>
<!-- KEYWORDS
steam_get_stat_avg_rate
-->
<!-- TAGS
steam_get_stat_avg_rate
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_reset_all_stats">steam_reset_all_stats</h1>
<p> With this function you can reset all the statistics for the <strong>current user</strong> to their default values (as defined in the Steamworks control panel for your game). If need to also reset the achievement to their default values use the <a href="#steam_reset_all_stats_achievements">steam_reset_all_stats_achievements</a> instead.</p>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="information_source" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2139.png"></g-emoji> TIP</strong></p>
<p>It is recommended that you only use this function as a debug tool when developing your game.</p>
</blockquote>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs"><span class="hljs-built_in">steam_reset_all_stats</span>();</pre><p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">N/A</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-built_in">ini_open</span>(<span class="hljs-string">&quot;Save.ini&quot;</span>);
<span class="hljs-keyword">if</span> <span class="hljs-literal">global</span>.Version != <span class="hljs-built_in">ini_read_real</span>(<span class="hljs-string">&quot;Data&quot;</span>, <span class="hljs-string">&quot;Version&quot;</span>, <span class="hljs-number">0</span>)
{
<span class="hljs-built_in">ini_write_real</span>(<span class="hljs-string">&quot;Data&quot;</span>, <span class="hljs-string">&quot;Version&quot;</span>, <span class="hljs-literal">global</span>.Version);
<span class="hljs-built_in">steam_reset_all_stats</span>();
}
<span class="hljs-built_in">ini_close</span>();</pre><p> The above code checks a stored value in an ini file against that of a global variable and if they are different, it resets the statistics for the game.</p>
<!-- KEYWORDS
steam_reset_all_stats
-->
<!-- TAGS
steam_reset_all_stats
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_reset_all_stats_achievements">steam_reset_all_stats_achievements</h1>
<p> With this function you can reset all the statistics <em>and</em> achievements for the <strong>current user</strong> to their default values (as defined in the Steamworks control panel for your game). If you only need to reset the stats to their default values use the <a href="#steam_reset_all_stats">steam_reset_all_stats</a> instead.</p>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="information_source" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2139.png"></g-emoji> TIP</strong></p>
<p>It is recommended that you only use this function as a debug tool when developing your game.</p>
</blockquote>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs"><span class="hljs-built_in">steam_reset_all_stats_achievements</span>();</pre><p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">N/A</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-built_in">ini_open</span>(<span class="hljs-string">&quot;Save.ini&quot;</span>);
<span class="hljs-keyword">if</span> <span class="hljs-literal">global</span>.Version != <span class="hljs-built_in">ini_read_real</span>(<span class="hljs-string">&quot;Data&quot;</span>, <span class="hljs-string">&quot;Version&quot;</span>, <span class="hljs-number">0</span>)
{
<span class="hljs-built_in">ini_write_real</span>(<span class="hljs-string">&quot;Data&quot;</span>, <span class="hljs-string">&quot;Version&quot;</span>, <span class="hljs-literal">global</span>.Version);
<span class="hljs-built_in">steam_reset_all_stats_achievements</span>();
}
<span class="hljs-built_in">ini_close</span>();</pre><p> The above code checks a stored value in an ini file against that of a global variable and if they are different, it resets the statistics and achievements for the game.</p>
<!-- KEYWORDS
steam_reset_all_stats_achievements
-->
<!-- TAGS
steam_reset_all_stats_achievements
-->
<p><br><br></p>
<hr>
<p class="page" id="Cloud"></p><h1>Cloud</h1>
<p><a id="top"></a>
<a id="top"></a>
<!--<div class="body-scroll" style="top: 150px;">--></p>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="cloud">Cloud</h1>
<p> The Steam Cloud provides an easy and transparent remote file storage system for your game. All files written to disk using the cloud functions will be replicated to the Steam servers after the game exits. If the user then changes computers, the files will then be downloaded to the new computer before the game launches, meaning that the game can then access the files by reading them using the appropriate Steam functions. The Steam Client does the work of ensuring that the files are kept synchronized across all computers the user may be accessing.</p>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="information_source" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2139.png"></g-emoji> NOTE</strong></p>
<p>By default, the Cloud is not enabled for a game on Steamworks. it must be enabled previously from the &#39;Cloud&#39; tab of the Steamworks game admin, where you should set the byte and file quota. The next time you publish your games Steamworks configuration, the Cloud storage will be ready to use.</p>
</blockquote>
<p> The following functions can be used to access the Steam Cloud from within GameMaker Studio 2</p>
<ul>
<li><a href="#steam_is_cloud_enabled_for_app">steam_is_cloud_enabled_for_app</a></li>
<li><a href="#steam_is_cloud_enabled_for_account">steam_is_cloud_enabled_for_account</a></li>
<li><a href="#steam_get_quota_total">steam_get_quota_total</a></li>
<li><a href="#steam_get_quota_free">steam_get_quota_free</a></li>
<li><a href="#steam_file_exists">steam_file_exists</a></li>
<li><a href="#steam_file_size">steam_file_size</a></li>
<li><a href="#steam_file_persisted">steam_file_persisted</a></li>
<li><a href="#steam_file_write">steam_file_write</a></li>
<li><a href="#steam_file_write_file">steam_file_write_file</a></li>
<li><a href="#steam_file_read">steam_file_read</a></li>
<li><a href="#steam_file_share">steam_file_share</a></li>
<li><p><a href="#steam_file_delete">steam_file_delete</a></p>
<!-- KEYWORDS
Steam Cloud
-->
<!-- TAGS
cloud_functions
-->
</li>
</ul>
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_is_cloud_enabled_for_app">steam_is_cloud_enabled_for_app</h1>
<p> With this function you can check to make sure that the Steam Cloud service is enabled for your game. It will return true if it is and false otherwise.</p>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="warning" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/26a0.png">⚠️</g-emoji> IMPORTANT</strong></p>
<p>This does not automatically mean that you can use the Cloud functions as the user can switch off Cloud synchronization from their Steam Client. You can check this using the function <a href="#steam_is_cloud_enabled_for_account">steam_is_cloud_enabled_for_account</a>, but, even if it is disabled for the user (and enabled for the game), the functions will still work to store and retrieve data from a local copy of all files, it will just not upload them to the cloud on the game end, nor synchronize on the game start.</p>
</blockquote>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs"><span class="hljs-built_in">steam_is_cloud_enabled_for_app</span>();</pre><p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Bool</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">if</span> (<span class="hljs-built_in">steam_is_cloud_enabled_for_app</span>())
{
quota = <span class="hljs-built_in">steam_get_quota_total</span>();
}</pre><p> The above code checks to see if the steam cloud is enabled for the game and if so it gets the size of the storage quota and stores it in a variable.</p>
<!-- KEYWORDS
steam_is_cloud_enabled_for_app
-->
<!-- TAGS
steam_is_cloud_enabled_for_app
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_is_cloud_enabled_for_account">steam_is_cloud_enabled_for_account</h1>
<p> With this function you can check to make sure that the Steam Cloud service is enabled by the user in their Steam Client settings. It will return true if it is and false otherwise.</p>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="warning" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/26a0.png">⚠️</g-emoji> IMPORTANT</strong></p>
<p>This does not automatically mean that you can store data to the Cloud, as it will also have to have been enabled for your game (you can check this using the function <a href="#steam_is_cloud_enabled_for_app">steam_is_cloud_enabled_for_app</a>). If the Steam Cloud is enabled for your game, but the user has it switched off locally, you can still use the Cloud functions to store and retrieve data from a local copy of all files, it will just not upload them to the cloud on the game end, nor synchronize on the game start.</p>
</blockquote>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs"><span class="hljs-built_in">steam_is_cloud_enabled_for_account</span>();</pre><p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Bool</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">if</span> (<span class="hljs-built_in">steam_is_cloud_enabled_for_account</span>())
{
<span class="hljs-built_in">steam_file_share</span>(<span class="hljs-string">&quot;Save.txt&quot;</span>);
}</pre><p> The above code checks to see if the user has the Steam Cloud enabled and if it returns true, it will then synchronize the given file.</p>
<!-- KEYWORDS
steam_is_cloud_enabled_for_account
-->
<!-- TAGS
steam_is_cloud_enabled_for_account
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_get_quota_total">steam_get_quota_total</h1>
<p> When using the Steam Cloud to store and synchronize files, you must set up the <i>quota</i> of space that your game will need. This quota is enforced on each Cloud-enabled game, on a per-user-per-game basis, so, for example, if the quota for Game X is 1 megabyte, then each Steam account that owns Game X may store, at most, 1 megabyte of data associated with that game in the Cloud. Any other Cloud-enabled games that the user owns (say, Game Y) will not be affected by the data stored by Game X. The default quota for new Steamworks games is one gigabyte, but you can change this from the Steamworks control panel for your game.</p>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="information_source" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2139.png"></g-emoji> NOTE</strong></p>
<p>Once the quota is exhausted file writes will fail. If you think it may be possible for the quota to be exhausted for the user of your game, you should create code to handle it, as by doing nothing you leave users in a situation where they are unable to fix things and that will lead to a poor experience of your game.</p>
</blockquote>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs"><span class="hljs-built_in">steam_get_quota_total</span>();</pre><p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Real</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">if</span> (<span class="hljs-built_in">steam_is_cloud_enabled_for_app</span>())
{
quota = <span class="hljs-built_in">steam_get_quota_total</span>();
}</pre><p> The above code checks to see if the steam cloud is enabled for the game and if so it gets the size of the storage quota and stores it in a variable.</p>
<!-- KEYWORDS
steam_get_quota_total
-->
<!-- TAGS
steam_get_quota_total
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_get_quota_free">steam_get_quota_free</h1>
<p> With this function you can find out how much free space is left for the user of the Steam Cloud quota. The value returned is in <i>bytes</i>.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs"><span class="hljs-built_in">steam_get_quota_free</span>();</pre><p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Real</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">if</span> (<span class="hljs-built_in">steam_is_cloud_enabled_for_app</span>())
{
quota = <span class="hljs-built_in">steam_get_quota_free</span>();
}</pre><p> The above code checks to see if the steam cloud is enabled for the game and if so it gets the size of the free storage space and stores it in a variable.</p>
<!-- KEYWORDS
steam_get_quota_free
-->
<!-- TAGS
steam_get_quota_free
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_file_exists">steam_file_exists</h1>
<p> With this function you can check to see if a file from the Steam Cloud exists or not, with a return value of true if it exists, or false otherwise.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs"><span class="hljs-built_in">steam_file_exists</span>(filename);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>filename</td>
<td>string</td>
<td>The name of the file to check for.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Bool</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">if</span> (<span class="hljs-built_in">steam_file_exists</span>(<span class="hljs-string">&quot;Save.txt&quot;</span>))
{
save_str = <span class="hljs-built_in">steam_file_read</span>(<span class="hljs-string">&quot;Save.txt&quot;</span>);
}</pre><p> The above code checks to see if a file exists on the Steam Cloud and if it does, it opens it and reads its contents into the variable &quot;save_str&quot;.</p>
<!-- KEYWORDS
steam_file_exists
-->
<!-- TAGS
steam_file_exists
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_file_size">steam_file_size</h1>
<p> With this function you can check the size of a file stored on the Steam Cloud. The returned real number is the size, in bytes, of the file.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs"><span class="hljs-built_in">steam_file_size</span>(filename);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>filename</td>
<td>string</td>
<td>The name of the file to check the size of.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Real</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs">file_bytes = <span class="hljs-built_in">steam_file_size</span>(<span class="hljs-string">&quot;Save.txt&quot;</span>);</pre><p> The above code stores the size of a file from the Steam Cloud in the variable &quot;file_bytes&quot;.</p>
<!-- KEYWORDS
steam_file_size
-->
<!-- TAGS
steam_file_size
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_file_persisted">steam_file_persisted</h1>
<p> With this function you can check the given file to see if it has been synchronized with the Steam Cloud. A return value of true means that it is, while false means it is not.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs"><span class="hljs-built_in">steam_file_persisted</span>(filename);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>filename</td>
<td>string</td>
<td>The name of the file to check.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Bool</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">if</span> (!<span class="hljs-built_in">steam_file_persisted</span>(<span class="hljs-string">&quot;Save.txt&quot;</span>))
{
<span class="hljs-built_in">steam_file_share</span>(<span class="hljs-string">&quot;Save.txt&quot;</span>);
}</pre><p> The above code will check to see if a file has been stored to the Steam Cloud, and if it has not it will then synchronize it.</p>
<!-- KEYWORDS
steam_file_persisted
-->
<!-- TAGS
steam_file_persisted
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_file_write">steam_file_write</h1>
<p> You can use this function to write data to a file, which will then be synchronized with the Steam Cloud when the user exits the game. if the file does not exist, this function will create it for you, and if it does already exists, it will overwrite any data that is already stored within the file with the new data string. The function will return a value of 0 if it fails for whatever reason and a value greater than 0 if it succeeds.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs"><span class="hljs-built_in">steam_file_write</span>(filename, data, size);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>filename</td>
<td>string</td>
<td>The name of the file to write to.</td>
</tr>
<tr>
<td>data</td>
<td>string</td>
<td>The data to write (a string).</td>
</tr>
<tr>
<td>size</td>
<td>integer</td>
<td>the size of the data to be written.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Real</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">var</span> fname = <span class="hljs-string">&quot;SaveData.txt&quot;</span>;
<span class="hljs-keyword">var</span> data = <span class="hljs-built_in">string</span>(<span class="hljs-literal">global</span>.Level) + <span class="hljs-string">&quot;|&quot;</span> + <span class="hljs-built_in">string</span>(<span class="hljs-literal">global</span>.Points) + <span class="hljs-string">&quot;|&quot;</span> + <span class="hljs-built_in">string</span>(<span class="hljs-literal">global</span>.HP);
<span class="hljs-keyword">var</span> len = <span class="hljs-built_in">string_length</span>(data);
<span class="hljs-built_in">steam_file_write_file</span>(fname, data, len);</pre><p> The above code will prepare a number of local variables and then use them to write to (or create) a file which will then be synchronized with the Steam Cloud.</p>
<!-- KEYWORDS
steam_file_write
-->
<!-- TAGS
steam_file_write
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_file_write_file">steam_file_write_file</h1>
<p> With this function you can copy the contents of a locally saved file to a file that is synchronized with the Steam Cloud. The local file <i>must exist</i> before using this function, and it will return a value of 0 if it fails for whatever reason and a value greater than 0 if it succeeds.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs"><span class="hljs-built_in">steam_file_write_file</span>(steam_filename, local_filename);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>steam_filename</td>
<td>string</td>
<td>The Steam Cloud file to copy over.</td>
</tr>
<tr>
<td>local_filename</td>
<td>string</td>
<td>The local file to use to copy from.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs"><span class="hljs-built_in">real</span></pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-built_in">steam_file_write_file</span>(<span class="hljs-string">&quot;rm_koala.png&quot;</span>, <span class="hljs-string">&quot;Koala2.png&quot;</span>);</pre><p> The above code will copy the contents of the file &quot;Koala2.png&quot; to the Steam Cloud file &quot;rm_koala.png&quot;.</p>
<!-- KEYWORDS
steam_file_write_file
-->
<!-- TAGS
steam_file_write_file
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_file_read">steam_file_read</h1>
<p> This function will read the contents of the given file into a string which can later be parsed in your game.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs"><span class="hljs-built_in">steam_file_read</span>(filename);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>filename</td>
<td>string</td>
<td>The name of the file to read from.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">String</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">if</span> <span class="hljs-built_in">steam_file_exists</span>(<span class="hljs-string">&quot;Save.txt&quot;</span>)
{
save_str = <span class="hljs-built_in">steam_file_read</span>(<span class="hljs-string">&quot;Save.txt&quot;</span>);
}</pre><p> The above code checks to see if a file exists on the Steam Cloud and if it does, it opens it and reads its contents into the variable &quot;save_str&quot;.</p>
<!-- KEYWORDS
steam_file_read
-->
<!-- TAGS
steam_file_read
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_file_share">steam_file_share</h1>
<p> With this function you can force your game to synchronize the given file with the Steam Cloud. This is not normally necessary due to the fact that the game will synchronize automatically at the end of the player&#39;s session, nor is it recommended by Steam, but it can be useful to ensure sensitive information is synchronized immediately. The function will return a value of 0 if it fails for whatever reason and a value greater than 0 if it succeeds.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs"><span class="hljs-built_in">steam_file_share</span>(filename);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>filename</td>
<td>string</td>
<td>The name of the file synchronize.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Real</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">if</span> (!<span class="hljs-built_in">steam_file_persisted</span>(<span class="hljs-string">&quot;Save.txt&quot;</span>))
{
<span class="hljs-built_in">steam_file_share</span>(<span class="hljs-string">&quot;Save.txt&quot;</span>);
}</pre><p> The above code will check to see if a file has been stored to the Steam Cloud, and if it has not it will then synchronize it.</p>
<!-- KEYWORDS
steam_file_share
-->
<!-- TAGS
steam_file_share
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_file_delete">steam_file_delete</h1>
<p> This function will delete the given file from the Steam Cloud. The function will return a value of 0 if it fails for whatever reason and a value greater than 0 if it succeeds.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs"><span class="hljs-built_in">steam_file_delete</span>(filename);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>filename</td>
<td>string</td>
<td>The name of the file delete.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Real</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">if</span> (<span class="hljs-built_in">steam_file_exists</span>(<span class="hljs-string">&quot;Save.txt&quot;</span>))
{
<span class="hljs-built_in">steam_file_delete</span>(<span class="hljs-string">&quot;Save.txt&quot;</span>);
}</pre><p> The above code will check to see if a file exists, and if it does, it deletes the file from the Steam Cloud.</p>
<!-- KEYWORDS
steam_file_delete
-->
<!-- TAGS
steam_file_delete
-->
<p><br><br></p>
<hr>
<p class="page" id="DLC"></p><h1>DLC</h1>
<p><a id="top"></a>
<a id="top"></a>
<!--<div class="body-scroll" style="top: 150px;">--></p>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="dlc">DLC</h1>
<p> Steam supports both free and paid downloadable content (DLC), and in the Steam client, a game with downloadable content appears as a single application in the user&#39;s game list with the downloadable content viewable through the games properties dialog. Once owned, downloadable content is treated as an integral part of the game and Steam will automatically update the content when a patch is available and installs the content when the user installs the game.
Since this is all handled by the Steam servers and the configuration of any DLC is done through the Steamworks control panel, there are only a couple of functions necessary in GameMaker Studio 2 to check for this extra content:</p>
<ul>
<li><a href="#steam_user_owns_dlc">steam_user_owns_dlc</a></li>
<li><p><a href="#steam_user_installed_dlc">steam_user_installed_dlc</a></p>
<!-- KEYWORDS
Steam DLC
-->
<!-- TAGS
dlc_functions
-->
</li>
</ul>
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_user_owns_dlc">steam_user_owns_dlc</h1>
<p> If your game has DLC created for it, you can use this function to check whether the user has bought it before accessing any files associated with it. The function will return <code>true</code> (<code>1</code>) if the player owns the content, <code>false</code> (<code>0</code>) if they don&#39;t own it <em>or</em> the given DLC ID is invalid, or <code>-1</code> if they&#39;re not logged into Steam.</p>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="information_source" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2139.png"></g-emoji> NOTE</strong></p>
<p>Even if the user owns the DLC it doesn&#39;t mean that they have it installed in their local account, so you should additionally use the function <a href="#steam_user_installed_dlc">steam_user_installed_dlc</a> to make sure that it is before using it.</p>
</blockquote>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs"><span class="hljs-built_in">steam_user_owns_dlc</span>(dlc_id);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>dlc_id</td>
<td>int64</td>
<td>The unique identifier for the DLC to be checked.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Integer</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-literal">global</span>.Level_Max = <span class="hljs-number">100</span>;
<span class="hljs-keyword">if</span> <span class="hljs-built_in">steam_user_owns_dlc</span>(<span class="hljs-number">10354</span>)
{
<span class="hljs-keyword">if</span> <span class="hljs-built_in">steam_user_installed_dlc</span>(<span class="hljs-number">10354</span>)
{
<span class="hljs-literal">global</span>.Level_max = <span class="hljs-number">200</span>;
}
}</pre><p> The above code will check to see if the user has bought, and installed, the DLC with the id 10354, and if so set a global variable to a different value.</p>
<!-- KEYWORDS
steam_user_owns_dlc
-->
<!-- TAGS
steam_user_owns_dlc
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_user_installed_dlc">steam_user_installed_dlc</h1>
<p> If your game has DLC created for it, you can use this function to check and see whether the user has installed it before accessing any files associated with it. The function returns true if the player has the content installed, and false if the user does not, but note that the user must also own the DLC, so you should use the additional function of <a href="#steam_user_owns_dlc">steam_user_owns_dlc</a> to check that it is owned as well before using it.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs"><span class="hljs-built_in">steam_user_installed_dlc</span>(dlc_id);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>dlc_id</td>
<td>int64</td>
<td>The unique identifier for the DLC to be checked.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Bool</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-literal">global</span>.Level_Max = <span class="hljs-number">100</span>;
<span class="hljs-keyword">if</span> (<span class="hljs-built_in">steam_user_owns_dlc</span>(<span class="hljs-number">10354</span>))
{
<span class="hljs-keyword">if</span> (<span class="hljs-built_in">steam_user_installed_dlc</span>(<span class="hljs-number">10354</span>))
{
<span class="hljs-literal">global</span>.Level_max = <span class="hljs-number">200</span>;
}
}</pre><p> The above code will check to see if the user has bought, and installed, the DLC with the id 10354, and if so set a global variable to a different value.</p>
<!-- KEYWORDS
steam_user_installed_dlc
-->
<!-- TAGS
steam_user_installed_dlc
-->
<p><br><br></p>
<hr>
<p class="page" id="UGC"></p><h1>UGC</h1>
<p><a id="top"></a>
<a id="top"></a>
<!--<div class="body-scroll" style="top: 150px;">--></p>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="ugc">UGC</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>
<ul>
<li><a href="#steam_is_screenshot_requested">steam_is_screenshot_requested</a></li>
<li><p><a href="#steam_send_screenshot">steam_send_screenshot</a></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>
</li>
<li><p><a href="https://partner.steamgames.com/documentation/ugc#Tech">Sharing User Generated Content</a></p>
</li>
</ul>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="information_source" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2139.png"></g-emoji> NOTE</strong></p>
<p>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>
</blockquote>
<p> All subscribed UGC items will be downloaded by the Steam client automatically, and you should have code in the <a href="#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>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="warning" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/26a0.png">⚠️</g-emoji> IMPORTANT</strong></p>
<p>Steam UGC IDs can be huge numbers 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 &quot;6.6624e+003&quot; which will cause issues being read back).</p>
</blockquote>
<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">steam_ugc_subscribe_item</a> or from the client/browser). If done from the game you are able to &quot;listen&quot; to the callback from the Steam Async Event.</li>
<li>When you get a successful subscription callback this means that your game is now downloading the UGC. You would then check if the item is installed (ie: download completed) with <a href="#steam_ugc_get_item_install_info">steam_ugc_get_item_install_info</a>.</li>
<li><p>If the item is not completely installed, you can use <a href="#steam_ugc_get_item_update_info">steam_ugc_get_item_update_info</a> to track the download progress.</p>
<p>The following sections explain all the functions required to get UGC functioning in GameMaker Studio 2:</p>
</li>
</ol>
<h2 id="creating-and-editing-content">Creating And Editing Content</h2>
<p> The following functions are essentially &quot;wrapper&quot; 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">Creating And Uploading Content</a>.</p>
<ul>
<li><a href="#steam_ugc_create_item">steam_ugc_create_item</a></li>
<li><a href="#steam_ugc_delete_item">steam_ugc_delete_item</a></li>
<li><a href="#steam_ugc_start_item_update">steam_ugc_start_item_update</a></li>
<li><a href="#steam_ugc_set_item_title">steam_ugc_set_item_title</a></li>
<li><a href="#steam_ugc_set_item_description">steam_ugc_set_item_description</a></li>
<li><a href="#steam_ugc_set_item_visibility">steam_ugc_set_item_visibility</a></li>
<li><a href="#steam_ugc_set_item_tags">steam_ugc_set_item_tags</a></li>
<li><a href="#steam_ugc_set_item_content">steam_ugc_set_item_content</a></li>
<li><a href="#steam_ugc_set_item_preview">steam_ugc_set_item_preview</a></li>
<li><a href="#steam_ugc_submit_item_update">steam_ugc_submit_item_update</a></li>
<li><a href="#steam_ugc_get_item_update_progress">steam_ugc_get_item_update_progress</a></li>
</ul>
<h2 id="consuming-content">Consuming Content</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>
<ul>
<li><a href="#steam_ugc_subscribe_item">steam_ugc_subscribe_item</a></li>
<li><a href="#steam_ugc_unsubscribe_item">steam_ugc_unsubscribe_item</a></li>
<li><a href="#steam_ugc_num_subscribed_items">steam_ugc_num_subscribed_items</a></li>
<li><a href="#steam_ugc_get_subscribed_items">steam_ugc_get_subscribed_items</a></li>
<li><a href="#steam_ugc_get_item_install_info">steam_ugc_get_item_install_info</a></li>
<li><a href="#steam_ugc_get_item_update_info">steam_ugc_get_item_update_info</a></li>
<li><a href="#steam_ugc_request_item_details">steam_ugc_request_item_details</a></li>
</ul>
<h2 id="querying-content">Querying Content</h2>
<p> There are also a large number of functions available to query the Steam API about the UGC items available:</p>
<ul>
<li><a href="#steam_ugc_create_query_user">steam_ugc_create_query_user</a></li>
<li><a href="#steam_ugc_create_query_user_ex">steam_ugc_create_query_user_ex</a></li>
<li><a href="#steam_ugc_create_query_all">steam_ugc_create_query_all</a></li>
<li><a href="#steam_ugc_create_query_all_ex">steam_ugc_create_query_all_ex</a></li>
<li><a href="#steam_ugc_query_set_cloud_filename_filter">steam_ugc_query_set_cloud_filename_filter</a></li>
<li><a href="#steam_ugc_query_set_match_any_tag">steam_ugc_query_set_match_any_tag</a></li>
<li><a href="#steam_ugc_query_set_search_text">steam_ugc_query_set_search_text</a></li>
<li><a href="#steam_ugc_query_set_ranked_by_trend_days">steam_ugc_query_set_ranked_by_trend_days</a></li>
<li><a href="#steam_ugc_query_add_required_tag">steam_ugc_query_add_required_tag</a></li>
<li><a href="#steam_ugc_query_add_excluded_tag">steam_ugc_query_add_excluded_tag</a></li>
<li><a href="#steam_ugc_query_set_return_long_description">steam_ugc_query_set_return_long_description</a></li>
<li><a href="#steam_ugc_query_set_return_total_only">steam_ugc_query_set_return_total_only</a></li>
<li><a href="#steam_ugc_query_set_allow_cached_response">steam_ugc_query_set_allow_cached_response</a></li>
<li><p><a href="#steam_ugc_send_query">steam_ugc_send_query</a></p>
<p>You can get a preview image of any UGC item from the workshop by using the function <a href="#steam_ugc_send_query">steam_ugc_send_query</a> to get the preview file handle of the image, and then calling the following function:</p>
</li>
<li><p><a href="#steam_ugc_download">steam_ugc_download</a></p>
</li>
</ul>
<h2 id="constants">Constants</h2>
<p> This section also provides a set of constants to be used along side the functions provided above:</p>
<ul>
<li><a href="#ugcfiletype">UGCFileType</a></li>
<li><a href="#ugcfilevisibility">UGCFileVisibility</a></li>
<li><a href="#ugclistsortorder">UGCListSortOrder</a></li>
<li><a href="#ugclisttype">UGCListType</a></li>
<li><a href="#ugcmatchtype">UGCMatchType</a></li>
<li><a href="#ugcquerytype-sorting-filtering-">UGCQueryType</a>
<!-- KEYWORDS
Steam UGC
-->
<!-- TAGS
ugc_functions
-->
</li>
</ul>
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_is_screenshot_requested">steam_is_screenshot_requested</h1>
<p> This function will poll the Steam API to see if the key for taking a screenshot of the game has been pressed. The function will only return <code>true</code> for one step (game tick) when the key is pressed, and will return<code>false</code> at all other times.
Please note that if the screenshot key is pressed, this function will only return <code>true</code> once for each step that it is pressed, and return <code>false</code> for any subsequent calls <em>within the same step</em> . For example, if a screenshot is requested in the current frame and you call this function in the Step event to find that out, you will get <code>true</code>; however, if you call it again in Draw GUI to check whether a screenshot was requested, you will get <code>false</code> as the function had already been &quot;used up&quot; in the Step event. To use the function&#39;s return value multiple times within the same frame, it is recommended to store it in a variable and read that instead of calling the function again.</p>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="information_source" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2139.png"></g-emoji> NOTE</strong></p>
<p>This function does not take a screenshot for you. This only signals that the key has been pressed and you must use the GameMaker Studio 2 functions <a href="https://manual.yoyogames.com/GameMaker_Language/GML_Reference/Cameras_And_Display/screen_save.htm">screen_save</a> or <a href="https://manual.yoyogames.com/GameMaker_Language/GML_Reference/Cameras_And_Display/screen_save_part.htm">screen_save_part</a> to save a local copy of the file to be uploaded.</p>
</blockquote>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs"><span class="hljs-built_in">steam_is_screenshot_requested</span>();</pre><p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Bool</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">if</span> <span class="hljs-built_in">steam_is_screenshot_requested</span>()
{
<span class="hljs-keyword">var</span> file = <span class="hljs-string">&quot;Catch_The_Haggis_&quot;</span> + <span class="hljs-built_in">string</span>(<span class="hljs-literal">global</span>.scrn_num) + <span class="hljs-string">&quot;.png&quot;</span>);
<span class="hljs-built_in">screen_save</span>(file)
<span class="hljs-built_in">steam_send_screenshot</span>(file, <span class="hljs-built_in">window_get_width</span>(), <span class="hljs-built_in">window_get_height</span>());
<span class="hljs-literal">global</span>.scrn_num += <span class="hljs-number">1</span>;
}</pre><p> The above code will poll the Steam API for a screenshot request and if it has been, a unique name for the image file will be generated, a screenshot will be taken, and the file will be sent to the Steam Community page for the user.</p>
<!-- KEYWORDS
steam_is_screenshot_requested
-->
<!-- TAGS
steam_is_screenshot_requested
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_send_screenshot">steam_send_screenshot</h1>
<p> With this function you can upload a screenshot to the Steam Community profile page of the currently logged in user. The filename you supply is the name of the local file that was created when you took the screenshot using the GameMaker Studio 2 functions <a href="https://manual.yoyogames.com/GameMaker_Language/GML_Reference/Cameras_And_Display/screen_save.htm">screen_save</a> or <a href="https://manual.yoyogames.com/GameMaker_Language/GML_Reference/Cameras_And_Display/screen_save_part.htm">screen_save_part.</a> The width and height define the image size, and the function will return a value of 0 if it fails for whatever reason and a value greater than 0 if it succeeds.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs"><span class="hljs-built_in">steam_send_screenshot</span>(filename, width, height);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>filename</td>
<td>string</td>
<td>The name of the image file to upload.</td>
</tr>
<tr>
<td>width</td>
<td>real</td>
<td>The width of the image.</td>
</tr>
<tr>
<td>height</td>
<td>real</td>
<td>The height of the image.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Real</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">if</span> <span class="hljs-built_in">steam_is_screenshot_requested</span>()
{
<span class="hljs-keyword">var</span> file = <span class="hljs-string">&quot;Catch_The_Haggis_&quot;</span> + <span class="hljs-built_in">string</span>(<span class="hljs-literal">global</span>.scrn_num) + <span class="hljs-string">&quot;.png&quot;</span>);
<span class="hljs-built_in">screen_save</span>(file)
<span class="hljs-built_in">steam_send_screenshot</span>(file, <span class="hljs-built_in">window_get_width</span>(), <span class="hljs-built_in">window_get_height</span>());
<span class="hljs-literal">global</span>.scrn_num += <span class="hljs-number">1</span>;
}</pre><p> The above code will poll the Steam API for a screenshot request and if it has been, a unique name for the image file will be generated, a screenshot will be taken, and the file will be sent to the Steam Community page for the user.</p>
<!-- KEYWORDS
steam_send_screenshot
-->
<!-- TAGS
steam_send_screenshot
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_ugc_create_item">steam_ugc_create_item</h1>
<p> This function is used to prepare the Workshop API and generate a published file ID for the item to be added. The function <i>must</i> be called before doing anything else with the item to be uploaded, as you will be required to use the unique published ID value that it returns in the Steam Async Event for updating.
This is an asynchronous function that will return an asynchronous id and trigger the <a href="https://manual-en.yoyogames.com/The_Asset_Editors/Object_Properties/Async_Events/Steam.htm">Steam Async Event</a> when the task is finished.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs"><span class="hljs-built_in">steam_ugc_create_item</span>(consumer_app_id, file_type);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>consumer_app_id</td>
<td>integer</td>
<td>The unique App ID for your game on Steam.</td>
</tr>
<tr>
<td>file_type</td>
<td>constant.UGCFileType</td>
<td>One of the available file type constants (see <a href="#ugcfiletype">UGCFileType</a> constants).</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Real</pre><p><br></p>
<p><strong>Triggers:</strong></p>
<pre class="hljs">Asynchronous Steam Event</pre><table>
<thead>
<tr>
<th>Key</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>id</td>
<td>real</td>
<td>The asynchronous request ID</td>
</tr>
<tr>
<td>event_type</td>
<td>string</td>
<td>The string value <code>&quot;ugc_create_item&quot;</code></td>
</tr>
<tr>
<td>result</td>
<td>real</td>
<td>This will either be the GML constant <code>ugc_result_success</code> or some other real number (see the<a href="https://partner.steamgames.com/doc/api/steam_api#EResult">Steam docs</a>, for more details)</td>
</tr>
<tr>
<td>legal_agreement_required</td>
<td>bool</td>
<td>Will be <code>true</code> or <code>false</code> (see the <a href="https://partner.steamgames.com/documentation/ugc#Legal">Steam docs</a> for more details)</td>
</tr>
<tr>
<td>published_file_id</td>
<td>int64</td>
<td>This key holds the unique published ID for the item (you may need to cast it using the <a href="#int64.htm">int64()</a> function)</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Extended Example:</strong></p>
<p> In this example we first call the function and store the async ID value in a variable:</p>
<pre class="hljs"><span class="hljs-keyword">var</span> app_id = <span class="hljs-built_in">steam_get_app_id</span>();
new_item = <span class="hljs-built_in">steam_ugc_create_item</span>(app_id, <span class="hljs-literal">ugc_filetype_community</span>);</pre><p> This would then send off a request to the Steam API to create the new Workshop item, generating an async event which we would deal with as follows:</p>
<pre class="hljs"><span class="hljs-keyword">var</span> event_id = <span class="hljs-symbol">async_load</span>[? <span class="hljs-string">&quot;id&quot;</span>];
<span class="hljs-keyword">if</span> event_id == new_item
{
<span class="hljs-keyword">var</span> type = <span class="hljs-symbol">async_load</span>[? <span class="hljs-string">&quot;event_type&quot;</span>];
<span class="hljs-keyword">if</span> type == <span class="hljs-string">&quot;ugc_create_item&quot;</span>
{
<span class="hljs-literal">global</span>.Publish_ID = <span class="hljs-symbol">async_load</span>[? <span class="hljs-string">&quot;published_file_id&quot;</span>];
}
}</pre><p> The above code checks the event type and if it is &quot;ugc_create_item&quot; then it retrieves the published file ID and stores it in a global variable for future reference.</p>
<!-- KEYWORDS
steam_ugc_create_item
ugc_filetype_community
ugc_filetype_microtrans
-->
<!-- TAGS
steam_ugc_create_item
-->
<p><br><br></p>
<hr>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_ugc_delete_item">steam_ugc_delete_item</h1>
<p> This function attempts to delete a previously published UGC item.
This is an asynchronous function that will return an asynchronous id and trigger the <a href="https://manual-en.yoyogames.com/The_Asset_Editors/Object_Properties/Async_Events/Steam.htm">Steam Async Event</a> when the task is finished.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_ugc_delete_item(ugc_query_handle);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>ugc_query_handle</td>
<td>real</td>
<td>The query handle to use.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Real</pre><p><br></p>
<p><strong>Triggers:</strong></p>
<pre class="hljs">Asynchronous Steam Event</pre><table>
<thead>
<tr>
<th>Key</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>id</td>
<td>real</td>
<td>The asynchronous request ID</td>
</tr>
<tr>
<td>event_type</td>
<td>string</td>
<td>The string value <code>&quot;ugc_item_delete&quot;</code></td>
</tr>
<tr>
<td>result</td>
<td>real</td>
<td>This will either be the GML constant <code>ugc_result_success</code> or some other real number (see the<a href="https://partner.steamgames.com/doc/api/steam_api#EResult">Steam docs</a>, for more details)</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs">steam_ugc_delete_item(ugc_query_handle);</pre><p> The above code creates a deletion request for <code>ugc_query_handle</code>.</p>
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_ugc_start_item_update">steam_ugc_start_item_update</h1>
<p> This function must be called before adding or updating information on a UGC item. You need to supply the unique App ID for your game on Steam, along with the unique published file ID that was returned for the item when you created it using the function <a href="#steam_ugc_create_item">steam_ugc_create_item</a>. The function will return a unique update handle for the item, which you can then use in the UGC item functions to update (or add) information for uploading.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs"><span class="hljs-built_in">steam_ugc_start_item_update</span>(consumer_app_id, published_file_id);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>consumer_app_id</td>
<td>real</td>
<td>The unique App ID for your game on Steam.</td>
</tr>
<tr>
<td>published_file_id</td>
<td>int64</td>
<td>The unique published file ID value for the item.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Real</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">var</span> app_id = <span class="hljs-built_in">steam_get_app_id</span>();
<span class="hljs-keyword">var</span> updateHandle = <span class="hljs-built_in">steam_ugc_start_item_update</span>(app_id, <span class="hljs-literal">global</span>.Publish_ID);
<span class="hljs-built_in">steam_ugc_set_item_title</span>(updateHandle, <span class="hljs-string">&quot;My workshop item(3)!&quot;</span>);
<span class="hljs-built_in">steam_ugc_set_item_description</span>( updateHandle, <span class="hljs-string">&quot;testing workshop...&quot;</span>);
<span class="hljs-built_in">steam_ugc_set_item_visibility</span>(updateHandle, <span class="hljs-literal">ugc_visibility_public</span>);
<span class="hljs-keyword">var</span> tagArray;
tagArray[<span class="hljs-number">0</span>] = <span class="hljs-string">&quot;Test&quot;</span>;
tagArray[<span class="hljs-number">1</span>] = <span class="hljs-string">&quot;New&quot;</span>;
<span class="hljs-built_in">steam_ugc_set_item_tags</span>(updateHandle, tagArray);
<span class="hljs-built_in">steam_ugc_set_item_preview</span>(updateHandle, <span class="hljs-string">&quot;promo.jpg&quot;</span>);
<span class="hljs-built_in">steam_ugc_set_item_content</span>(updateHandle, <span class="hljs-string">&quot;WorkshopContent1&quot;</span>);
requestId = <span class="hljs-built_in">steam_ugc_submit_item_update</span>(updateHandle, <span class="hljs-string">&quot;Version 1.2&quot;</span>);</pre><p> The above code gets the game ID, then uses that along with a previously stored published file ID to generate an update handle for the item. This handle is then used to update various pieces of information before the update is pushed to the Workshop servers.</p>
<!-- KEYWORDS
steam_ugc_start_item_update
-->
<!-- TAGS
steam_ugc_start_item_update
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_ugc_set_item_title">steam_ugc_set_item_title</h1>
<p> This function will set the title to be used for the given item.
The function will return <code>true</code> if the API was successfully accessed and <code>false</code> if there was an issue.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs"><span class="hljs-built_in">steam_ugc_set_item_title</span>(ugc_update_handle, title);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>ugc_update_handle</td>
<td>real</td>
<td>The unique handle for the UGC to be updated (returned from <a href="#steam_ugc_start_item_update">steam_ugc_start_item_update</a>)</td>
</tr>
<tr>
<td>title</td>
<td>string</td>
<td>The title (max 128 characters) to be used for the item.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Bool</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">var</span> app_id = <span class="hljs-built_in">steam_get_app_id</span>();
<span class="hljs-keyword">var</span> updateHandle = <span class="hljs-built_in">steam_ugc_start_item_update</span>(app_id, <span class="hljs-literal">global</span>.Publish_ID);
<span class="hljs-built_in">steam_ugc_set_item_title</span>(updateHandle, <span class="hljs-string">&quot;My workshop item(3)!&quot;</span>);
<span class="hljs-built_in">steam_ugc_set_item_description</span>( updateHandle, <span class="hljs-string">&quot;testing workshop...&quot;</span>);
<span class="hljs-built_in">steam_ugc_set_item_visibility</span>(updateHandle, <span class="hljs-literal">ugc_visibility_public</span>);
<span class="hljs-keyword">var</span> tagArray;
tagArray[<span class="hljs-number">0</span>] = <span class="hljs-string">&quot;Test&quot;</span>;
tagArray[<span class="hljs-number">1</span>] = <span class="hljs-string">&quot;New&quot;</span>;
<span class="hljs-built_in">steam_ugc_set_item_tags</span>(updateHandle, tagArray);
<span class="hljs-built_in">steam_ugc_set_item_preview</span>(updateHandle, <span class="hljs-string">&quot;promo.jpg&quot;</span>);
<span class="hljs-built_in">steam_ugc_set_item_content</span>(updateHandle, <span class="hljs-string">&quot;WorkshopContent1&quot;</span>);
requestId = <span class="hljs-built_in">steam_ugc_submit_item_update</span>(updateHandle, <span class="hljs-string">&quot;Version 1.2&quot;</span>);</pre><p> The above code gets the game ID, then uses that along with a previously stored published file ID to generate an update handle for the item. This handle is then used to update various pieces of information before the update is pushed to the Workshop servers.</p>
<!-- KEYWORDS
steam_ugc_set_item_title
-->
<!-- TAGS
steam_ugc_set_item_title
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_ugc_set_item_description">steam_ugc_set_item_description</h1>
<p> This function will set the description to be used for the given item.
The function will return <code>true</code> if the API was successfully accessed and <code>false</code> if there was an issue.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs"><span class="hljs-built_in">steam_ugc_set_item_description</span>(ugc_update_handle, description);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>ugc_update_handle</td>
<td>real</td>
<td>The unique handle for the UGC to be updated (returned from <a href="#steam_ugc_start_item_update">steam_ugc_start_item_update</a>)</td>
</tr>
<tr>
<td>description</td>
<td>string</td>
<td>The description (max 8000 characters) to be used for the item.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Bool</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">var</span> app_id = <span class="hljs-built_in">steam_get_app_id</span>();
<span class="hljs-keyword">var</span> updateHandle = <span class="hljs-built_in">steam_ugc_start_item_update</span>(app_id, <span class="hljs-literal">global</span>.Publish_ID);
<span class="hljs-built_in">steam_ugc_set_item_title</span>(updateHandle, <span class="hljs-string">&quot;My workshop item(3)!&quot;</span>);
<span class="hljs-built_in">steam_ugc_set_item_description</span>( updateHandle, <span class="hljs-string">&quot;testing workshop...&quot;</span>);
<span class="hljs-built_in">steam_ugc_set_item_visibility</span>(updateHandle, <span class="hljs-literal">ugc_visibility_public</span>);
<span class="hljs-keyword">var</span> tagArray;
tagArray[<span class="hljs-number">0</span>] = <span class="hljs-string">&quot;Test&quot;</span>;
tagArray[<span class="hljs-number">1</span>] = <span class="hljs-string">&quot;New&quot;</span>;
<span class="hljs-built_in">steam_ugc_set_item_tags</span>(updateHandle, tagArray);
<span class="hljs-built_in">steam_ugc_set_item_preview</span>(updateHandle, <span class="hljs-string">&quot;promo.jpg&quot;</span>);
<span class="hljs-built_in">steam_ugc_set_item_content</span>(updateHandle, <span class="hljs-string">&quot;WorkshopContent1&quot;</span>);
requestId = <span class="hljs-built_in">steam_ugc_submit_item_update</span>(updateHandle, <span class="hljs-string">&quot;Version 1.2&quot;</span>);</pre><p> The above code gets the game ID, then uses that along with a previously stored published file ID to generate an update handle for the item. This handle is then used to update various pieces of information before the update is pushed to the Workshop servers.</p>
<!-- KEYWORDS
steam_ugc_set_item_description
-->
<!-- TAGS
steam_ugc_set_item_description
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_ugc_set_item_visibility">steam_ugc_set_item_visibility</h1>
<p> This function will set the visibility of the given item, using one of the <a href="#ugcfilevisibility">UGCFileVisibility</a> constants.
The function will return <code>true</code> if the API was successfully accessed and <code>false</code> if there was an issue.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs"><span class="hljs-built_in">steam_ugc_set_item_visibility</span>(ugc_update_handle, visibility);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>ugc_update_handle</td>
<td>real</td>
<td>The unique handle for the UGC to be updated (returned from <a href="#steam_ugc_start_item_update">steam_ugc_start_item_update</a>)</td>
</tr>
<tr>
<td>visibility</td>
<td>constant.UGCFileVisibility</td>
<td>The visibility to be used for the item (see <a href="#ugcfilevisibility">UGCFileVisibility</a> constant)</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Bool</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">var</span> app_id = <span class="hljs-built_in">steam_get_app_id</span>();
<span class="hljs-keyword">var</span> updateHandle = <span class="hljs-built_in">steam_ugc_start_item_update</span>(app_id, <span class="hljs-literal">global</span>.Publish_ID);
<span class="hljs-built_in">steam_ugc_set_item_title</span>(updateHandle, <span class="hljs-string">&quot;My workshop item(3)!&quot;</span>);
<span class="hljs-built_in">steam_ugc_set_item_description</span>( updateHandle, <span class="hljs-string">&quot;testing workshop...&quot;</span>);
<span class="hljs-built_in">steam_ugc_set_item_visibility</span>(updateHandle, <span class="hljs-literal">ugc_visibility_public</span>);
<span class="hljs-keyword">var</span> tagArray;
tagArray[<span class="hljs-number">0</span>] = <span class="hljs-string">&quot;Test&quot;</span>;
tagArray[<span class="hljs-number">1</span>] = <span class="hljs-string">&quot;New&quot;</span>;
<span class="hljs-built_in">steam_ugc_set_item_tags</span>(updateHandle, tagArray);
<span class="hljs-built_in">steam_ugc_set_item_preview</span>(updateHandle, <span class="hljs-string">&quot;promo.jpg&quot;</span>);
<span class="hljs-built_in">steam_ugc_set_item_content</span>(updateHandle, <span class="hljs-string">&quot;WorkshopContent1&quot;</span>);
requestId = <span class="hljs-built_in">steam_ugc_submit_item_update</span>(updateHandle, <span class="hljs-string">&quot;Version 1.2&quot;</span>);</pre><p> The above code gets the game ID, then uses that along with a previously stored published file ID to generate an update handle for the item. This handle is then used to update various pieces of information before the update is pushed to the Workshop servers.</p>
<!-- KEYWORDS
steam_ugc_set_item_visibility
ugc_visibility_public
ugc_visibility_friends_only
ugc_visibility_private
-->
<!-- TAGS
steam_ugc_set_item_visibility
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_ugc_set_item_tags">steam_ugc_set_item_tags</h1>
<p> This function will set the tags to be used for the given item. The tags should be added to a 1D array as string elements and the array passed to the function.
The function will return <code>true</code> if the API was successfully accessed and <code>false</code> if there was an issue.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs"><span class="hljs-built_in">steam_ugc_set_item_tags</span>(ugc_update_handle, tags);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>ugc_update_handle</td>
<td>real</td>
<td>The unique handle for the UGC to be updated (returned from <a href="#steam_ugc_start_item_update">steam_ugc_start_item_update</a>)</td>
</tr>
<tr>
<td>tags</td>
<td>string</td>
<td>The tags (as an string json array) to be used for the item.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Bool</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">var</span> app_id = <span class="hljs-built_in">steam_get_app_id</span>();
<span class="hljs-keyword">var</span> updateHandle = <span class="hljs-built_in">steam_ugc_start_item_update</span>(app_id, <span class="hljs-literal">global</span>.Publish_ID);
<span class="hljs-built_in">steam_ugc_set_item_title</span>(updateHandle, <span class="hljs-string">&quot;My workshop item(3)!&quot;</span>);
<span class="hljs-built_in">steam_ugc_set_item_description</span>( updateHandle, <span class="hljs-string">&quot;testing workshop...&quot;</span>);
<span class="hljs-built_in">steam_ugc_set_item_visibility</span>(updateHandle, <span class="hljs-literal">ugc_visibility_public</span>);
<span class="hljs-keyword">var</span> tagArray;
tagArray[<span class="hljs-number">0</span>] = <span class="hljs-string">&quot;Test&quot;</span>;
tagArray[<span class="hljs-number">1</span>] = <span class="hljs-string">&quot;New&quot;</span>;
<span class="hljs-built_in">steam_ugc_set_item_tags</span>(updateHandle, <span class="hljs-built_in">string</span>(tagArray));
<span class="hljs-built_in">steam_ugc_set_item_preview</span>(updateHandle, <span class="hljs-string">&quot;promo.jpg&quot;</span>);
<span class="hljs-built_in">steam_ugc_set_item_content</span>(updateHandle, <span class="hljs-string">&quot;WorkshopContent1&quot;</span>);
requestId = <span class="hljs-built_in">steam_ugc_submit_item_update</span>(updateHandle, <span class="hljs-string">&quot;Version 1.2&quot;</span>);</pre><p> The above code gets the game ID, then uses that along with a previously stored published file ID to generate an update handle for the item. This handle is then used to update various pieces of information before the update is pushed to the Workshop servers.</p>
<!-- KEYWORDS
steam_ugc_set_item_tags
-->
<!-- TAGS
steam_ugc_set_item_tags
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_ugc_set_item_content">steam_ugc_set_item_content</h1>
<p> This function will set the content path to be used for the given item, and it should be a relative path to the folder which contains the content files to upload - which in turn should be in the save are <i>or</i> the game bundle (ie: an included file).
The function will return <code>true</code> if the API was successfully accessed and <code>false</code> if there was an issue.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs"><span class="hljs-built_in">steam_ugc_set_item_content</span>(ugc_update_handle, content);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>ugc_update_handle</td>
<td>real</td>
<td>The unique handle for the UGC to be updated (returned from <a href="#steam_ugc_start_item_update">steam_ugc_start_item_update</a>)</td>
</tr>
<tr>
<td>content</td>
<td>string</td>
<td>The content path to be used for the item</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Bool</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">var</span> app_id = <span class="hljs-built_in">steam_get_app_id</span>();
<span class="hljs-keyword">var</span> updateHandle = <span class="hljs-built_in">steam_ugc_start_item_update</span>(app_id, <span class="hljs-literal">global</span>.Publish_ID);
<span class="hljs-built_in">steam_ugc_set_item_title</span>(updateHandle, <span class="hljs-string">&quot;My workshop item(3)!&quot;</span>);
<span class="hljs-built_in">steam_ugc_set_item_description</span>( updateHandle, <span class="hljs-string">&quot;testing workshop...&quot;</span>);
<span class="hljs-built_in">steam_ugc_set_item_visibility</span>(updateHandle, <span class="hljs-literal">ugc_visibility_public</span>);
<span class="hljs-keyword">var</span> tagArray;
tagArray[<span class="hljs-number">0</span>] = <span class="hljs-string">&quot;Test&quot;</span>;
tagArray[<span class="hljs-number">1</span>] = <span class="hljs-string">&quot;New&quot;</span>;
<span class="hljs-built_in">steam_ugc_set_item_tags</span>(updateHandle, tagArray);
<span class="hljs-built_in">steam_ugc_set_item_preview</span>(updateHandle, <span class="hljs-string">&quot;promo.jpg&quot;</span>);
<span class="hljs-built_in">steam_ugc_set_item_content</span>(updateHandle, <span class="hljs-string">&quot;WorkshopContent1&quot;</span>);
requestId = <span class="hljs-built_in">steam_ugc_submit_item_update</span>(updateHandle, <span class="hljs-string">&quot;Version 1.2&quot;</span>);</pre><p> The above code gets the game ID, then uses that along with a previously stored published file ID to generate an update handle for the item. This handle is then used to update various pieces of information before the update is pushed to the Workshop servers.</p>
<!-- KEYWORDS
steam_ugc_set_item_content
-->
<!-- TAGS
steam_ugc_set_item_content
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_ugc_set_item_preview">steam_ugc_set_item_preview</h1>
<p> This function will set the preview image to be used for the given item. The image should be supplied as either a PNG, JPG or GIF format file with a maximum size of 1MB. The path to the image should be a relative path in the save are <i>or</i> the game bundle (ie: an included file).
The function will return <code>true</code> if the API was successfully accessed and <code>false</code> if there was an issue.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs"><span class="hljs-built_in">steam_ugc_set_item_preview</span>(ugc_update_handle, preview);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>ugc_update_handle</td>
<td>real</td>
<td>The unique handle for the UGC to be updated (returned from <a href="#steam_ugc_start_item_update">steam_ugc_start_item_update</a>)</td>
</tr>
<tr>
<td>preview</td>
<td>string</td>
<td>The preview image (JPG, GIF or PNG - max size 1MB) to be used for the item.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Bool</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">var</span> app_id = <span class="hljs-built_in">steam_get_app_id</span>();
<span class="hljs-keyword">var</span> updateHandle = <span class="hljs-built_in">steam_ugc_start_item_update</span>(app_id, <span class="hljs-literal">global</span>.Publish_ID);
<span class="hljs-built_in">steam_ugc_set_item_title</span>(updateHandle, <span class="hljs-string">&quot;My workshop item(3)!&quot;</span>);
<span class="hljs-built_in">steam_ugc_set_item_description</span>( updateHandle, <span class="hljs-string">&quot;testing workshop...&quot;</span>);
<span class="hljs-built_in">steam_ugc_set_item_visibility</span>(updateHandle, <span class="hljs-literal">ugc_visibility_public</span>);
<span class="hljs-keyword">var</span> tagArray;
tagArray[<span class="hljs-number">0</span>] = <span class="hljs-string">&quot;Test&quot;</span>;
tagArray[<span class="hljs-number">1</span>] = <span class="hljs-string">&quot;New&quot;</span>;
<span class="hljs-built_in">steam_ugc_set_item_tags</span>(updateHandle, tagArray);
<span class="hljs-built_in">steam_ugc_set_item_preview</span>(updateHandle, <span class="hljs-string">&quot;promo.jpg&quot;</span>);
<span class="hljs-built_in">steam_ugc_set_item_content</span>(updateHandle, <span class="hljs-string">&quot;WorkshopContent1&quot;</span>);
requestId = <span class="hljs-built_in">steam_ugc_submit_item_update</span>(updateHandle, <span class="hljs-string">&quot;Version 1.2&quot;</span>);</pre><p> The above code gets the game ID, then uses that along with a previously stored published file ID to generate an update handle for the item. This handle is then used to update various pieces of information before the update is pushed to the Workshop servers.</p>
<!-- KEYWORDS
steam_ugc_set_item_preview
-->
<!-- TAGS
steam_ugc_set_item_preview
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_ugc_submit_item_update">steam_ugc_submit_item_update</h1>
<p> This function will submit the UGC item indexed by the given handle to the Steam Workshop servers, adding the change notes to be used for the given item.
This is an asynchronous function that will return an asynchronous id and trigger the <a href="https://manual-en.yoyogames.com/The_Asset_Editors/Object_Properties/Async_Events/Steam.htm">Steam Async Event</a> when the task is finished.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs"><span class="hljs-built_in">steam_ugc_submit_item_update</span>(ugc_update_handle, change_note);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>ugc_update_handle</td>
<td>real</td>
<td>The unique handle for the UGC to be updated (returned from <a href="#steam_ugc_start_item_update">steam_ugc_start_item_update</a>)</td>
</tr>
<tr>
<td>change_note</td>
<td>string</td>
<td>The change notes to be used for the item.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Real</pre><p><br></p>
<p><strong>Triggers:</strong></p>
<pre class="hljs">Asynchronous Steam Event</pre><table>
<thead>
<tr>
<th>Key</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>id</td>
<td>real</td>
<td>The asynchronous request ID</td>
</tr>
<tr>
<td>event_type</td>
<td>string</td>
<td>The string value <code>&quot;ugc_update_item&quot;</code></td>
</tr>
<tr>
<td>result</td>
<td>real</td>
<td>This will either be the GML constant <code>ugc_result_success</code> or some other real number (see the<a href="https://partner.steamgames.com/doc/api/steam_api#EResult">Steam docs</a>, for more details)</td>
</tr>
<tr>
<td>legal_agreement_required</td>
<td>bool</td>
<td>Will be <code>true</code> or <code>false</code> (see the <a href="https://partner.steamgames.com/documentation/ugc#Legal">Steam docs</a> for more details)</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">var</span> app_id = <span class="hljs-built_in">steam_get_app_id</span>();
<span class="hljs-keyword">var</span> updateHandle = <span class="hljs-built_in">steam_ugc_start_item_update</span>(app_id, <span class="hljs-literal">global</span>.Publish_ID);
<span class="hljs-built_in">steam_ugc_set_item_title</span>(updateHandle, <span class="hljs-string">&quot;My workshop item(3)!&quot;</span>);
<span class="hljs-built_in">steam_ugc_set_item_description</span>( updateHandle, <span class="hljs-string">&quot;testing workshop...&quot;</span>);
<span class="hljs-built_in">steam_ugc_set_item_visibility</span>(updateHandle, <span class="hljs-literal">ugc_visibility_public</span>);
<span class="hljs-keyword">var</span> tagArray;
tagArray[<span class="hljs-number">0</span>] = <span class="hljs-string">&quot;Test&quot;</span>;
tagArray[<span class="hljs-number">1</span>] = <span class="hljs-string">&quot;New&quot;</span>;
<span class="hljs-built_in">steam_ugc_set_item_tags</span>(updateHandle, tagArray);
<span class="hljs-built_in">steam_ugc_set_item_preview</span>(updateHandle, <span class="hljs-string">&quot;promo.jpg&quot;</span>);
<span class="hljs-built_in">steam_ugc_set_item_content</span>(updateHandle, <span class="hljs-string">&quot;WorkshopContent1&quot;</span>);
requestId = <span class="hljs-built_in">steam_ugc_submit_item_update</span>(updateHandle, <span class="hljs-string">&quot;Version 1.2&quot;</span>);</pre><p> The above code gets the game ID, then uses that along with a previously stored published file ID to generate an update handle for the item. This handle is then used to update various pieces of information before the update is pushed to the Workshop servers.</p>
<!-- KEYWORDS
steam_ugc_submit_item_update
-->
<!-- TAGS
steam_ugc_submit_item_update
-->
<p><br><br></p>
<p>---<!--<div class="body-scroll" style="top: 150px;">--></p>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_ugc_get_item_update_progress">steam_ugc_get_item_update_progress</h1>
<pre class="hljs">This <span class="hljs-keyword">function</span> can be used <span class="hljs-keyword">to</span> track the update status <span class="hljs-keyword">for</span> an item. You give the item handle (<span class="hljs-keyword">as</span> returned <span class="hljs-keyword">by</span> the <span class="hljs-keyword">function</span> [steam_ugc_start_item_update](<span class="hljs-comment">#steam_ugc_start_item_update)) and an empty [DS map](https://manual.yoyogames.com/GameMaker_Language/GML_Reference/Data_Structures/DS_Maps/DS_Maps.htm) which will then be populated with the update information (see table below)</span>
If there <span class="hljs-keyword">is</span> an error the <span class="hljs-keyword">function</span> will <span class="hljs-keyword">return</span> `<span class="hljs-literal">false</span>` <span class="hljs-keyword">and</span> the <span class="hljs-keyword">map</span> will be empty, <span class="hljs-keyword">otherwise</span> the <span class="hljs-keyword">function</span> returns `<span class="hljs-literal">true</span>`.</pre><p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs"><span class="hljs-built_in">steam_ugc_get_item_update_progress</span>(ugc_update_handle, info_map);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>ugc_update_handle</td>
<td>integer</td>
<td>The unique handle for the UGC to be updated.</td>
</tr>
<tr>
<td>info_map</td>
<td>DS Map ID</td>
<td>A (previously created) <a href="https://manual.yoyogames.com/GameMaker_Language/GML_Reference/Data_Structures/DS_Maps/DS_Maps.htm">DS map</a> index.</td>
</tr>
</tbody>
</table>
<table>
<thead>
<tr>
<th>Key</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>status_code</td>
<td>real</td>
<td>The Steam status code</td>
</tr>
<tr>
<td>status_string</td>
<td>string</td>
<td>A string for the current status</td>
</tr>
<tr>
<td>bytes_processed</td>
<td>real</td>
<td>The bytes processed so far</td>
</tr>
<tr>
<td>bytes_total</td>
<td>real</td>
<td>The total number of bytes in the update</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Bool</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">var</span> uploadMap = <span class="hljs-built_in">ds_map_create</span>();
<span class="hljs-built_in">steam_ugc_get_item_update_progress</span>(<span class="hljs-literal">global</span>.itemHandle, uploadMap);
<span class="hljs-keyword">var</span> statusCode = uploadMap[? <span class="hljs-string">&quot;status_code&quot;</span>];
<span class="hljs-keyword">var</span> status = uploadMap[? <span class="hljs-string">&quot;status_string&quot;</span>];
<span class="hljs-keyword">var</span> processed = uploadMap[? <span class="hljs-string">&quot;bytes_processed&quot;</span>];
<span class="hljs-keyword">var</span> total = uploadMap[? <span class="hljs-string">&quot;bytes_total&quot;</span>];
<span class="hljs-built_in">draw_text</span>(<span class="hljs-number">32</span>, <span class="hljs-number">0</span>, <span class="hljs-string">&quot;Upload info for item:&quot;</span> + <span class="hljs-built_in">string</span>(<span class="hljs-literal">global</span>.itemHandle));
<span class="hljs-built_in">draw_text</span>(<span class="hljs-number">32</span>, <span class="hljs-number">15</span>, <span class="hljs-string">&quot;status code:&quot;</span> + <span class="hljs-built_in">string</span>(statusCode));
<span class="hljs-built_in">draw_text</span>(<span class="hljs-number">32</span>, <span class="hljs-number">30</span>, <span class="hljs-string">&quot;status:&quot;</span> + <span class="hljs-built_in">string</span>(status));
<span class="hljs-built_in">draw_text</span>(<span class="hljs-number">32</span>, <span class="hljs-number">45</span>, <span class="hljs-string">&quot;bytes processed:&quot;</span> +<span class="hljs-built_in">string</span>(processed));
<span class="hljs-built_in">draw_text</span>(<span class="hljs-number">32</span>, <span class="hljs-number">60</span>, <span class="hljs-string">&quot;bytes total:&quot;</span> + <span class="hljs-built_in">string</span>( total));
<span class="hljs-built_in">ds_map_destroy</span>(uploadMap);</pre><pre class="hljs">The <span class="hljs-keyword">above</span> code will query <span class="hljs-keyword">the</span> upload status <span class="hljs-keyword">of</span> <span class="hljs-keyword">the</span> <span class="hljs-built_in">item</span> indexed <span class="hljs-keyword">in</span> <span class="hljs-keyword">the</span> <span class="hljs-keyword">global</span> variable &amp;quot;itemHandle&amp;quot;, using a `DS Map` <span class="hljs-keyword">to</span> store <span class="hljs-keyword">the</span> information. This <span class="hljs-keyword">is</span> <span class="hljs-keyword">then</span> parsed <span class="hljs-keyword">and</span> <span class="hljs-keyword">the</span> resulting values drawn <span class="hljs-keyword">to</span> <span class="hljs-keyword">the</span> screen.
&lt;!<span class="hljs-comment">-- KEYWORDS</span></pre><p>steam_ugc_get_item_update_progress
--&gt;<!-- TAGS
steam_ugc_get_item_update_progress
-->
<br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_ugc_subscribe_item">steam_ugc_subscribe_item</h1>
<p> This function can be used to subscribe to a UGC item.
This is an asynchronous function that will return an asynchronous id and trigger the <a href="https://manual-en.yoyogames.com/The_Asset_Editors/Object_Properties/Async_Events/Steam.htm">Steam Async Event</a> when the task is finished.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs"><span class="hljs-built_in">steam_ugc_subscribe_item</span>(published_file_id);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>published_file_id</td>
<td>int64</td>
<td>The unique file ID for the UGC to subscribe to.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Real</pre><p><br></p>
<p><strong>Triggers:</strong></p>
<pre class="hljs">Asynchronous Steam Event</pre><table>
<thead>
<tr>
<th>Key</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>id</td>
<td>real</td>
<td>The asynchronous request ID</td>
</tr>
<tr>
<td>event_type</td>
<td>string</td>
<td>The string value <code>&quot;ugc_subscribe_item&quot;</code></td>
</tr>
<tr>
<td>result</td>
<td>real</td>
<td>This will either be the GML constant <code>ugc_result_success</code> or some other real number (see the<a href="https://partner.steamgames.com/doc/api/steam_api#EResult">Steam docs</a>, for more details)</td>
</tr>
<tr>
<td>published_file_id</td>
<td>int64</td>
<td>This key holds the unique published ID for the item (you may need to cast it using the <a href="https://manual.yoyogames.com/GameMaker_Language/GML_Reference/Variable_Functions/int64.htm">int64</a> function, before passing it to subsequent functions)</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs">steam_sub = <span class="hljs-built_in">steam_ugc_subscribe_item</span>(<span class="hljs-literal">global</span>.pubFileID);</pre><p> The above code will subscribe (and download) the item with the file ID stored in the global variable &quot;pubFileID&quot;.</p>
<!-- KEYWORDS
steam_ugc_subscribe_item
-->
<!-- TAGS
steam_ugc_subscribe_item
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_ugc_unsubscribe_item">steam_ugc_unsubscribe_item</h1>
<p> This function can be used to unsubscribe from a UGC item.
This is an asynchronous function that will return an asynchronous id and trigger the <a href="https://manual-en.yoyogames.com/The_Asset_Editors/Object_Properties/Async_Events/Steam.htm">Steam Async Event</a> when the task is finished.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs"><span class="hljs-built_in">steam_ugc_unsubscribe_item</span>(published_file_id);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>published_file_id</td>
<td>int64</td>
<td>The unique file ID for the UGC to unsubscribe from.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Real</pre><p><br></p>
<p><strong>Triggers:</strong></p>
<pre class="hljs">Asynchronous Steam Event</pre><table>
<thead>
<tr>
<th>Key</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>id</td>
<td>real</td>
<td>The asynchronous request ID</td>
</tr>
<tr>
<td>event_type</td>
<td>string</td>
<td>The string value <code>&quot;ugc_unsubscribe_item&quot;</code></td>
</tr>
<tr>
<td>result</td>
<td>real</td>
<td>This will either be the GML constant <code>ugc_result_success</code> or some other real number (see the<a href="https://partner.steamgames.com/doc/api/steam_api#EResult">Steam docs</a>, for more details)</td>
</tr>
<tr>
<td>published_file_id</td>
<td>int64</td>
<td>This key holds the unique published ID for the item (you may need to cast it using the <a href="https://manual.yoyogames.com/GameMaker_Language/GML_Reference/Variable_Functions/int64.htm">int64</a> function)</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs">steam_sub = <span class="hljs-built_in">steam_ugc_unsubscribe_item</span>(<span class="hljs-literal">global</span>.pubFileID);</pre><p> The above code will unsubscribe (and remove) the item with the file ID stored in the global variable &quot;pubFileID&quot;.</p>
<!-- KEYWORDS
steam_ugc_unsubscribe_item
-->
<!-- TAGS
steam_ugc_unsubscribe_item
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_ugc_num_subscribed_items">steam_ugc_num_subscribed_items</h1>
<p> This function can be used to get the number of items that the current user has subscribed to.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs"><span class="hljs-built_in">steam_ugc_num_subscribed_items</span>();</pre><p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Real</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs">numSub = <span class="hljs-built_in">steam_ugc_num_subscribed_items</span>();</pre><p> The above code will store the number of subscribed items in a variable.</p>
<!-- KEYWORDS
steam_ugc_num_subscribed_items
-->
<!-- TAGS
steam_ugc_num_subscribed_items
-->
<p><br><br></p>
<p>---<!--<div class="body-scroll" style="top: 150px;">--></p>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_ugc_get_subscribed_items">steam_ugc_get_subscribed_items</h1>
<pre class="hljs">This <span class="hljs-keyword">function</span> will populate a DS list <span class="hljs-keyword">with</span> <span class="hljs-keyword">all</span> the published file IDs <span class="hljs-keyword">for</span> the items that the <span class="hljs-keyword">user</span> <span class="hljs-keyword">is</span> currently subscribed <span class="hljs-keyword">to</span>. You must first <span class="hljs-keyword">create</span> the list <span class="hljs-keyword">and</span> store the <span class="hljs-keyword">index</span> <span class="hljs-keyword">in</span> a variable, <span class="hljs-keyword">then</span> pass this <span class="hljs-keyword">to</span> the <span class="hljs-keyword">function</span>.
The <span class="hljs-keyword">function</span> will <span class="hljs-keyword">return</span> ```<span class="hljs-keyword">true</span>` <span class="hljs-keyword">if</span> everything <span class="hljs-keyword">is</span> correct <span class="hljs-keyword">and</span> the Steam API <span class="hljs-keyword">is</span> initialized, <span class="hljs-keyword">or</span> `<span class="hljs-keyword">false</span>` <span class="hljs-keyword">if</span> there <span class="hljs-keyword">is</span> an error.</pre><p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs"><span class="hljs-built_in">steam_ugc_get_subscribed_items</span>(item_list);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>item_list</td>
<td>DS List ID</td>
<td>A (previously created) <a href="https://manual.yoyogames.com/GameMaker_Language/GML_Reference/Data_Structures/DS_Lists/DS_Lists.htm">DS list</a> index.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Bool</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs">steam_list = <span class="hljs-built_in">ds_list_create</span>();
<span class="hljs-built_in">steam_ugc_get_subscribed_items</span>(steam_list);</pre><pre class="hljs">The above code will <span class="hljs-built_in">create</span> <span class="hljs-keyword">an</span> <span class="hljs-literal">empty</span> DS list <span class="hljs-keyword">and</span> <span class="hljs-keyword">then</span> populate <span class="hljs-keyword">it</span> <span class="hljs-keyword">with</span> <span class="hljs-keyword">the</span> <span class="hljs-built_in">file</span> IDs <span class="hljs-keyword">for</span> all subscribed <span class="hljs-keyword">items</span> <span class="hljs-keyword">for</span> <span class="hljs-keyword">the</span> user.
&lt;!<span class="hljs-comment">-- KEYWORDS</span></pre><p>steam_ugc_get_subscribed_items
--&gt;<!-- TAGS
steam_ugc_get_subscribed_items
-->
<br><br></p>
<p>---<!--<div class="body-scroll" style="top: 150px;">--></p>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_ugc_get_item_install_info">steam_ugc_get_item_install_info</h1>
<pre class="hljs">This <span class="hljs-keyword">function</span> can be used <span class="hljs-keyword">to</span> retrieve information about any given published file <span class="hljs-type">item</span> that has been subscribed <span class="hljs-keyword">to</span> <span class="hljs-keyword">and</span> downloaded <span class="hljs-keyword">to</span> the Steam local storage area <span class="hljs-keyword">for</span> your game. You give the <span class="hljs-type">item</span> ID <span class="hljs-keyword">and</span> supply the index <span class="hljs-keyword">to</span> an<span class="hljs-built_in"> empty</span> [DS <span class="hljs-keyword">map</span>](https://manual.yoyogames.com/GameMaker_Language/GML_Reference/Data_Structures/DS_Maps/DS_Maps.htm) which will <span class="hljs-keyword">then</span> be populated with the install information (see table below).
If the <span class="hljs-type">item</span><span class="hljs-built_in"> exists</span> (ie.: <span class="hljs-keyword">as</span> been subscribed <span class="hljs-keyword">and</span> download was complete) <span class="hljs-keyword">then</span> the <span class="hljs-keyword">function</span> will <span class="hljs-keyword">return</span> <span class="hljs-built_in">`true</span>` <span class="hljs-keyword">and</span> populate the <span class="hljs-keyword">map</span>, otherwise it will <span class="hljs-keyword">return</span> <span class="hljs-built_in">`false</span>` <span class="hljs-keyword">and</span> the <span class="hljs-keyword">map</span> will remain<span class="hljs-built_in"> empty</span>.</pre><p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs"><span class="hljs-built_in">steam_ugc_get_item_install_info</span>(published_file_id, info_map);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>published_file_id</td>
<td>int64</td>
<td>The unique handle for the UGC to be updated.</td>
</tr>
<tr>
<td>info_map</td>
<td>DS Map ID</td>
<td>A (previously created) DS map index.</td>
</tr>
</tbody>
</table>
<table>
<thead>
<tr>
<th>Key</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>size_on_disk</td>
<td>real</td>
<td>The file size on disk (in bytes)</td>
</tr>
<tr>
<td>legacy_item</td>
<td>bool</td>
<td>Will be <code>true</code> or <code>false</code> depending on whether it is a legacy file or not</td>
</tr>
<tr>
<td>folder</td>
<td>string</td>
<td>This is the full path to the installed content ( please refer to &quot;Item Installation&quot; in Steam SDK docs, as &quot;legacy&quot; items uploaded with the old method, are treated differently)</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Bool</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">var</span> item_map = <span class="hljs-built_in">ds_map_create</span>();
<span class="hljs-built_in">steam_ugc_get_item_install_info</span>(<span class="hljs-literal">global</span>.fileID, item_map);</pre><pre class="hljs">The <span class="hljs-keyword">above</span> code will query <span class="hljs-keyword">the</span> install status <span class="hljs-keyword">of</span> <span class="hljs-keyword">the</span> <span class="hljs-built_in">item</span> indexed <span class="hljs-keyword">in</span> <span class="hljs-keyword">the</span> <span class="hljs-keyword">global</span> variable &amp;quot;fileID&amp;quot;, using a `DS Map` <span class="hljs-keyword">to</span> store <span class="hljs-keyword">the</span> information.
&lt;!<span class="hljs-comment">-- KEYWORDS</span></pre><p>steam_ugc_get_item_install_info
--&gt;<!-- TAGS
steam_ugc_get_item_install_info
-->
<br><br></p>
<p>---<!--<div class="body-scroll" style="top: 150px;">--></p>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_ugc_get_item_update_info">steam_ugc_get_item_update_info</h1>
<pre class="hljs">This <span class="hljs-keyword">function</span> can be used <span class="hljs-keyword">to</span> retrieve information about the current download state <span class="hljs-keyword">for</span> the given file ID. You give the <span class="hljs-type">item</span> ID <span class="hljs-keyword">and</span> supply the index <span class="hljs-keyword">to</span> an<span class="hljs-built_in"> empty</span> [DS <span class="hljs-keyword">map</span>](https://manual.yoyogames.com/GameMaker_Language/GML_Reference/Data_Structures/DS_Maps/DS_Maps.htm) which will <span class="hljs-keyword">then</span> be populated with the <span class="hljs-keyword">update</span> information (see table below).
If the <span class="hljs-type">item</span><span class="hljs-built_in"> exists</span> <span class="hljs-keyword">then</span> the <span class="hljs-keyword">function</span> will <span class="hljs-keyword">return</span> <span class="hljs-built_in">`true</span>` <span class="hljs-keyword">and</span> populate the <span class="hljs-keyword">map</span>, otherwise it will <span class="hljs-keyword">return</span> <span class="hljs-built_in">`false</span>` <span class="hljs-keyword">and</span> the <span class="hljs-keyword">map</span> will remain<span class="hljs-built_in"> empty</span>.</pre><p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs"><span class="hljs-built_in">steam_ugc_get_item_update_info</span>(published_file_id, info_map);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>published_file_id</td>
<td>int64</td>
<td>The unique file ID for the UGC to be checked.</td>
</tr>
<tr>
<td>info_map</td>
<td>DS Map ID</td>
<td>A (previously created) DS map index.</td>
</tr>
</tbody>
</table>
<table>
<thead>
<tr>
<th>Key</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>needs_update</td>
<td>bool</td>
<td>Whether the item needs an update or not</td>
</tr>
<tr>
<td>is_downloading</td>
<td>bool</td>
<td>Whether the item is currently downloading or not</td>
</tr>
<tr>
<td>bytes_downloaded</td>
<td>real</td>
<td>The number of bytes that has been downloaded</td>
</tr>
<tr>
<td>bytes_total</td>
<td>real</td>
<td>The total size (number of bytes) required for the item on disk</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Bool</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">var</span> info_map = <span class="hljs-built_in">ds_map_create</span>();
<span class="hljs-keyword">var</span> info = <span class="hljs-built_in">steam_ugc_get_item_update_info</span>(<span class="hljs-literal">global</span>.fileID, info_map);
<span class="hljs-keyword">if</span> info
{
<span class="hljs-built_in">draw_text</span>(<span class="hljs-number">32</span>, <span class="hljs-number">15</span>, <span class="hljs-string">&quot;needs_update: &quot;</span> + <span class="hljs-built_in">string</span>(info_map[? <span class="hljs-string">&quot;needs_update&quot;</span>]));
<span class="hljs-built_in">draw_text</span>(<span class="hljs-number">32</span>, <span class="hljs-number">30</span>, <span class="hljs-string">&quot;is_downloading: &quot;</span> + <span class="hljs-built_in">string</span>(info_map[? <span class="hljs-string">&quot;is_downloading&quot;</span>]));
<span class="hljs-built_in">draw_text</span>(<span class="hljs-number">32</span>, <span class="hljs-number">45</span>, <span class="hljs-string">&quot;bytes_downloaded: &quot;</span> + <span class="hljs-built_in">string</span>(info_map[? <span class="hljs-string">&quot;bytes_downloaded&quot;</span>]));
<span class="hljs-built_in">draw_text</span>(<span class="hljs-number">32</span>, <span class="hljs-number">60</span>, <span class="hljs-string">&quot;bytes_total: &quot;</span> + <span class="hljs-built_in">string</span>(info_map[? <span class="hljs-string">&quot;bytes_total&quot;</span>]));
}</pre><pre class="hljs">The <span class="hljs-keyword">above</span> code will query <span class="hljs-keyword">the</span> download status <span class="hljs-keyword">of</span> <span class="hljs-keyword">the</span> <span class="hljs-built_in">item</span> indexed <span class="hljs-keyword">in</span> <span class="hljs-keyword">the</span> <span class="hljs-keyword">global</span> variable &amp;quot;fileID&amp;quot;, using a `DS Map` <span class="hljs-keyword">to</span> store <span class="hljs-keyword">the</span> information.
&lt;!<span class="hljs-comment">-- KEYWORDS</span></pre><p>steam_ugc_get_item_update_info
--&gt;<!-- TAGS
steam_ugc_get_item_update_info
-->
<br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_ugc_request_item_details">steam_ugc_request_item_details</h1>
<p> This function can be used to retrieve information about a given file ID. You give the file ID and supply a maximum age for checking (see the Steam docs for more information).
This is an asynchronous function that will return an asynchronous id and trigger the <a href="https://manual-en.yoyogames.com/The_Asset_Editors/Object_Properties/Async_Events/Steam.htm">Steam Async Event</a> when the task is finished.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs"><span class="hljs-built_in">steam_ugc_request_item_details</span>(published_file_id, max_age_seconds);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>published_file_id</td>
<td>real</td>
<td>The unique file ID for the UGC to be checked.</td>
</tr>
<tr>
<td>max_age_seconds</td>
<td>real</td>
<td>The age of the data to check (recommended 30 - 60 seconds).</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Real</pre><p><br></p>
<p><strong>Triggers:</strong></p>
<pre class="hljs">Asynchronous Steam Event</pre><table>
<thead>
<tr>
<th>Key</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>id</td>
<td>real</td>
<td>The asynchronous request ID</td>
</tr>
<tr>
<td>event_type</td>
<td>string</td>
<td>The string value <code>&quot;ugc_item_details&quot;</code></td>
</tr>
<tr>
<td>result</td>
<td>real</td>
<td>This will either be the GML constant <code>ugc_result_success</code> or some other real number (see the<a href="https://partner.steamgames.com/doc/api/steam_api#EResult">Steam docs</a>, for more details)</td>
</tr>
<tr>
<td>cached_data</td>
<td>bool</td>
<td>Will be <code>true</code> if the returned details are from the local cache or <code>false</code> if they are taken from the server</td>
</tr>
<tr>
<td>published_file_id</td>
<td>int64</td>
<td>This key holds the unique published ID for the item (you may need to cast it using the <a href="https://manual.yoyogames.com/GameMaker_Language/GML_Reference/Variable_Functions/int64.htm">int64</a> function)</td>
</tr>
<tr>
<td>file_type</td>
<td>string</td>
<td>The type of file used</td>
</tr>
<tr>
<td>creator_app_id</td>
<td>real</td>
<td>The Steam ID of the item creator</td>
</tr>
<tr>
<td>consumer_app_id</td>
<td>real</td>
<td>The Steam ID of the item consumer</td>
</tr>
<tr>
<td>title</td>
<td>string</td>
<td>The title of the item</td>
</tr>
<tr>
<td>description</td>
<td>string</td>
<td>The description of the item</td>
</tr>
<tr>
<td>steam_id_owner</td>
<td>real</td>
<td>The Steam ID of the item owner</td>
</tr>
<tr>
<td>time_created</td>
<td>real</td>
<td>The time the item was first created</td>
</tr>
<tr>
<td>time_uploaded</td>
<td>real</td>
<td>The last time the item was updated</td>
</tr>
<tr>
<td>time_added_to_user_list</td>
<td>real</td>
<td>The time that the item was subscribed to</td>
</tr>
<tr>
<td>visibility</td>
<td>constant.UGCFileVisibility</td>
<td>The visibility of the item (see <a href="#ugcfilevisibility">UGCFileVisibility</a> constant)</td>
</tr>
<tr>
<td>banned</td>
<td>bool</td>
<td>Whether the item has been banned or not</td>
</tr>
<tr>
<td>accepted_for_use</td>
<td>bool</td>
<td>Whether the item has been accepted for use or not</td>
</tr>
<tr>
<td>tags_truncated</td>
<td>array</td>
<td>Short version of the tags as an array</td>
</tr>
<tr>
<td>tags</td>
<td>array</td>
<td>An array of the tags for the item</td>
</tr>
<tr>
<td>handle_file</td>
<td>int64</td>
<td>The unique file handle for the item</td>
</tr>
<tr>
<td>handle_preview_file</td>
<td>int64</td>
<td>The unique handle for the image preview for the item (can be used with <a href="#steam_ugc_download">steam_ugc_download</a> to download a preview image)</td>
</tr>
<tr>
<td>filename</td>
<td>string</td>
<td>The name of the item file</td>
</tr>
<tr>
<td>file_size</td>
<td>real</td>
<td>The size of the item file</td>
</tr>
<tr>
<td>preview_file_size</td>
<td>real</td>
<td>The size of the preview image</td>
</tr>
<tr>
<td>url</td>
<td>string</td>
<td>The full URL for the item</td>
</tr>
<tr>
<td>up_votes</td>
<td>real</td>
<td>The number of up-votes received</td>
</tr>
<tr>
<td>down_votes</td>
<td>real</td>
<td>The number of down-votes received</td>
</tr>
<tr>
<td>score</td>
<td>real</td>
<td>The overall score of the item</td>
</tr>
<tr>
<td>account_id_owner</td>
<td>real</td>
<td>The account ID from the Steam ID owner (this can be used in function <a href="#steam_ugc_create_query_user_ex">steam_ugc_create_query_user_ex</a>)</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Extended Example:</strong></p>
<p> In this example we send off a details request for an item and then parse the resulting <code>async_load</code> DS map to set some variables. First we send of the request:</p>
<pre class="hljs">steam_details = <span class="hljs-built_in">steam_ugc_request_item_details</span>(<span class="hljs-literal">global</span>.fileID, <span class="hljs-number">60</span>);</pre><p> The above code will request details on the item with the file ID stored in the global variable and will trigger a Steam Async event with the returned information. In this event we can then parse the map and store some of the values in variables which can then be used to display the information to the user:</p>
<pre class="hljs"><span class="hljs-keyword">var</span> map_id = <span class="hljs-symbol">async_load</span>[? <span class="hljs-string">&quot;id&quot;</span>];
<span class="hljs-keyword">var</span> result = <span class="hljs-symbol">async_load</span>[? <span class="hljs-string">&quot;result&quot;</span>];
<span class="hljs-keyword">if</span> (map_id == steam_details) &amp;&amp; (result == <span class="hljs-literal">ugc_result_success</span>)
{
mTitle = <span class="hljs-symbol">async_load</span>[? <span class="hljs-string">&quot;title&quot;</span>];
mDesc = <span class="hljs-symbol">async_load</span>[? <span class="hljs-string">&quot;description&quot;</span>];
mTags = <span class="hljs-symbol">async_load</span>[? <span class="hljs-string">&quot;tags&quot;</span>];
m_hPreviewFile = <span class="hljs-symbol">async_load</span>[? <span class="hljs-string">&quot;handle_preview_file&quot;</span>];
m_hOwnerSteamId = <span class="hljs-symbol">async_load</span>[? <span class="hljs-string">&quot;steam_id_owner&quot;</span>];
mOwnerAccountId = <span class="hljs-symbol">async_load</span>[? <span class="hljs-string">&quot;account_id_owner&quot;</span>];
mPubFileId = <span class="hljs-symbol">async_load</span>[? <span class="hljs-string">&quot;published_file_id&quot;</span>];
mScore = <span class="hljs-symbol">async_load</span>[? <span class="hljs-string">&quot;score&quot;</span>];
}</pre> <!-- KEYWORDS
steam_ugc_request_item_details
-->
<!-- TAGS
steam_ugc_request_item_details
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_ugc_create_query_user">steam_ugc_create_query_user</h1>
<p> This function can be used to query the UGC data base. The function automatically uses the default ID for the app, user and assumes that the query is being done by the consumer (rather than the creator). The function requires you to use the following constants for the type of data to query (<a href="#ugclisttype">UGCListType</a>), the type of item to match (<a href="#ugcmatchtype">UGCMatchType</a>) and the order in which the returned items will be sorted (<a href="#ugclistsortorder">UGCListSortOrder</a>), as well as a page number - note that a query will return a <i>maximum</i> number of 50 items.
The function returns a unique query handle value which should be stored in a variable for use in the other query functions. Note that this function only prepares the query but does not actually send it - for that you must call the function <a href="#steam_ugc_send_query">steam_ugc_send_query</a> - and you can use further <code>steam_ugc_query_*()</code> functions to refine the search request before it is actually sent.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs"><span class="hljs-built_in">steam_ugc_create_query_user</span>(list_type, match_type, sort_order, page);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>list_type</td>
<td>constant.UGCListType</td>
<td>The type of data list to create (see <a href="#ugclisttype">UGCListType</a> constants)</td>
</tr>
<tr>
<td>match_type</td>
<td>constant.UGCMatchType</td>
<td>The type of UGC items to query (see <a href="#ugcmatchtype">UGCMatchType</a> constants)</td>
</tr>
<tr>
<td>sort_order</td>
<td>constant.UGCListSortOrder</td>
<td>The way that data should be ordered (see <a href="#ugclistsortorder">UGCListSortOrder</a> constants)</td>
</tr>
<tr>
<td>page</td>
<td>real</td>
<td>The page number to query.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Real</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs">query_handle = <span class="hljs-built_in">steam_ugc_create_query_user</span>(<span class="hljs-literal">ugc_list_Published</span>, <span class="hljs-literal">ugc_match_Items</span>, <span class="hljs-literal">ugc_sortorder_TitleAsc</span>, <span class="hljs-number">1</span>);</pre><p> The above code creates a query request and stores it&#39;s handle in a variable for future use.</p>
<!-- KEYWORDS
steam_ugc_create_query_user
ugc_list_Published
ugc_list_VotedOn
ugc_list_VotedUp
ugc_list_VotedDown
ugc_list_WillVoteLater
ugc_list_Favorited
ugc_list_Subscribed
ugc_list_UsedOrPlayed
ugc_list_Followed
ugc_match_Items
ugc_match_Items_Mtx
ugc_match_Items_ReadyToUse
ugc_match_Collections
ugc_match_Artwork
ugc_match_Videos
ugc_match_Screenshots
ugc_match_AllGuides
ugc_match_WebGuides
ugc_match_IntegratedGuides
ugc_match_UsableInGame
ugc_match_ControllerBindings
ugc_sortorder_CreationOrderDesc
ugc_sortorder_CreationOrderAsc
ugc_sortorder_TitleAsc
ugc_sortorder_LastUpdatedDesc
ugc_sortorder_SubscriptionDateDesc
ugc_sortorder_VoteScoreDesc
ugc_sortorder_ForModeration
-->
<!-- TAGS
steam_ugc_create_query_user
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_ugc_create_query_user_ex">steam_ugc_create_query_user_ex</h1>
<p> This function can be used to query the UGC data base. The function requires the ID value for the user and the ID of the game that is going to consume the item and/or the ID of the game that created the item. You also need to use the following constants for the type of data to query (<a href="#ugclisttype">UGCListType</a>), the type of item to query (<a href="#ugcmatchtype">UGCMatchType</a>) and the order in which the returned items will be sorted (<a href="#ugclistsortorder">UGCListSortOrder</a>), as well as a page number - note that a query will return a <i>maximum</i> number of 50 items.
The function returns a unique query handle value which should be stored in a variable for use in the other query functions. Note that this function only prepares the query but does not actually send it - for that you must call the function <a href="#steam_ugc_send_query">steam_ugc_send_query</a> - and you can use further <code>steam_ugc_query_*()</code> functions to refine the search request before it is actually sent.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs"><span class="hljs-built_in">steam_ugc_create_query_user_ex</span>(list_type, match_type, sort_order, page, account_id, creator_app_id, consumer_app_id);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>list_type</td>
<td>constant.UGCListType</td>
<td>The type of data list to create (see <a href="#ugclisttype">UGCListType</a> constants)</td>
</tr>
<tr>
<td>match_type</td>
<td>constant.UGCMatchType</td>
<td>The type of UGC items to query (see <a href="#ugcmatchtype">UGCMatchType</a> constants)</td>
</tr>
<tr>
<td>sort_order</td>
<td>constant.UGCListSortOrder</td>
<td>The way that data should be ordered (see <a href="#ugclistsortorder">UGCListSortOrder</a> constants)</td>
</tr>
<tr>
<td>page</td>
<td>real</td>
<td>The page number to query</td>
</tr>
<tr>
<td>account_id</td>
<td>real</td>
<td>The Steam account ID</td>
</tr>
<tr>
<td>creator_app_id</td>
<td>real</td>
<td>The item creator app ID</td>
</tr>
<tr>
<td>consumer_app_id</td>
<td>real</td>
<td>The consumer app ID</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Real</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs">query_handle = <span class="hljs-built_in">steam_ugc_create_query_user_ex</span>(<span class="hljs-literal">ugc_list_Published</span>, <span class="hljs-literal">ugc_match_Items</span>, <span class="hljs-literal">ugc_sortorder_TitleAsc</span>, page, <span class="hljs-literal">global</span>.AccountID, <span class="hljs-number">0</span>, <span class="hljs-literal">global</span>.GameID);</pre><p> The above code creates a query request and stores it&#39;s handle in a variable for future use.</p>
<!-- KEYWORDS
steam_ugc_create_query_user_ex
ugc_list_Published
ugc_list_VotedOn
ugc_list_VotedUp
ugc_list_VotedDown
ugc_list_WillVoteLater
ugc_list_Favorited
ugc_list_Subscribed
ugc_list_UsedOrPlayed
ugc_list_Followed
ugc_match_Items
ugc_match_Items_Mtx
ugc_match_Items_ReadyToUse
ugc_match_Collections
ugc_match_Artwork
ugc_match_Videos
ugc_match_Screenshots
ugc_match_AllGuides
ugc_match_WebGuides
ugc_match_IntegratedGuides
ugc_match_UsableInGame
ugc_match_ControllerBindings
ugc_sortorder_CreationOrderDesc
ugc_sortorder_CreationOrderAsc
ugc_sortorder_TitleAsc
ugc_sortorder_LastUpdatedDesc
ugc_sortorder_SubscriptionDateDesc
ugc_sortorder_VoteScoreDesc
ugc_sortorder_ForModeration
-->
<!-- TAGS
steam_ugc_create_query_user_ex
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_ugc_create_query_all">steam_ugc_create_query_all</h1>
<p> This function can be used to query the UGC data base using some predefined query types. The function requires the following constants for the type of query to create (<a href="#UGCQueryType">UGCQueryType</a>), the type of item to match (<a href="#ugcmatchtype">UGCMatchType</a>) and the page number to query - note that a query will return a <i>maximum</i> number of 50 items.
The function returns a unique query handle value which should be stored in a variable for use in the other query functions. Note that this function only prepares the query but does not actually send it - for that you must call the function <a href="#steam_ugc_send_query">steam_ugc_send_query</a> - and you can use further <code>steam_ugc_query_*()</code> functions to refine the search request before it is actually sent.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs"><span class="hljs-built_in">steam_ugc_create_query_all</span>(query_type, match_type, page);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>query_type</td>
<td>constant.UGCQueryType</td>
<td>The type of query to create (see <a href="#UGCQueryType">UGCQueryType</a> constants)</td>
</tr>
<tr>
<td>match_type</td>
<td>constant.UGCMatchType</td>
<td>The type of UGC items to query (see <a href="#ugcmatchtype">UGCMatchType</a> constants)</td>
</tr>
<tr>
<td>page</td>
<td>real</td>
<td>The page number to query</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Real</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs">query_handle = <span class="hljs-built_in">steam_ugc_create_query_all</span>(<span class="hljs-literal">ugc_query_RankedByVote</span>, <span class="hljs-literal">ugc_match_Items</span>, <span class="hljs-number">1</span>);</pre><p> The above code creates a general query request and stores it&#39;s handle in a variable for future use.</p>
<!-- KEYWORDS
steam_ugc_create_query_all
ugc_query_RankedByVote
ugc_query_RankedByPublicationDate
ugc_query_AcceptedForGameRankedByAcceptanceDate
ugc_query_RankedByTrend
ugc_query_FavoritedByFriendsRankedByPublicationDate
ugc_query_CreatedByFriendsRankedByPublicationDate
ugc_query_RankedByNumTimesReported
ugc_query_CreatedByFollowedUsersRankedByPublicationDate
ugc_query_NotYetRated
ugc_query_RankedByTotalVotesAsc
ugc_query_RankedByVotesUp
ugc_query_RankedByTextSearch
ugc_match_Items
ugc_match_Items_Mtx
ugc_match_Items_ReadyToUse
ugc_match_Collections
ugc_match_Artwork
ugc_match_Videos
ugc_match_Screenshots
ugc_match_AllGuides
ugc_match_WebGuides
ugc_match_IntegratedGuides
ugc_match_UsableInGame
ugc_match_ControllerBindings
-->
<!-- TAGS
steam_ugc_create_query_all
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_ugc_create_query_all_ex">steam_ugc_create_query_all_ex</h1>
<p> This function can be used to query the UGC data base. The function requires the ID of the game that is going to consume the item and/or the ID of the game that created the item, and you need to use the following constants for the type of query to create (<a href="#UGCQueryType">UGCQueryType</a>), the type of item to match (<a href="#ugcmatchtype">UGCMatchType</a>) and the page number to query. Note that a query will return a <i>maximum</i> number of 50 items.
The function returns a unique query handle value which should be stored in a variable for use in the other query functions. Note that this function only prepares the query but does not actually send it - for that you must call the function <a href="#steam_ugc_send_query">steam_ugc_send_query</a> - and you can use further <code>steam_ugc_query_*()</code> functions to refine the search request before it is actually sent.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs"><span class="hljs-built_in">steam_ugc_create_query_all_ex</span>(query_type, match_type, page, creator_app_id, consumer_app_id);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>query_type</td>
<td>constant.UGCQueryType</td>
<td>The type of query to create (see <a href="#UGCQueryType">UGCQueryType</a> constants)</td>
</tr>
<tr>
<td>match_type</td>
<td>constant.UGCMatchType</td>
<td>The type of UGC items to query (see <a href="#ugcmatchtype">UGCMatchType</a> constants)</td>
</tr>
<tr>
<td>page</td>
<td>real</td>
<td>The page number to query</td>
</tr>
<tr>
<td>creator_app_id</td>
<td>integer</td>
<td>The item creator app ID</td>
</tr>
<tr>
<td>consumer_app_id</td>
<td>integer</td>
<td>The consumer app ID</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Real</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs">query_handle = <span class="hljs-built_in">steam_ugc_create_query_all_ex</span>(<span class="hljs-literal">ugc_query_RankedByVote</span>, page, <span class="hljs-literal">global</span>.AccountID, <span class="hljs-number">0</span>, <span class="hljs-literal">global</span>.GameID);</pre><p> The above code creates a query request and stores it&#39;s handle in a variable for future use.</p>
<!-- KEYWORDS
steam_ugc_create_query_all_ex
ugc_query_RankedByVote
ugc_query_RankedByPublicationDate
ugc_query_AcceptedForGameRankedByAcceptanceDate
ugc_query_RankedByTrend
ugc_query_FavoritedByFriendsRankedByPublicationDate
ugc_query_CreatedByFriendsRankedByPublicationDate
ugc_query_RankedByNumTimesReported
ugc_query_CreatedByFollowedUsersRankedByPublicationDate
ugc_query_NotYetRated
ugc_query_RankedByTotalVotesAsc
ugc_query_RankedByVotesUp
ugc_query_RankedByTextSearch
ugc_match_Items
ugc_match_Items_Mtx
ugc_match_Items_ReadyToUse
ugc_match_Collections
ugc_match_Artwork
ugc_match_Videos
ugc_match_Screenshots
ugc_match_AllGuides
ugc_match_WebGuides
ugc_match_IntegratedGuides
ugc_match_UsableInGame
ugc_match_ControllerBindings
-->
<!-- TAGS
steam_ugc_create_query_all_ex
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_ugc_query_set_cloud_filename_filter">steam_ugc_query_set_cloud_filename_filter</h1>
<p> This function can be used to further filter any given UGC query, specifically to check and see if a Workshop item file name must match or not. The query handle is the value returned when you created the query (using, for example, <a href="#steam_ugc_create_query_user">steam_ugc_create_query_user</a>) and the second argument is either <code>true</code> or<code>false`</code> <code>depending on whether you require the file names to match.
The function will return</code>true<code>if the query filter was correctly set, or</code>false` otherwise.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs"><span class="hljs-built_in">steam_ugc_query_set_cloud_filename_filter</span>(ugc_query_handle, should_match);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>ugc_query_handle</td>
<td>integer</td>
<td>The query handle to use.</td>
</tr>
<tr>
<td>match_cloud_filename</td>
<td>bool</td>
<td>Sets whether the UGC item file name should match or not.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Bool</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">var</span> query_handle = <span class="hljs-built_in">steam_ugc_create_query_all</span>(<span class="hljs-literal">ugc_query_RankedByVote</span>, <span class="hljs-literal">ugc_match_Items</span>, <span class="hljs-number">1</span>);
<span class="hljs-built_in">steam_ugc_query_set_cloud_filename_filter</span>(query_handle, <span class="hljs-literal">true</span>);
<span class="hljs-built_in">steam_ugc_query_add_excluded_tag</span>(query_handle, <span class="hljs-string">&quot;nasty chips&quot;</span>);
<span class="hljs-built_in">steam_ugc_query_set_return_long_description</span>(query_handle, <span class="hljs-literal">true</span>);
<span class="hljs-built_in">steam_ugc_query_set_allow_cached_response</span>(query_handle, <span class="hljs-literal">true</span>);
query_ID = <span class="hljs-built_in">steam_ugc_send_query</span>(query_handle);</pre><p> The above code creates a query request and stores it&#39;s handle in a local variable for future use in the rest of the functions which further define the query request before sending the query.</p>
<!-- KEYWORDS
steam_ugc_query_set_cloud_filename_filter
-->
<!-- TAGS
steam_ugc_query_set_cloud_filename_filter
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_ugc_query_set_match_any_tag">steam_ugc_query_set_match_any_tag</h1>
<p> This function can be used to further filter any given UGC query, specifically to switch on or off tag matching. The query handle is the value returned when you created the query (using, for example, <a href="#steam_ugc_create_query_user">steam_ugc_create_query_user</a>) and the second argument is either <code>true</code> or<code>false``</code>depending on whether you require a check for matching tags.
The function will return <code>true</code> if the query filter was correctly set, or <code>false</code> otherwise.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs"><span class="hljs-built_in">steam_ugc_query_set_match_any_tag</span>(ugc_query_handle, match_any_tag);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>ugc_query_handle</td>
<td>integer</td>
<td>The query handle to use.</td>
</tr>
<tr>
<td>match_any_tag</td>
<td>bool</td>
<td>Sets whether the UGC item tags should match anything or not.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Bool</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">var</span> query_handle = <span class="hljs-built_in">steam_ugc_create_query_all</span>(<span class="hljs-literal">ugc_query_RankedByVote</span>, <span class="hljs-literal">ugc_match_Items</span>, <span class="hljs-number">1</span>);
<span class="hljs-built_in">steam_ugc_query_set_match_any_tag</span>(query_handle, <span class="hljs-literal">false</span>);
<span class="hljs-built_in">steam_ugc_query_add_excluded_tag</span>(query_handle, <span class="hljs-string">&quot;walking simulator&quot;</span>);
<span class="hljs-built_in">steam_ugc_query_set_return_long_description</span>(query_handle, <span class="hljs-literal">true</span>);
<span class="hljs-built_in">steam_ugc_query_set_allow_cached_response</span>(query_handle, <span class="hljs-literal">true</span>);
query_ID = <span class="hljs-built_in">steam_ugc_send_query</span>(query_handle);</pre><p> The above code creates a query request and stores it&#39;s handle in a local variable for future use in the rest of the functions which further define the query request before sending the query.</p>
<!-- KEYWORDS
steam_ugc_query_set_match_any_tag
-->
<!-- TAGS
steam_ugc_query_set_match_any_tag
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_ugc_query_set_search_text">steam_ugc_query_set_search_text</h1>
<p> This function can be used to further filter any given UGC query, specifically to search for the given string in the title and description of the UGC items. The query handle is the value returned when you created the query (using, for example, <a href="#steam_ugc_create_query_user">steam_ugc_create_query_user</a>) and the second argument is a string you want to use as the search term.
The function will return <code>true</code> if the query filter was correctly set, or <code>false</code> otherwise.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs"><span class="hljs-built_in">steam_ugc_query_set_search_text</span>(ugc_query_handle , search_text);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>ugc_query_handle</td>
<td>real</td>
<td>The query handle to use.</td>
</tr>
<tr>
<td>search_text</td>
<td>string</td>
<td>The search text to use for the query.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Bool</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">var</span> query_handle = <span class="hljs-built_in">steam_ugc_create_query_all</span>(<span class="hljs-literal">ugc_query_RankedByVote</span>, <span class="hljs-literal">ugc_match_Items</span>, <span class="hljs-number">1</span>);
<span class="hljs-built_in">steam_ugc_query_set_search_text</span>(query_handle, <span class="hljs-string">&quot;texture&quot;</span>);
<span class="hljs-built_in">steam_ugc_query_set_return_long_description</span>(query_handle, <span class="hljs-literal">true</span>);
<span class="hljs-built_in">steam_ugc_query_set_allow_cached_response</span>(query_handle, <span class="hljs-literal">true</span>);
query_ID = <span class="hljs-built_in">steam_ugc_send_query</span>(query_handle);</pre><p> The above code creates a query request and stores it&#39;s handle in a local variable for future use in the rest of the functions which further define the query request before sending the query.</p>
<!-- KEYWORDS
steam_ugc_query_set_search_text
-->
<!-- TAGS
steam_ugc_query_set_search_text
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_ugc_query_set_ranked_by_trend_days">steam_ugc_query_set_ranked_by_trend_days</h1>
<p> This function can be used to further filter any UGC query made using the <code>ugc_query_RankedByTrend</code> constant (<a href="#UGCQueryType">UGCQueryType</a>), specifically to search over a number of days. The query handle is the value returned when you created the query (using, for example, <a href="#steam_ugc_create_query_user">steam_ugc_create_query_user</a>) and the second argument is the number of days over which you want the query to run.
The function will return <code>true</code> if the query filter was correctly set, or <code>false</code> otherwise.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs"><span class="hljs-built_in">steam_ugc_query_set_ranked_by_trend_days</span>(ugc_query_handle, days);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>ugc_query_handle</td>
<td>real</td>
<td>The query handle to use.</td>
</tr>
<tr>
<td>days</td>
<td>real</td>
<td>The number of days to query.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Bool</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">var</span> query_handle = <span class="hljs-built_in">steam_ugc_create_query_all</span>(<span class="hljs-literal">ugc_query_RankedByTrend</span>, <span class="hljs-literal">ugc_match_Items</span>, <span class="hljs-number">1</span>);
<span class="hljs-built_in">steam_ugc_query_set_ranked_by_trend_days</span>(query_handle, <span class="hljs-number">5</span>);
<span class="hljs-built_in">steam_ugc_query_set_return_long_description</span>(query_handle, <span class="hljs-literal">true</span>);
<span class="hljs-built_in">steam_ugc_query_set_allow_cached_response</span>(query_handle, <span class="hljs-literal">true</span>);
query_ID = <span class="hljs-built_in">steam_ugc_send_query</span>(query_handle);</pre><p> The above code creates a query request and stores it&#39;s handle in a local variable for future use in the rest of the functions which further define the query request before sending the query.</p>
<!-- KEYWORDS
steam_ugc_query_set_ranked_by_trend_days
-->
<!-- TAGS
steam_ugc_query_set_ranked_by_trend_days
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_ugc_query_add_required_tag">steam_ugc_query_add_required_tag</h1>
<p> This function can be used to further filter any given UGC query, specifically to search only those UGC items with the given tag. The query handle is the value returned when you created the query (using, for example, <a href="#steam_ugc_create_query_user">steam_ugc_create_query_user</a>) and the second argument is a string you want to use as the tag to include.
The function will return <code>true</code> if the query filter was correctly set, or <code>false</code> otherwise.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs"><span class="hljs-built_in">steam_ugc_query_add_required_tag</span>(ugc_query_handle, tag_name);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>ugc_query_handle</td>
<td>integer</td>
<td>The query handle to use.</td>
</tr>
<tr>
<td>tag_name</td>
<td>string</td>
<td>The tag name to include.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Bool</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">var</span> query_handle = <span class="hljs-built_in">steam_ugc_create_query_all</span>(<span class="hljs-literal">ugc_query_RankedByTrend</span>, <span class="hljs-literal">ugc_match_Items</span>, <span class="hljs-number">1</span>);
<span class="hljs-built_in">steam_ugc_query_add_required_tag</span>(query_handle, <span class="hljs-string">&quot;RPG&quot;</span>);
<span class="hljs-built_in">steam_ugc_query_set_return_long_description</span>(query_handle, <span class="hljs-literal">true</span>);
<span class="hljs-built_in">steam_ugc_query_set_allow_cached_response</span>(query_handle, <span class="hljs-literal">true</span>);
query_ID = <span class="hljs-built_in">steam_ugc_send_query</span>(query_handle);</pre><p> The above code creates a query request and stores it&#39;s handle in a local variable for future use in the rest of the functions which further define the query request before sending the query.</p>
<!-- KEYWORDS
steam_ugc_query_add_required_tag
-->
<!-- TAGS
steam_ugc_query_add_required_tag
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_ugc_query_add_excluded_tag">steam_ugc_query_add_excluded_tag</h1>
<p> This function can be used to further filter any given UGC query, specifically to exclude a given UGC from the query request. The query handle is the value returned when you created the query (using, for example, <a href="#steam_ugc_create_query_user">steam_ugc_create_query_user</a>) and the second argument is a string you want to use as the tag to exclude.
The function will return <code>true</code> if the query filter was correctly set, or <code>false</code> otherwise.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs"><span class="hljs-built_in">steam_ugc_query_add_excluded_tag</span>(ugc_query_handle, tag_name);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>ugc_query_handle</td>
<td>integer</td>
<td>The query handle to use.</td>
</tr>
<tr>
<td>tag_name</td>
<td>string</td>
<td>The tag name to exclude.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Bool</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">var</span> query_handle = <span class="hljs-built_in">steam_ugc_create_query_all</span>(<span class="hljs-literal">ugc_query_RankedByVote</span>, <span class="hljs-literal">ugc_match_Items</span>, <span class="hljs-number">1</span>);
<span class="hljs-built_in">steam_ugc_query_add_excluded_tag</span>(query_handle, <span class="hljs-string">&quot;walking simulator&quot;</span>);
<span class="hljs-built_in">steam_ugc_query_set_return_long_description</span>(query_handle, <span class="hljs-literal">true</span>);
<span class="hljs-built_in">steam_ugc_query_set_allow_cached_response</span>(query_handle, <span class="hljs-literal">true</span>);
query_ID = <span class="hljs-built_in">steam_ugc_send_query</span>(query_handle);</pre><p> The above code creates a query request and stores it&#39;s handle in a local variable for future use in the rest of the functions which further define the query request before sending the query.</p>
<!-- KEYWORDS
steam_ugc_query_add_excluded_tag
-->
<!-- TAGS
steam_ugc_query_add_excluded_tag
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_ugc_query_set_return_long_description">steam_ugc_query_set_return_long_description</h1>
<p> This function can be used to further filter any given UGC query, specifically to retrieve the long description text in the call back event triggered when the query was sent. The query handle is the value returned when you created the query (using, for example, <a href="#steam_ugc_create_query_user">steam_ugc_create_query_user</a>) and the second argument is either <code>true</code> or<code>false``</code>.
The function will return <code>true</code> if the query filter was correctly set, or <code>false</code> otherwise.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs"><span class="hljs-built_in">steam_ugc_query_set_return_long_description</span>(ugc_query_handle, should_return);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>ugc_query_handle</td>
<td>real</td>
<td>The query handle to use.</td>
</tr>
<tr>
<td>long_description</td>
<td>bool</td>
<td>Whether to have the query return the long description text.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Bool</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">var</span> query_handle = <span class="hljs-built_in">steam_ugc_create_query_all</span>(<span class="hljs-literal">ugc_query_RankedByVote</span>, <span class="hljs-literal">ugc_match_Items</span>, <span class="hljs-number">1</span>);
<span class="hljs-built_in">steam_ugc_query_set_return_long_description</span>(query_handle, <span class="hljs-literal">true</span>);
<span class="hljs-built_in">steam_ugc_query_set_allow_cached_response</span>(query_handle, <span class="hljs-literal">true</span>);
query_ID = <span class="hljs-built_in">steam_ugc_send_query</span>(query_handle);</pre><p> The above code creates a query request and stores it&#39;s handle in a local variable for future use in the rest of the functions which further define the query request before sending the query.</p>
<!-- KEYWORDS
steam_ugc_query_set_return_long_description
-->
<!-- TAGS
steam_ugc_query_set_return_long_description
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_ugc_query_set_return_total_only">steam_ugc_query_set_return_total_only</h1>
<p> This function can be used to further filter any given UGC query, specifically to request only the number of results without any other information (meaning that the DS map generated by the send function will contain the key &quot;num_results&quot; without any further map data). The query handle is the value returned when you created the query (using, for example, <a href="#steam_ugc_create_query_user">steam_ugc_create_query_user</a>) and the second argument is either <code>true</code> or<code>false``</code>.
The function will return <code>true</code> if the query filter was correctly set, or <code>false</code> otherwise.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs"><span class="hljs-built_in">steam_ugc_query_set_return_total_only</span>(ugc_query_handle , total_only);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>ugc_query_handle</td>
<td>real</td>
<td>The query handle to use.</td>
</tr>
<tr>
<td>total_only</td>
<td>bool</td>
<td>Whether to have the query return only the total number of hits or not.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Bool</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">var</span> query_handle = <span class="hljs-built_in">steam_ugc_create_query_all</span>(<span class="hljs-literal">ugc_query_RankedByVote</span>, <span class="hljs-literal">ugc_match_Items</span>, <span class="hljs-number">1</span>);
<span class="hljs-built_in">steam_ugc_query_set_return_total_only</span>(query_handle, <span class="hljs-literal">true</span>);
<span class="hljs-built_in">steam_ugc_query_set_allow_cached_response</span>(query_handle, <span class="hljs-literal">true</span>);
query_ID = <span class="hljs-built_in">steam_ugc_send_query</span>(query_handle);</pre><p> The above code creates a query request and stores it&#39;s handle in a local variable for future use in the rest of the functions which further define the query request before sending the query.</p>
<!-- KEYWORDS
steam_ugc_query_set_return_total_only
-->
<!-- TAGS
steam_ugc_query_set_return_total_only
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_ugc_query_set_allow_cached_response">steam_ugc_query_set_allow_cached_response</h1>
<p> This function can be used to further filter any given UGC query, specifically to request that the query check the local cache rather than online. The query handle is the value returned when you created the query (using, for example, <a href="#steam_ugc_create_query_user">steam_ugc_create_query_user</a>) and the second argument is either <code>true</code> or<code>false````</code>.
The function will return <code>true</code> if the query filter was correctly set, or <code>false</code> otherwise.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs"><span class="hljs-built_in">steam_ugc_query_set_allow_cached_response</span>(ugc_query_handle , check_cache);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>ugc_query_handle</td>
<td>integer</td>
<td>The query handle to use.</td>
</tr>
<tr>
<td>cache</td>
<td>bool</td>
<td>Whether to have the query check the local cache or not.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Bool</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">var</span> query_handle = <span class="hljs-built_in">steam_ugc_create_query_all</span>(<span class="hljs-literal">ugc_query_RankedByTrend</span>, <span class="hljs-literal">ugc_match_Items</span>, <span class="hljs-number">1</span>);
<span class="hljs-built_in">steam_ugc_query_add_required_tag</span>(query_handle, <span class="hljs-string">&quot;RPG&quot;</span>);
<span class="hljs-built_in">steam_ugc_query_set_return_long_description</span>(query_handle, <span class="hljs-literal">true</span>);
<span class="hljs-built_in">steam_ugc_query_set_allow_cached_response</span>(query_handle, <span class="hljs-literal">true</span>);
query_ID = <span class="hljs-built_in">steam_ugc_send_query</span>(query_handle);</pre><p> The above code creates a query request and stores it&#39;s handle in a local variable for future use in the rest of the functions which further define the query request before sending the query.</p>
<!-- KEYWORDS
steam_ugc_query_set_allow_cached_response
-->
<!-- TAGS
steam_ugc_query_set_allow_cached_response
-->
<p><br><br></p>
<p>---<!--<div class="body-scroll" style="top: 150px;">--></p>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_ugc_send_query">steam_ugc_send_query</h1>
<pre class="hljs">This <span class="hljs-keyword">function</span> can be used <span class="hljs-keyword">to</span> send a query request. You <span class="hljs-keyword">first</span> <span class="hljs-keyword">define</span> the query <span class="hljs-keyword">using</span> <span class="hljs-keyword">one</span> <span class="hljs-keyword">of</span> the following <span class="hljs-keyword">function</span>:</pre><ul>
<li><a href="#steam_ugc_create_query_all">steam_ugc_create_query_all</a></li>
<li><a href="#steam_ugc_create_query_all_ex">steam_ugc_create_query_all_ex</a></li>
<li><a href="#steam_ugc_create_query_user">steam_ugc_create_query_user</a></li>
<li><p><a href="#steam_ugc_create_query_user_ex">steam_ugc_create_query_user_ex</a></p>
<p> which will return a query handle. This handle is then used to set filters etc.... before being used in this function to send off the query request.
This is an asynchronous function that will return an asynchronous id and trigger the <a href="https://manual-en.yoyogames.com/The_Asset_Editors/Object_Properties/Async_Events/Steam.htm">Steam Async Event</a> when the task is finished.</p>
</li>
</ul>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs"><span class="hljs-built_in">steam_ugc_send_query</span>(ugc_query_handle);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>ugc_query_handle</td>
<td>real</td>
<td>The query handle to send.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Real</pre><p><br></p>
<p><strong>Triggers:</strong></p>
<pre class="hljs">Asynchronous Steam Event</pre><table>
<thead>
<tr>
<th>Key</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>id</td>
<td>real</td>
<td>The asynchronous request ID</td>
</tr>
<tr>
<td>event_type</td>
<td>string</td>
<td>The string value <code>&quot;ugc_query&quot;</code></td>
</tr>
<tr>
<td>result</td>
<td>real</td>
<td>This will either be the GML constant <code>ugc_result_success</code> or some other real number (see the<a href="https://partner.steamgames.com/doc/api/steam_api#EResult">Steam docs</a>, for more details)</td>
</tr>
<tr>
<td>cached_data</td>
<td>bool</td>
<td>Will be <code>true</code> if the returned details are from the local cache or <code>false</code> if they are taken from the server</td>
</tr>
<tr>
<td>total_matching</td>
<td>real</td>
<td>The total number of matching results</td>
</tr>
<tr>
<td>num_results</td>
<td>real</td>
<td>The number of results returned (max 50)</td>
</tr>
<tr>
<td>results_list</td>
<td>DS List ID</td>
<td>A <a href="https://manual.yoyogames.com/GameMaker_Language/GML_Reference/Data_Structures/DS_Lists/DS_Lists.htm">DS list</a> index, where each list entry is a DS Map index containing details of the particular item (see table below)</td>
</tr>
</tbody>
</table>
<table>
<thead>
<tr>
<th>Key</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>published_file_id</td>
<td>int64</td>
<td>This key holds the unique published ID for the item (you may need to cast it using the <a href="https://manual.yoyogames.com/GameMaker_Language/GML_Reference/Variable_Functions/int64.htm">int64</a> function)</td>
</tr>
<tr>
<td>file_type</td>
<td>string</td>
<td>The type of file used</td>
</tr>
<tr>
<td>creator_app_id</td>
<td>real</td>
<td>The Steam ID of the item creator</td>
</tr>
<tr>
<td>consumer_app_id</td>
<td>real</td>
<td>The Steam ID of the item consumer</td>
</tr>
<tr>
<td>title</td>
<td>string</td>
<td>The title of the item</td>
</tr>
<tr>
<td>description</td>
<td>string</td>
<td>The description of the item</td>
</tr>
<tr>
<td>steam_id_owner</td>
<td>real</td>
<td>The Steam ID of the item owner</td>
</tr>
<tr>
<td>time_created</td>
<td>real</td>
<td>The time the item was first created</td>
</tr>
<tr>
<td>time_uploaded</td>
<td>real</td>
<td>The last time the item was updated</td>
</tr>
<tr>
<td>time_added_to_user_list</td>
<td>real</td>
<td>The time that the item was subscribed to</td>
</tr>
<tr>
<td>visibility</td>
<td>constant.UGCFileVisibility</td>
<td>The visibility of the item (see <a href="#ugcfilevisibility">UGCFileVisibility</a> constant)</td>
</tr>
<tr>
<td>banned</td>
<td>bool</td>
<td>Whether the item has been banned or not</td>
</tr>
<tr>
<td>accepted_for_use</td>
<td>bool</td>
<td>Whether the item has been accepted for use or not</td>
</tr>
<tr>
<td>tags_truncated</td>
<td>array</td>
<td>Short version of the tags as an array</td>
</tr>
<tr>
<td>tags</td>
<td>array</td>
<td>An array of the tags for the item</td>
</tr>
<tr>
<td>handle_file</td>
<td>int64</td>
<td>The unique file handle for the item</td>
</tr>
<tr>
<td>handle_preview_file</td>
<td>int64</td>
<td>The unique handle for the image preview for the item (can be used with <a href="#steam_ugc_download">steam_ugc_download</a> to download a preview image)</td>
</tr>
<tr>
<td>filename</td>
<td>string</td>
<td>The name of the item file</td>
</tr>
<tr>
<td>file_size</td>
<td>real</td>
<td>The size of the item file</td>
</tr>
<tr>
<td>preview_file_size</td>
<td>real</td>
<td>The size of the preview image</td>
</tr>
<tr>
<td>url</td>
<td>string</td>
<td>The full URL for the item</td>
</tr>
<tr>
<td>up_votes</td>
<td>real</td>
<td>The number of up-votes received</td>
</tr>
<tr>
<td>down_votes</td>
<td>real</td>
<td>The number of down-votes received</td>
</tr>
<tr>
<td>score</td>
<td>real</td>
<td>The overall score of the item</td>
</tr>
<tr>
<td>account_id_owner</td>
<td>real</td>
<td>The account ID from the Steam ID owner (can be used in the function <a href="#steam_ugc_create_query_user">steam_ugc_create_query_user</a>)</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">var</span> query_handle = <span class="hljs-built_in">steam_ugc_create_query_all</span>(<span class="hljs-literal">ugc_query_RankedByTrend</span>, <span class="hljs-literal">ugc_match_Items</span>, <span class="hljs-number">1</span>);
<span class="hljs-built_in">steam_ugc_query_add_required_tag</span>(query_handle, <span class="hljs-string">&quot;RPG&quot;</span>);
<span class="hljs-built_in">steam_ugc_query_set_return_long_description</span>(query_handle, <span class="hljs-literal">true</span>);
<span class="hljs-built_in">steam_ugc_query_set_allow_cached_response</span>(query_handle, <span class="hljs-literal">true</span>);
query_ID = <span class="hljs-built_in">steam_ugc_send_query</span>(query_handle);</pre><pre class="hljs">The <span class="hljs-keyword">above</span> code creates a query request <span class="hljs-keyword">and</span> stores <span class="hljs-keyword">it</span>&amp;<span class="hljs-comment">#39;s handle in a local variable for future use in the rest of the functions which further define the query request before sending the query.</span>
&lt;!<span class="hljs-comment">-- KEYWORDS</span></pre><p>steam_ugc_send_query
--&gt;<!-- TAGS
steam_ugc_send_query
-->
<br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_ugc_download">steam_ugc_download</h1>
<p> With this function you can download a preview image for any given UGC item. The <code>ugc_handle</code> is the unique identifying value for the image (which you can get using the function <a href="#steam_ugc_send_query">steam_ugc_send_query</a>), and the destination filename is the name (and local path within the Steam sandbox) that you wish to give the image file when the download is complete.
This is an asynchronous function that will return an asynchronous id and trigger the <a href="https://manual-en.yoyogames.com/The_Asset_Editors/Object_Properties/Async_Events/Steam.htm">Steam Async Event</a> when the task is finished.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs"><span class="hljs-built_in">steam_ugc_download</span>(ugc_handle, dest_filename);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>ugc_handle</td>
<td>int64</td>
<td>The unique handle for the preview to be downloaded.</td>
</tr>
<tr>
<td>dest_filename</td>
<td>string</td>
<td>The file name to save the preview with.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Real</pre><p><br></p>
<p><strong>Triggers:</strong></p>
<pre class="hljs">Asynchronous Steam Event</pre><table>
<thead>
<tr>
<th>Key</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>id</td>
<td>real</td>
<td>The asynchronous request ID</td>
</tr>
<tr>
<td>event_type</td>
<td>string</td>
<td>The string value <code>&quot;ugc_create_item&quot;</code></td>
</tr>
<tr>
<td>result</td>
<td>real</td>
<td>This will either be the GML constant <code>ugc_result_success</code> or some other real number (see the<a href="https://partner.steamgames.com/doc/api/steam_api">Steam docs</a> under <strong>EResult</strong> , for more details)</td>
</tr>
<tr>
<td>original_filename</td>
<td>string</td>
<td>This key holds the original name of the image file <i>on the server</i> (a string)</td>
</tr>
<tr>
<td>dest_filename</td>
<td>string</td>
<td>This key holds the image file name you passed in (a string)</td>
</tr>
<tr>
<td>ugc_handle</td>
<td>integer</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Extended Example:</strong></p>
<p> In this example we first call the function and store the async ID value in a variable:</p>
<pre class="hljs">steam_get = <span class="hljs-built_in">steam_ugc_download</span>(steam_handle, <span class="hljs-string">&quot;\UGC\Preview_file.png&quot;</span>);</pre><p> This would then send off a file request to the Steam API, generating an async event which we would deal with as follows:</p>
<pre class="hljs"><span class="hljs-keyword">var</span> event_id = <span class="hljs-symbol">async_load</span>[? <span class="hljs-string">&quot;id&quot;</span>];
<span class="hljs-keyword">if</span> event_id == steam_get
{
<span class="hljs-keyword">var</span> type = <span class="hljs-symbol">async_load</span>[? <span class="hljs-string">&quot;event_type&quot;</span>];
<span class="hljs-keyword">if</span> type == <span class="hljs-string">&quot;ugc_download&quot;</span>
{
<span class="hljs-built_in">sprite_delete</span>(preview_sprite);
preview_sprite = <span class="hljs-built_in">sprite_add</span>(<span class="hljs-symbol">async_load</span>[? <span class="hljs-string">&quot;dest_filename&quot;</span>], <span class="hljs-number">0</span>, <span class="hljs-literal">false</span>, <span class="hljs-literal">false</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>);
}
}</pre><p> The above code checks the event type and then creates a sprite from the downloaded image.</p>
<!-- KEYWORDS
steam_ugc_download
-->
<!-- TAGS
steam_ugc_download
-->
<p><br><br></p>
<hr>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="ugcfiletype">UGCFileType</h1>
<p> These constants specify the way that a shared file will be shared with the community and should be used while creating a new item with <a href="#steam_ugc_create_item">steam_ugc_create_item</a>.</p>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="information_source" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2139.png"></g-emoji> NOTE</strong></p>
<p>See <a href="https://partner.steamgames.com/doc/api/ISteamRemoteStorage#EWorkshopFileType">Steam Docs</a> for more details.</p>
</blockquote>
<table>
<thead>
<tr>
<th>UGC File Type Constant</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>ugc_filetype_community</code></td>
<td>This is used to create files that will be uploaded and made available to anyone in the community</td>
</tr>
<tr>
<td><code>ugc_filetype_microtrans</code></td>
<td>This is used to describe files that are uploaded but intended only for the game to consider adding as official content</td>
</tr>
</tbody>
</table>
<p><br><br></p>
<hr>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="ugcfilevisibility">UGCFileVisibility</h1>
<p> These constants specify possible visibility states that a Workshop item can be in. They are used with the function <a href="#steam_ugc_set_item_visibility">steam_ugc_set_item_visibility</a> and are an async callback parameter for the functions <a href="#steam_ugc_request_item_details">steam_ugc_request_item_details</a> and <a href="#steam_ugc_send_query">steam_ugc_send_query</a>.</p>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="information_source" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2139.png"></g-emoji> NOTE</strong></p>
<p>See <a href="https://partner.steamgames.com/doc/api/ISteamRemoteStorage#ERemoteStoragePublishedFileVisibility">Steam Docs</a> for more details.</p>
</blockquote>
<table>
<thead>
<tr>
<th>UGC File Visibility Constant</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>ugc_visibility_public</code></td>
<td>Set the item to be publicly visible</td>
</tr>
<tr>
<td><code>ugc_visibility_friends_only</code></td>
<td>Set the item to be visible to only people on the users friends list</td>
</tr>
<tr>
<td><code>ugc_visibility_private</code></td>
<td>Set the item to be private</td>
</tr>
</tbody>
</table>
<p><br><br></p>
<hr>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="ugclistsortorder">UGCListSortOrder</h1>
<p> These constants specify the sorting order of user published UGC lists from queries created using one of the following functions:</p>
<ul>
<li><a href="#steam_ugc_create_query_user">steam_ugc_create_query_user</a></li>
<li><a href="#steam_ugc_create_query_user_ex">steam_ugc_create_query_user_ex</a></li>
</ul>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="information_source" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2139.png"></g-emoji> NOTE</strong></p>
<p>See <a href="https://partner.steamgames.com/doc/api/ISteamUGC#EUserUGCListSortOrder">Steam UGC Docs</a> for more details.</p>
</blockquote>
<table>
<thead>
<tr>
<th>UGC List Sort Order Constant</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>ugc_sortorder_CreationOrderDesc</code></td>
<td>Returns items by creation date. Descending - the newest items are first</td>
</tr>
<tr>
<td><code>ugc_sortorder_CreationOrderAsc</code></td>
<td>Returns items by creation date. Ascending - the oldest items are first</td>
</tr>
<tr>
<td><code>ugc_sortorder_TitleAsc</code></td>
<td>Returns items by name</td>
</tr>
<tr>
<td><code>ugc_sortorder_LastUpdatedDesc</code></td>
<td>Returns the most recently updated items first</td>
</tr>
<tr>
<td><code>ugc_sortorder_SubscriptionDateDesc</code></td>
<td>Returns the most recently subscribed items first</td>
</tr>
<tr>
<td><code>ugc_sortorder_VoteScoreDesc</code></td>
<td>Returns the items with the more recent score updates first</td>
</tr>
<tr>
<td><code>ugc_sortorder_ForModeration</code></td>
<td>Returns the items that have been reported for moderation</td>
</tr>
</tbody>
</table>
<p><br><br></p>
<hr>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="ugclisttype">UGCListType</h1>
<p> These constants specify the type of published UGC list to obtain from queries created using one of the following functions:</p>
<ul>
<li><a href="#steam_ugc_create_query_user">steam_ugc_create_query_user</a></li>
<li><a href="#steam_ugc_create_query_user_ex">steam_ugc_create_query_user_ex</a> </li>
</ul>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="information_source" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2139.png"></g-emoji> NOTE</strong></p>
<p>See <a href="https://partner.steamgames.com/doc/api/ISteamUGC#EUserUGCList">Steam UGC Docs</a> for more details.</p>
</blockquote>
<table>
<thead>
<tr>
<th>UGC List Type Constant</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>ugc_list_Published</code></td>
<td>List of files the user has published</td>
</tr>
<tr>
<td><code>ugc_list_VotedOn</code></td>
<td>List of files the user has voted on. Includes both VotedUp and VotedDown</td>
</tr>
<tr>
<td><code>ugc_list_VotedUp</code></td>
<td>List of files the user has voted up (restricted to the current user only)</td>
</tr>
<tr>
<td><code>ugc_list_VotedDown</code></td>
<td>List of files the user has voted down (restricted to the current user only)</td>
</tr>
<tr>
<td><code>ugc_list_WillVoteLater</code></td>
<td><g-emoji class="g-emoji" alias="warning" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/26a0.png">⚠️</g-emoji> DEPRECATED</td>
</tr>
<tr>
<td><code>ugc_list_Favorited</code></td>
<td>List of files the user has favorited</td>
</tr>
<tr>
<td><code>ugc_list_Subscribed</code></td>
<td>List of files the user has subscribed to (restricted to the current user only)</td>
</tr>
<tr>
<td><code>ugc_list_UsedOrPlayed</code></td>
<td>List of files the user has spent time in game with</td>
</tr>
<tr>
<td><code>ugc_list_Followed</code></td>
<td>List of files the user is following updates for</td>
</tr>
</tbody>
</table>
<p><br><br></p>
<hr>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="ugcmatchtype">UGCMatchType</h1>
<p> These constants specify the types of UGC to obtain from queries created using one of the following function:</p>
<ul>
<li><a href="#steam_ugc_create_query_all">steam_ugc_create_query_all</a></li>
<li><a href="#steam_ugc_create_query_all_ex">steam_ugc_create_query_all_ex</a></li>
<li><a href="#steam_ugc_create_query_user">steam_ugc_create_query_user</a></li>
<li><a href="#steam_ugc_create_query_user_ex">steam_ugc_create_query_user_ex</a></li>
</ul>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="information_source" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2139.png"></g-emoji> NOTE</strong></p>
<p>See <a href="https://partner.steamgames.com/doc/api/ISteamUGC#EUGCMatchingUGCType">Steam UGC Docs</a> for more details.</p>
</blockquote>
<table>
<thead>
<tr>
<th>UGC Match Type Constant</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>ugc_match_Items</code></td>
<td>Both microtransaction items and Ready-to-use items</td>
</tr>
<tr>
<td><code>ugc_match_Items_Mtx</code></td>
<td>Microtransaction items</td>
</tr>
<tr>
<td><code>ugc_match_Items_ReadyToUse</code></td>
<td>Regular in game items that players have uploaded</td>
</tr>
<tr>
<td><code>ugc_match_Collections</code></td>
<td>Shared collections of UGC</td>
</tr>
<tr>
<td><code>ugc_match_Artwork</code></td>
<td>Artwork which has been shared</td>
</tr>
<tr>
<td><code>ugc_match_Videos</code></td>
<td>Videos which have been shared</td>
</tr>
<tr>
<td><code>ugc_match_Screenshots</code></td>
<td>Screenshots which have been shared</td>
</tr>
<tr>
<td><code>ugc_match_AllGuides</code></td>
<td>Both web guides and integrated guides</td>
</tr>
<tr>
<td><code>ugc_match_WebGuides</code></td>
<td>Guides that are only available on the steam community</td>
</tr>
<tr>
<td><code>ugc_match_IntegratedGuides</code></td>
<td>Guides that you can use within your game (like Dota 2&#39;s in game character guides)</td>
</tr>
<tr>
<td><code>ugc_match_UsableInGame</code></td>
<td>Ready-to-use items and integrated guides</td>
</tr>
<tr>
<td><code>ugc_match_ControllerBindings</code></td>
<td>Controller Bindings which have been shared</td>
</tr>
</tbody>
</table>
<p><br><br></p>
<hr>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="ugcquerytype-sorting-filtering-">UGCQueryType (Sorting &amp; Filtering)</h1>
<p> These constants specify the sorting and filtering for queries across all available UGC, and are to be used with the following functions:</p>
<ul>
<li><a href="#steam_ugc_create_query_all">steam_ugc_create_query_all</a></li>
<li><a href="#steam_ugc_create_query_all_ex">steam_ugc_create_query_all_ex</a></li>
</ul>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="information_source" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2139.png"></g-emoji> NOTE</strong></p>
<p>See <a href="https://partner.steamgames.com/doc/api/ISteamUGC#EUGCQuery">Steam UGC Docs</a> for more details.</p>
</blockquote>
<table>
<thead>
<tr>
<th>UGC Query Type Constant</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>ugc_query_RankedByVote</code></td>
<td>Sort by vote popularity all-time</td>
</tr>
<tr>
<td><code>ugc_query_RankedByPublicationDate</code></td>
<td>Sort by publication date descending</td>
</tr>
<tr>
<td><code>ugc_query_AcceptedForGameRankedByAcceptanceDate</code></td>
<td>Sort by date accepted (for mtx items)</td>
</tr>
<tr>
<td><code>ugc_query_RankedByTrend</code></td>
<td>Sort by vote popularity within the given &quot;trend&quot; period (set in <a href="#steam_ugc_query_set_ranked_by_trend_days">steam_ugc_query_set_ranked_by_trend_days</a>)</td>
</tr>
<tr>
<td><code>ugc_query_FavoritedByFriendsRankedByPublicationDate</code></td>
<td>Filter to items the user&#39;s friends have favorited, sorted by publication date descending</td>
</tr>
<tr>
<td><code>ugc_query_CreatedByFriendsRankedByPublicationDate</code></td>
<td>Filter to items created by friends, sorted by publication date descending</td>
</tr>
<tr>
<td><code>ugc_query_RankedByNumTimesReported</code></td>
<td>Sort by report weight descending</td>
</tr>
<tr>
<td><code>ugc_query_CreatedByFollowedUsersRankedByPublicationDate</code></td>
<td>Filter to items created by users that the current user has followed, sorted by publication date descending</td>
</tr>
<tr>
<td><code>ugc_query_NotYetRated</code></td>
<td>Filtered to the user&#39;s voting queue</td>
</tr>
<tr>
<td><code>ugc_query_RankedByTotalVotesAsc</code></td>
<td>Sort by total # of votes ascending (used internally for building the user&#39;s voting queue)</td>
</tr>
<tr>
<td><code>ugc_query_RankedByVotesUp</code></td>
<td>Sort by number of votes up descending. Will use the &quot;trend&quot; period if specified (set in <a href="#steam_ugc_query_set_ranked_by_trend_days">steam_ugc_query_set_ranked_by_trend_days</a>)</td>
</tr>
<tr>
<td><code>ugc_query_RankedByTextSearch</code></td>
<td>Sort by keyword text search relevancy</td>
</tr>
</tbody>
</table>
<p><br><br></p>
<hr>
<p class="page" id="Social"></p><h1>Social</h1>
<p><a id="top"></a>
<a id="top"></a>
<!--<div class="body-scroll" style="top: 150px;">--></p>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="social">Social</h1>
<p> The following set of functions are used for setting or getting social information.</p>
<h2 id="rich-presence">Rich Presence</h2>
<p> The following functions are provided to work with rich presence:</p>
<ul>
<li><a href="#steam_set_rich_presence">steam_set_rich_presence</a></li>
<li><a href="#steam_clear_rich_presence">steam_clear_rich_presence</a></li>
</ul>
<h2 id="user-friends">User &amp; Friends</h2>
<p> The following functions are provided to work with user and friends data:</p>
<ul>
<li><a href="#steam_user_set_played_with">steam_user_set_played_with</a></li>
<li><a href="#steam_get_friends_game_info">steam_get_friends_game_info</a></li>
<li><a href="#steam_get_user_avatar">steam_get_user_avatar</a></li>
<li><a href="#steam_image_get_size">steam_image_get_size</a></li>
<li><a href="#steam_image_get_rgba">steam_image_get_rgba</a></li>
<li><p><a href="#steam_image_get_bgra">steam_image_get_bgra</a></p>
<!-- KEYWORDS
Steam API
-->
<!-- TAGS
api_functions
-->
</li>
</ul>
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_set_rich_presence">steam_set_rich_presence</h1>
<p> Sets a Rich Presence key/value for the current user that is automatically shared to all friends playing the same game.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_set_rich_presence(key, value);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>key</td>
<td>string</td>
<td>The rich presence &#39;key&#39; to set</td>
</tr>
<tr>
<td>value</td>
<td>string</td>
<td>The rich presence &#39;value&#39; to associate</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">N/A</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs">steam_set_rich_presence(<span class="hljs-string">&quot;game&quot;</span>, <span class="hljs-string">&quot;MyAwesomeGame&quot;</span>);
steam_set_rich_presence(<span class="hljs-string">&quot;level&quot;</span>, <span class="hljs-string">&quot;Last&quot;</span>);
steam_set_rich_presence(<span class="hljs-string">&quot;Mood&quot;</span>,<span class="hljs-string">&quot;Happy&quot;</span>);
steam_clear_rich_presence();
</pre><p> The code sample above uses sets a couple values for the local user rich presence and after that clears this values (using a call to the <a href="#steam_clear_rich_presence">steam_clear_rich_presence</a> function) meaning those will no longer show.</p>
<!-- KEYWORDS
steam_stats_ready
-->
<!-- TAGS
steam_stats_ready
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_set_rich_presence">steam_set_rich_presence</h1>
<p> Clears all of the current user&#39;s Rich Presence key/values.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_clear_rich_presence()</pre><p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">N/A</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs">steam_set_rich_presence(<span class="hljs-string">&quot;game&quot;</span>, <span class="hljs-string">&quot;MyAwesomeGame&quot;</span>);
steam_set_rich_presence(<span class="hljs-string">&quot;level&quot;</span>, <span class="hljs-string">&quot;Last&quot;</span>);
steam_set_rich_presence(<span class="hljs-string">&quot;Mood&quot;</span>,<span class="hljs-string">&quot;Happy&quot;</span>);
steam_clear_rich_presence();
</pre><p> The code sample above uses <a href="#steam_set_rich_presence">steam_set_rich_presence</a> to set a couple values for the local user rich presence and after that clears this values meaning those will no longer show.</p>
<!-- KEYWORDS
steam_stats_ready
-->
<!-- TAGS
steam_stats_ready
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_user_set_played_with">steam_user_set_played_with</h1>
<p> Adds the given user to the &quot;recently played with&quot; list (accessed via &quot;Players&quot; - &quot;Recent games&quot;) menu in Steam overlay.
This is usually something to do on session start for all remote users.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_user_set_played_with(user_id);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>user_id</td>
<td>int64</td>
<td>Other player user id</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Bool</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs">steam_user_set_played_with(anyFriendUserID)</pre><p> This code will add the specified user id to the &quot;recently played with&quot; list, of the local user.</p>
<!-- KEYWORDS
steam_stats_ready
-->
<!-- TAGS
steam_stats_ready
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_get_friends_game_info">steam_get_friends_game_info</h1>
<p> Returns an array of information about what the current user&#39;s Steam friends are playing.
Equivalent to what can be seen in Steam Friends UI.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_get_friends_game_info();</pre><p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">array of structs</pre><table>
<thead>
<tr>
<th>Key</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>friendId</td>
<td>int64</td>
<td>The Steam user id</td>
</tr>
<tr>
<td>gameId</td>
<td>real</td>
<td>The Steam game id</td>
</tr>
<tr>
<td>lobbyId</td>
<td>int64</td>
<td>The Steam lobby id (if hosting a lobby that is open for friends to join - otherwise <code>0</code>)</td>
</tr>
<tr>
<td>name</td>
<td>string</td>
<td>The friend&#39;s user name</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">var</span> info_arr = steam_get_friends_game_info();
<span class="hljs-keyword">var</span> info_num = <span class="hljs-built_in">array_length</span>(info_arr);
<span class="hljs-keyword">var</span> _steam_app_id = <span class="hljs-built_in">steam_get_app_id</span>();
<span class="hljs-keyword">for</span> (<span class="hljs-keyword">var</span> i = <span class="hljs-number">0</span>; i &lt; info_num; i++)
{
<span class="hljs-keyword">var</span> info = info_arr[i];
<span class="hljs-comment">// same game!</span>
<span class="hljs-keyword">if</span> (info.gameId == _steam_app_id)
{
<span class="hljs-keyword">var</span> lobby_id = info.lobbyId;
<span class="hljs-comment">// has an open lobby!</span>
<span class="hljs-keyword">if</span> (lobby_id != <span class="hljs-number">0</span>)
{
<span class="hljs-keyword">var</span> user_id = info.friendId;
<span class="hljs-keyword">var</span> name = info.name;
<span class="hljs-comment">// Use steam_lobby_join_id(lobby_id) to join the lobby when asked</span>
}
}
}</pre><p> The above code will check all you friends to see if anyone of them is playing the same game as you are (<a href="#steam_get_app_id">steam_get_app_id</a>) and check if they have an open lobbies and if so we can request to join the lobby they are in using <a href="#steam_lobby_join_id">steam_lobby_join_id</a>.</p>
<!-- KEYWORDS
steam_stats_ready
-->
<!-- TAGS
steam_stats_ready
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_get_user_avatar">steam_get_user_avatar</h1>
<p> Fetches an avatar for the specified user ID.
Returns <code>0</code> if no avatar is set for the user;<br>
Returns <code>-1</code> if the request is pending, in which case an <a href="https://manual-en.yoyogames.com/The_Asset_Editors/Object_Properties/Async_Events/Steam.htm">Steam Async Event</a> will be triggered.
Returns positive IDs if the avatar is ready, this id is to be used with the following function:</p>
<ul>
<li><a href="#steam_image_get_bgra">steam_image_get_bgra</a></li>
<li><a href="#steam_image_get_rgba">steam_image_get_rgba</a></li>
<li><a href="#steam_image_get_size">steam_image_get_size</a></li>
</ul>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_get_user_avatar(userID, avatar_size);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>userID</td>
<td>int64</td>
<td>The user Steam unique identifier</td>
</tr>
<tr>
<td>avatar_size</td>
<td><a href="#AvatarSize.htm">AvatarSize</a></td>
<td>The size of the avatar to be requested</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs"><span class="hljs-built_in">real</span></pre><p><br></p>
<p><strong>Triggers:</strong></p>
<pre class="hljs">Asynchronous Steam Event</pre><table>
<thead>
<tr>
<th>Key</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>event_type</td>
<td>string</td>
<td>The string value <code>&quot;avatar_image_loaded&quot;</code></td>
</tr>
<tr>
<td>success</td>
<td>bool</td>
<td>Whether the async action succeeded</td>
</tr>
<tr>
<td>user_id</td>
<td>int64</td>
<td>The associated user&#39;s ID</td>
</tr>
<tr>
<td>image</td>
<td>real</td>
<td>The image ID that would otherwise be returned by the function</td>
</tr>
<tr>
<td>width</td>
<td>real</td>
<td>The image width, in pixels</td>
</tr>
<tr>
<td>height</td>
<td>real</td>
<td>The image height, in pixels <em>**</em></td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">var</span> l_img = steam_get_user_avatar(<span class="hljs-built_in">steam_get_user_steam_id</span>(), steam_user_avatar_size_large);
<span class="hljs-comment">// Check if avatar is ready</span>
<span class="hljs-keyword">if</span> (l_img &gt; <span class="hljs-number">0</span>)
{
<span class="hljs-keyword">var</span> l_dims = steam_image_get_size(l_img);
<span class="hljs-keyword">var</span> buff_size = l_dims[<span class="hljs-number">0</span>] * l_dims[<span class="hljs-number">1</span>] * <span class="hljs-number">4</span>
<span class="hljs-keyword">var</span> l_cols = <span class="hljs-built_in">buffer_create</span>(buff_size, <span class="hljs-literal">buffer_fixed</span>, <span class="hljs-number">1</span>);
l_ok = steam_image_get_rgba(l_img, l_cols, buff_size);
<span class="hljs-keyword">if</span>(!l_ok)
{
<span class="hljs-built_in">buffer_delete</span>(l_cols);
}
<span class="hljs-keyword">var</span> l_surf = <span class="hljs-built_in">surface_create</span>(l_dims[<span class="hljs-number">0</span>], l_dims[<span class="hljs-number">1</span>]);
<span class="hljs-built_in">buffer_set_surface</span>(l_cols, l_surf, <span class="hljs-number">0</span>);
l_sprite = <span class="hljs-built_in">sprite_create_from_surface</span>(l_surf, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, l_dims[<span class="hljs-number">0</span>], l_dims[<span class="hljs-number">1</span>], <span class="hljs-literal">false</span>, <span class="hljs-literal">false</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>);
<span class="hljs-built_in">surface_free</span>(l_surf);
<span class="hljs-built_in">buffer_delete</span>(l_cols);
}
</pre><p> In the code above we query for the current user&#39;s (<a href="#steam_get_user_steam_id">steam_get_user_steam_id</a>) avatar, this function this function will either return:</p>
<ul>
<li>the handle to the function (return value greater than zero): in this case we follow by getting size information (<a href="#steam_image_get_size">steam_image_get_size</a>), creating a buffer and and getting the avatar image RBGA data into the buffer (<a href="#steam_image_get_rgba">steam_image_get_rgba</a>) and lastely creating a sprite from said buffer.</li>
<li>no handle at all (return value equal to zero): in this case there is no avatar image for the specified used.</li>
<li>a value of -1: in this last case it measn that the request is pending and you can catch the output with a <a href="https://manual-en.yoyogames.com/The_Asset_Editors/Object_Properties/Async_Events/Steam.htm">Steam Async Event</a>, using the following code:</li>
</ul>
<pre class="hljs"><span class="hljs-comment">// Early exit if event type doesn&#x27;t match</span>
<span class="hljs-keyword">if</span> (<span class="hljs-symbol">async_load</span>[?<span class="hljs-string">&quot;event_type&quot;</span>] != <span class="hljs-string">&quot;avatar_image_loaded&quot;</span>) <span class="hljs-keyword">exit</span>
<span class="hljs-comment">// Validate status</span>
<span class="hljs-keyword">var</span> success = <span class="hljs-symbol">async_load</span>[?<span class="hljs-string">&quot;success&quot;</span>];
<span class="hljs-keyword">if</span> (success == <span class="hljs-number">1</span>) {
<span class="hljs-comment">// Do what you want with the provided image handle</span>
}
<span class="hljs-keyword">else</span> {
<span class="hljs-comment">// Failure</span>
<span class="hljs-built_in">show_debug_message</span>(<span class="hljs-string">&quot;Failed to get user avatar&quot;</span>);
}
</pre> <!-- KEYWORDS
steam_stats_ready
-->
<!-- TAGS
steam_stats_ready
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_image_get_size">steam_image_get_size</h1>
<p> Fetches dimensions for the said Steam image ID.
If the call succeeds, the return value is a two-element array containing width and height in pixels.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_image_get_size(steam_image_id);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>steam_image_id</td>
<td>int64</td>
<td>steam identifier of the image</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">array</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">var</span> l_img = steam_get_user_avatar(<span class="hljs-built_in">steam_get_user_steam_id</span>(), steam_user_avatar_size_large);
<span class="hljs-keyword">var</span> l_dims = steam_image_get_size(l_img);
<span class="hljs-keyword">var</span> buff_size = l_dims[<span class="hljs-number">0</span>] * l_dims[<span class="hljs-number">1</span>] * <span class="hljs-number">4</span>
<span class="hljs-keyword">var</span> l_cols = <span class="hljs-built_in">buffer_create</span>(buff_size, <span class="hljs-literal">buffer_fixed</span>, <span class="hljs-number">1</span>);
l_ok = steam_image_get_rgba(l_img, l_cols, buff_size);
<span class="hljs-keyword">if</span>(!l_ok)
<span class="hljs-keyword">exit</span>
<span class="hljs-keyword">var</span> l_surf = <span class="hljs-built_in">surface_create</span>(l_dims[<span class="hljs-number">0</span>], l_dims[<span class="hljs-number">1</span>]);
<span class="hljs-built_in">buffer_set_surface</span>(l_cols, l_surf, <span class="hljs-number">0</span>);
l_sprite = <span class="hljs-built_in">sprite_create_from_surface</span>(l_surf, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, l_dims[<span class="hljs-number">0</span>], l_dims[<span class="hljs-number">1</span>], <span class="hljs-literal">false</span>, <span class="hljs-literal">false</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>);
<span class="hljs-built_in">surface_free</span>(l_surf);
<span class="hljs-built_in">buffer_delete</span>(l_cols);</pre><p> The above code will show a code example.</p>
<!-- KEYWORDS
steam_stats_ready
-->
<!-- TAGS
steam_stats_ready
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_image_get_rgba">steam_image_get_rgba</h1>
<p> Grabs RGBA data of the specified Steam image ID into a GameMaker buffer.
Returns whether successful.</p>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="information_source" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2139.png"></g-emoji> NOTE</strong></p>
<p>The buffer should be appropriately sized in accordance with <a href="https://yal.cc/r/17/steamworks-gml/#steam_image_get_size">steam_image_get_size</a> (width <em> height </em> 4).</p>
</blockquote>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_image_get_rgba(steam_image_id, buffer, size);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>steam_image_id</td>
<td>int64</td>
<td>The steam image identifier</td>
</tr>
<tr>
<td>buffer</td>
<td>buffer</td>
<td>The buffer where data will be written</td>
</tr>
<tr>
<td>size</td>
<td>real</td>
<td>The size of the buffer supplied</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Boolean</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">var</span> l_img = steam_get_user_avatar(<span class="hljs-built_in">steam_get_user_steam_id</span>(), steam_user_avatar_size_large);
<span class="hljs-comment">// Check if avatar is ready</span>
<span class="hljs-keyword">if</span> (l_img &gt; <span class="hljs-number">0</span>)
{
<span class="hljs-keyword">var</span> l_dims = steam_image_get_size(l_img);
<span class="hljs-keyword">var</span> buff_size = l_dims[<span class="hljs-number">0</span>] * l_dims[<span class="hljs-number">1</span>] * <span class="hljs-number">4</span>
<span class="hljs-keyword">var</span> l_cols = <span class="hljs-built_in">buffer_create</span>(buff_size, <span class="hljs-literal">buffer_fixed</span>, <span class="hljs-number">1</span>);
l_ok = steam_image_get_rgba(l_img, l_cols, buff_size);
<span class="hljs-keyword">if</span>(!l_ok)
{
<span class="hljs-built_in">buffer_delete</span>(l_cols);
}
<span class="hljs-keyword">var</span> l_surf = <span class="hljs-built_in">surface_create</span>(l_dims[<span class="hljs-number">0</span>], l_dims[<span class="hljs-number">1</span>]);
<span class="hljs-built_in">buffer_set_surface</span>(l_cols, l_surf, <span class="hljs-number">0</span>);
l_sprite = <span class="hljs-built_in">sprite_create_from_surface</span>(l_surf, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, l_dims[<span class="hljs-number">0</span>], l_dims[<span class="hljs-number">1</span>], <span class="hljs-literal">false</span>, <span class="hljs-literal">false</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>);
<span class="hljs-built_in">surface_free</span>(l_surf);
<span class="hljs-built_in">buffer_delete</span>(l_cols);
}
</pre><p> In the code above we query for the current user&#39;s (<a href="#steam_get_user_steam_id">steam_get_user_steam_id</a>) avatar data and place it inside a buffer (with the RGBA color format).
For a more extensive example refer to the <a href="#steam_get_user_avatar">steam_get_user_avatar</a> function.</p>
<!-- KEYWORDS
steam_stats_ready
-->
<!-- TAGS
steam_stats_ready
-->
<p><br><br></p>
<hr>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_image_get_bgra">steam_image_get_bgra</h1>
<p> Grabs BGRA data of the specified Steam image ID into a GameMaker buffer.
Returns whether successful.</p>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="information_source" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2139.png"></g-emoji> NOTE</strong></p>
<p>The buffer should be appropriately sized in accordance with <a href="https://yal.cc/r/17/steamworks-gml/#steam_image_get_size">steam_image_get_size</a> (width <em> height </em> 4).</p>
</blockquote>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_image_get_bgra(steam_image_id, buffer, size);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>steam_image_id</td>
<td>int64</td>
<td>The steam image identifier</td>
</tr>
<tr>
<td>buffer</td>
<td>buffer ID</td>
<td>The buffer where data will be written</td>
</tr>
<tr>
<td>size</td>
<td>real</td>
<td>The size of the buffer supplied</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Boolean</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">var</span> l_img = steam_get_user_avatar(<span class="hljs-built_in">steam_get_user_steam_id</span>(), steam_user_avatar_size_large);
<span class="hljs-comment">// Check if avatar is ready</span>
<span class="hljs-keyword">if</span> (l_img &gt; <span class="hljs-number">0</span>)
{
<span class="hljs-keyword">var</span> l_dims = steam_image_get_size(l_img);
<span class="hljs-keyword">var</span> buff_size = l_dims[<span class="hljs-number">0</span>] * l_dims[<span class="hljs-number">1</span>] * <span class="hljs-number">4</span>
<span class="hljs-keyword">var</span> l_cols = <span class="hljs-built_in">buffer_create</span>(buff_size, <span class="hljs-literal">buffer_fixed</span>, <span class="hljs-number">1</span>);
l_ok = steam_image_get_bgra(l_img, l_cols, buff_size);
<span class="hljs-keyword">if</span>(!l_ok)
{
<span class="hljs-built_in">buffer_delete</span>(l_cols);
}
<span class="hljs-keyword">var</span> l_surf = <span class="hljs-built_in">surface_create</span>(l_dims[<span class="hljs-number">0</span>], l_dims[<span class="hljs-number">1</span>]);
<span class="hljs-built_in">buffer_set_surface</span>(l_cols, l_surf, <span class="hljs-number">0</span>);
l_sprite = <span class="hljs-built_in">sprite_create_from_surface</span>(l_surf, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, l_dims[<span class="hljs-number">0</span>], l_dims[<span class="hljs-number">1</span>], <span class="hljs-literal">false</span>, <span class="hljs-literal">false</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>);
<span class="hljs-built_in">surface_free</span>(l_surf);
<span class="hljs-built_in">buffer_delete</span>(l_cols);
}
</pre><p> In the code above we query for the current user&#39;s (<a href="#steam_get_user_steam_id">steam_get_user_steam_id</a>) avatar data and place it inside a buffer (with the BGRA color format).
For a more extensive example refer to the <a href="#steam_get_user_avatar">steam_get_user_avatar</a> function.</p>
<p><br><br></p>
<hr>
<p class="page" id="Inventory"></p><h1>Inventory</h1>
<p><a id="top"></a>
<a id="top"></a>
<!-- Page HTML do not touch -->
<a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="inventory">Inventory</h1>
<p> The following functions, constants and structures allow to use the <a href="https://partner.steamgames.com/doc/features/inventory">Steam Inventory Service</a>.</p>
<h2 id="pricing-and-consumables">Pricing and Consumables</h2>
<p> These functions are provided for handling pricing, purchases and consumables:</p>
<ul>
<li><a href="#steam_inventory_consume_item">steam_inventory_consume_item</a></li>
<li><a href="#steam_inventory_get_item_price">steam_inventory_get_item_price</a></li>
<li><a href="#steam_inventory_get_items_with_prices">steam_inventory_get_items_with_prices</a></li>
<li><a href="#steam_inventory_request_eligible_promo_item_defs">steam_inventory_request_eligible_promo_item_defs</a></li>
<li><a href="#steam_inventory_request_prices">steam_inventory_request_prices</a></li>
<li><a href="#steam_inventory_start_purchase">steam_inventory_start_purchase</a></li>
</ul>
<h2 id="inventory-management-async-result-">Inventory Management (Async Result)</h2>
<p> These asynchronous functions will return a <strong>inventory result handle</strong> that can be used to get additional information (see section below):</p>
<ul>
<li><a href="#steam_inventory_add_promo_item">steam_inventory_add_promo_item</a></li>
<li><a href="#steam_inventory_add_promo_items">steam_inventory_add_promo_items</a></li>
<li><a href="#steam_inventory_exchange_items">steam_inventory_exchange_items</a></li>
<li><a href="#steam_inventory_exchange_items-copy">steam_inventory_generate_items</a> <g-emoji class="g-emoji" alias="information_source" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2139.png"></g-emoji> DEV ONLY</li>
<li><a href="#steam_inventory_get_all_items">steam_inventory_get_all_items</a></li>
<li><a href="#steam_inventory_get_items_by_id">steam_inventory_get_items_by_id</a></li>
<li><a href="#steam_inventory_submit_update_properties">steam_inventory_submit_update_properties</a></li>
<li><a href="#steam_inventory_transfer_item_quantity">steam_inventory_transfer_item_quantity</a></li>
<li><a href="#steam_inventory_trigger_item_drop">steam_inventory_trigger_item_drop</a></li>
</ul>
<h2 id="inventory-result-information">Inventory Result Information</h2>
<p> These functions can be called with the <strong>inventory result handle</strong> (from previous section) to get additional information:</p>
<ul>
<li><a href="#steam_inventory_result_destroy">steam_inventory_result_destroy</a></li>
<li><a href="#steam_inventory_result_get_item_property">steam_inventory_result_get_item_property</a></li>
<li><a href="#steam_inventory_result_get_items">steam_inventory_result_get_items</a></li>
<li><a href="#steam_inventory_result_get_status">steam_inventory_result_get_status</a></li>
<li><a href="#steam_inventory_result_get_unix_timestamp">steam_inventory_result_get_unix_timestamp</a></li>
</ul>
<h2 id="dynamic-properties">Dynamic Properties</h2>
<p> This set of functions can be used to author items dynamic properties:</p>
<ul>
<li><a href="#steam_inventory_start_update_properties">steam_inventory_start_update_properties</a></li>
<li><a href="#steam_inventory_remove_property">steam_inventory_remove_property</a></li>
<li><a href="#steam_inventory_set_property_bool">steam_inventory_set_property_bool</a></li>
<li><a href="#steam_inventory_set_property_float">steam_inventory_set_property_float</a></li>
<li><a href="#steam_inventory_set_property_int">steam_inventory_set_property_int</a></li>
<li><a href="#steam_inventory_set_property_string">steam_inventory_set_property_string</a></li>
<li><a href="#steam_inventory_submit_update_properties">steam_inventory_submit_update_properties</a></li>
</ul>
<h2 id="constants">Constants</h2>
<p> These are the constants used by this API:</p>
<ul>
<li><a href="#inventoryresultstatus">InventoryResultStatus</a></li>
</ul>
<h2 id="structures">Structures</h2>
<p> These are the structures used by this API:</p>
<ul>
<li><a href="#inventoryitemconsumptiondata">InventoryItemConsumptionData</a></li>
<li><a href="#inventoryitemcreationdata">InventoryItemCreationData</a></li>
</ul>
<p><br><br></p>
<hr>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_inventory_consume_item">steam_inventory_consume_item</h1>
<p> Consumes items from a user&#39;s inventory. If the quantity of the given item goes to zero, it is permanently removed.
This is an asynchronous function that will trigger the <a href="https://manual-en.yoyogames.com/The_Asset_Editors/Object_Properties/Async_Events/Steam.htm">Steam Async Event</a> when the task is finished.</p>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="warning" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/26a0.png">⚠️</g-emoji> IMPORTANT</strong></p>
<p> You must call <a href="#steam_inventory_result_destroy">steam_inventory_result_destroy</a> on the returned async result ID when you are done with it.</p>
</blockquote>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="eight_pointed_black_star" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2734.png">✴️</g-emoji> EXTERNAL</strong></p>
<p>A wrapper around <a href="http://partner.steamgames.com/doc/api/ISteamInventory#ConsumeItem">ConsumeItem</a>.</p>
</blockquote>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_inventory_consume_item(item_id, quantity);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>item_id</td>
<td>int64</td>
<td>The <a href="https://partner.steamgames.com/doc/api/ISteamInventory#SteamItemInstanceID_t">steam_inventory_item_id</a> to consume.</td>
</tr>
<tr>
<td>quantity</td>
<td>real</td>
<td>The number of items in that stack to consume.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs"><span class="hljs-built_in">real</span></pre><p><br></p>
<p><strong>Triggers:</strong></p>
<pre class="hljs">Asynchronous Steam Event</pre><table>
<thead>
<tr>
<th>Key</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>event_type</td>
<td>string</td>
<td>The string value <code>&quot;inventory_result_ready&quot;</code></td>
</tr>
<tr>
<td>success</td>
<td>bool</td>
<td>Whether the async action succeeded</td>
</tr>
<tr>
<td>result</td>
<td><a href="#inventoryresultstatus">InventoryResultStatus</a></td>
<td>The status code as returned by <a href="#steam_inventory_result_get_status">steam_inventory_result_get_status</a></td>
</tr>
<tr>
<td>handle</td>
<td>real</td>
<td>The associated async result ID, which can be used to tell apart what result this event is for.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs">steam_inventory_consume_item(player.apple, <span class="hljs-number">1</span>);</pre><p> The code sample above will try to consume one item (<code>apple</code>, <a href="https://partner.steamgames.com/doc/api/ISteamInventory#SteamItemInstanceID_t">steam_inventory_item_id</a>), and trigger an async event with the task result.</p>
<p><br><br></p>
<hr>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_inventory_get_item_price">steam_inventory_get_item_price</h1>
<p> After a successful call to <a href="#steam_inventory_request_prices">steam_inventory_request_prices</a>, you can call this method to get the pricing for a specific item definition.</p>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="eight_pointed_black_star" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2734.png">✴️</g-emoji> EXTERNAL</strong></p>
<p>A wrapper around <a href="https://partner.steamgames.com/doc/api/ISteamInventory#GetItemPrice">GetItemPrice</a>.</p>
</blockquote>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_inventory_get_item_price(item);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>kind</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>item</td>
<td>real</td>
<td>The <a href="https://partner.steamgames.com/doc/api/ISteamInventory#SteamItemDef_t">steam_inventory_item_def</a> to get the price of.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs"><span class="hljs-built_in">int64</span></pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">var</span> price = steam_inventory_get_item_price(item);</pre><p> The code sample above will return you the price for the speficied item definition. For more detailed example on using the function check <a href="#steam_inventory_request_prices">steam_inventory_request_prices</a></p>
<p><br><br></p>
<hr>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_inventory_get_items_with_prices">steam_inventory_get_items_with_prices</h1>
<p> After a successful call to <a href="#steam_inventory_request_prices">steam_inventory_request_prices</a>, you can call this method to get all the prices for applicable item definitions. </p>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="eight_pointed_black_star" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2734.png">✴️</g-emoji> EXTERNAL</strong></p>
<p>A wrapper around <a href="https://partner.steamgames.com/doc/api/ISteamInventory#GetItemsWithPrices">GetItemsWithPrices</a>.</p>
</blockquote>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_inventory_get_items_with_prices();</pre><p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">array of structs</pre><table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>item_def</td>
<td>real</td>
<td>The <a href="https://partner.steamgames.com/doc/api/ISteamInventory#SteamItemDef_t">steam_inventory_item_def</a> representing the item type</td>
</tr>
<tr>
<td>price</td>
<td>int64</td>
<td>The price of the item definition</td>
</tr>
<tr>
<td>base_price</td>
<td>int64</td>
<td>The base price of the item definition <g-emoji class="g-emoji" alias="eight_pointed_black_star" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2734.png">✴️</g-emoji> WINDOWS ONLY</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">var</span> array = steam_inventory_get_items_with_prices(inv_result);
<span class="hljs-keyword">if</span>(<span class="hljs-built_in">array_length</span>(array) &gt; <span class="hljs-number">0</span>)
{
<span class="hljs-keyword">var</span> item_def = array[<span class="hljs-number">0</span>].item_def
<span class="hljs-keyword">var</span> price = array[<span class="hljs-number">0</span>].price
<span class="hljs-keyword">var</span> base_price = array[<span class="hljs-number">0</span>].base_price
<span class="hljs-built_in">show_debug_message</span>(<span class="hljs-string">&quot;Found at one item that costs: &quot;</span> + <span class="hljs-built_in">string</span>(price));
}</pre><p> The code above will get items with prices and if the returning array size is greater than zero (meaning there is at least one item with a configured price) it prints to the console the item&#39;s price.</p>
<p><br><br></p>
<hr>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_inventory_request_eligible_promo_item_defs">steam_inventory_request_eligible_promo_item_defs</h1>
<p> Requests the list of &quot;eligible&quot; promo items that can be manually granted to the given user.
This is an asynchronous function that will trigger the <a href="https://manual-en.yoyogames.com/The_Asset_Editors/Object_Properties/Async_Events/Steam.htm">Steam Async Event</a> when the task is finished.</p>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="eight_pointed_black_star" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2734.png">✴️</g-emoji> EXTERNAL</strong></p>
<p>A wrapper around <a href="https://partner.steamgames.com/doc/api/ISteamInventory#RequestEligiblePromoItemDefinitionsIDs">RequestEligiblePromoItemDefinitionsIDs</a>.</p>
</blockquote>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_inventory_request_eligible_promo_item_defs(user_id);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>user_id</td>
<td>The user ID of the user to request the eligible promo items for.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">bool</pre><p><br></p>
<p><strong>Triggers:</strong></p>
<pre class="hljs">Asynchronous Steam Event</pre><table>
<thead>
<tr>
<th>Key</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>event_type</td>
<td>string</td>
<td>The string value <code>&quot;inventory_request_eligible_promo_item_defs&quot;</code></td>
</tr>
<tr>
<td>user_id</td>
<td>int64</td>
<td>The user&#39;s unique identifier</td>
</tr>
<tr>
<td>item_def_count</td>
<td>real</td>
<td>The number of items</td>
</tr>
<tr>
<td>item_def_json</td>
<td>string</td>
<td>A json array of items identifiers (must be parsed using <a href="https://manual-en.yoyogames.com/GameMaker_Language/GML_Reference/File_Handling/Encoding_And_Hashing/json_parse.htm">json_parse</a> or <a href="https://manual-en.yoyogames.com/GameMaker_Language/GML_Reference/File_Handling/Encoding_And_Hashing/json_decode.htm">json_decode</a>)</td>
</tr>
<tr>
<td>is_cached_data</td>
<td>bool</td>
<td>Whether the data was retrieved from the cache and not from the server</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs">steam_inventory_request_eligible_promo_item_defs(user_id)</pre><p> For more information on this function call please refer to the official manual.</p>
<p><br><br></p>
<hr>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_inventory_request_prices">steam_inventory_request_prices</h1>
<p> Request prices for all item definitions that can be purchased in the user&#39;s local currency.</p>
<p> This is an asynchronous function that will trigger the <a href="https://manual-en.yoyogames.com/The_Asset_Editors/Object_Properties/Async_Events/Steam.htm">Steam Async Event</a> when the task is finished, after which you can use the following functions:</p>
<ul>
<li><a href="#steam_inventory_get_item_price">steam_inventory_get_item_price</a></li>
<li><a href="#steam_inventory_get_items_with_prices">steam_inventory_get_items_with_prices</a></li>
</ul>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="eight_pointed_black_star" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2734.png">✴️</g-emoji> EXTERNAL</strong></p>
<p>A wrapper around <a href="https://partner.steamgames.com/doc/api/ISteamInventory#RequestPrices">RequestPrices</a>.</p>
</blockquote>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_inventory_request_prices();</pre><p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">bool</pre><p><br></p>
<p><strong>Triggers:</strong></p>
<pre class="hljs">Asynchronous Steam Event</pre><table>
<thead>
<tr>
<th>Key</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>event_type</td>
<td>string</td>
<td>The string value <code>&quot;inventory_request_prices&quot;</code></td>
</tr>
<tr>
<td>success</td>
<td>bool</td>
<td>Whether the async action succeeded</td>
</tr>
<tr>
<td>result</td>
<td><a href="#inventoryresultstatus">InventoryResultStatus</a></td>
<td>The status code as returned by <a href="#steam_inventory_result_get_status">steam_inventory_result_get_status</a></td>
</tr>
<tr>
<td>currency</td>
<td>string</td>
<td>The string representing the user&#39;s <a href="https://partner.steamgames.com/doc/store/pricing/currencies">local currency</a> code.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs">steam_inventory_request_prices();</pre><p> The code above will request for price information. The result for this task can be caught inside the <a href="https://manual-en.yoyogames.com/The_Asset_Editors/Object_Properties/Async_Events/Steam.htm">Steam Async Event</a> with the following code:</p>
<pre class="hljs"><span class="hljs-comment">// Early exit if event type doesn&#x27;t match</span>
<span class="hljs-keyword">if</span> (<span class="hljs-symbol">async_load</span>[? <span class="hljs-string">&quot;event_type&quot;</span>] != <span class="hljs-string">&quot;inventory_request_prices&quot;</span>) <span class="hljs-keyword">exit</span>;
<span class="hljs-comment">// Early exit if handle doesn&#x27;t match</span>
<span class="hljs-keyword">if</span> (<span class="hljs-symbol">async_load</span>[? <span class="hljs-string">&quot;success&quot;</span>])
{
<span class="hljs-built_in">show_debug_message</span>(<span class="hljs-string">&quot;The currenct being used is: &quot;</span> + <span class="hljs-symbol">async_load</span>[? <span class="hljs-string">&quot;currency&quot;</span>]);
<span class="hljs-keyword">var</span> price = steam_inventory_get_item_price(<span class="hljs-literal">global</span>.swordId);
}
</pre><p> The code above matches the event type and if so shows the currency being used. It also gets the price for a specific item using the <a href="#steam_inventory_get_item_price">steam_inventory_get_item_price</a> function.</p>
<p><br><br></p>
<hr>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_inventory_start_purchase">steam_inventory_start_purchase</h1>
<p> Starts the purchase process for the user, given a &quot;shopping cart&quot; of item definitions that the user would like to buy.
The user will be prompted in the Steam Overlay to complete the purchase in their local currency, funding their Steam Wallet if necessary, etc.</p>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="eight_pointed_black_star" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2734.png">✴️</g-emoji> EXTERNAL</strong></p>
<p>A wrapper around <a href="https://partner.steamgames.com/doc/api/ISteamInventory#StartPurchase">StartPurchase</a>.</p>
</blockquote>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_inventory_start_purchase(array);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>array</td>
<td>array&lt;<a href="#inventoryitemcreationdata">InventoryItemCreationData</a>&gt;</td>
<td>An array of <a href="https://manual.yoyogames.com/GameMaker_Language/GML_Overview/Structs.htm">structs</a> representing items to be purchased (see <a href="#inventoryitemcreationdata">InventoryItemCreationData</a>)</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">N/A</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">var</span> arrayCreate = [
{item_def: item1, quantity: <span class="hljs-number">3</span>},
{item_def: item2, quantity: <span class="hljs-number">5</span>},
]
steam_inventory_start_purchase()
</pre><p> The code above will initialize a purchase intent that will be finalized in the Steam Overlay.</p>
<p><br><br></p>
<hr>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_inventory_add_promo_item">steam_inventory_add_promo_item</h1>
<p> Take an Item Definition and grants the user the promo item. Item Definitions are integer numbers ranging from 1 to 999999999. Values below the range are invalid and values above the range are reserved.
This is an asynchronous function that will trigger the <a href="https://manual-en.yoyogames.com/The_Asset_Editors/Object_Properties/Async_Events/Steam.htm">Steam Async Event</a> when the task is finished.</p>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="warning" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/26a0.png">⚠️</g-emoji> IMPORTANT</strong></p>
<p>You must call <a href="#steam_inventory_result_destroy">steam_inventory_result_destroy</a> on the returned async result ID when you are done with it.</p>
</blockquote>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="eight_pointed_black_star" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2734.png">✴️</g-emoji> EXTERNAL</strong></p>
<p>A wrapper around <a href="https://partner.steamgames.com/doc/api/ISteamInventory#AddPromoItem">AddPromoItem</a>.</p>
</blockquote>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_inventory_add_promo_item(item_def)</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>item_def</td>
<td>int64</td>
<td>The <a href="https://partner.steamgames.com/doc/api/ISteamInventory#SteamItemDef_t">steam_inventory_item_def</a> to grant the player (number between 1 and 999999999)</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs"><span class="hljs-built_in">real</span></pre><p><br></p>
<p><strong>Triggers:</strong></p>
<pre class="hljs">Asynchronous Steam Event</pre><table>
<thead>
<tr>
<th>Key</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>event_type</td>
<td>string</td>
<td>The string value <code>&quot;inventory_result_ready&quot;</code></td>
</tr>
<tr>
<td>success</td>
<td>bool</td>
<td>Whether the async action succeeded</td>
</tr>
<tr>
<td>result</td>
<td><a href="#inventoryresultstatus">InventoryResultStatus</a></td>
<td>The status code as returned by <a href="#steam_inventory_result_get_status">steam_inventory_result_get_status</a></td>
</tr>
<tr>
<td>handle</td>
<td>real</td>
<td>The associated async result ID, which can be used to tell apart what result this event is for.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs">steam_inventory_add_promo_item(item)</pre><p> The above code will grant the user with a specific item. For an example on how to use the <a href="https://manual-en.yoyogames.com/The_Asset_Editors/Object_Properties/Async_Events/Steam.htm">Steam Async Event</a> to read the callback response, refer to the function <a href="#steam_inventory_get_all_items">steam_inventory_get_all_items</a>.</p>
<p><br><br></p>
<hr>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_inventory_add_promo_items">steam_inventory_add_promo_items</h1>
<p> Takes an array of Item Definitions and grants the user multiple items. Item Definitions are integer numbers ranging from 1 to 999999999. Values below the range are invalid and values above the range are reserved.
This is an asynchronous function that will trigger the <a href="https://manual-en.yoyogames.com/The_Asset_Editors/Object_Properties/Async_Events/Steam.htm">Steam Async Event</a> when the task is finished.</p>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="warning" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/26a0.png">⚠️</g-emoji> IMPORTANT</strong></p>
<p>You must call <a href="#steam_inventory_result_destroy">steam_inventory_result_destroy</a> on the returned async result ID when you are done with it.</p>
</blockquote>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="eight_pointed_black_star" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2734.png">✴️</g-emoji> EXTERNAL</strong></p>
<p>A wrapper around <a href="https://partner.steamgames.com/doc/api/ISteamInventory#AddPromoItems">AddPromoItems</a>.</p>
</blockquote>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_inventory_add_promo_items(item_defs)</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>item_defs</td>
<td>array</td>
<td>An array of <a href="https://partner.steamgames.com/doc/api/ISteamInventory#SteamItemDef_t">steam_inventory_item_def</a> to grant the user with.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs"><span class="hljs-built_in">real</span></pre><p><br></p>
<p><strong>Triggers:</strong></p>
<pre class="hljs">Asynchronous Steam Event</pre><table>
<thead>
<tr>
<th>Key</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>event_type</td>
<td>string</td>
<td>The string value <code>&quot;inventory_result_ready&quot;</code></td>
</tr>
<tr>
<td>success</td>
<td>bool</td>
<td>Whether the async action succeeded</td>
</tr>
<tr>
<td>result</td>
<td><a href="#inventoryresultstatus">InventoryResultStatus</a></td>
<td>The status code as returned by <a href="#steam_inventory_result_get_status">steam_inventory_result_get_status</a></td>
</tr>
<tr>
<td>handle</td>
<td>real</td>
<td>The associated async result ID, which can be used to tell apart what result this event is for.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs">steam_inventory_add_promo_items([item1,item2,item3])</pre><p> The above code will grant the user with an multiple items specified in an array format. For an example on how to use the <a href="https://manual-en.yoyogames.com/The_Asset_Editors/Object_Properties/Async_Events/Steam.htm">Steam Async Event</a> to read the callback response, refer to the function <a href="#steam_inventory_get_all_items">steam_inventory_get_all_items</a>.</p>
<p><br><br></p>
<hr>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_inventory_exchange_items">steam_inventory_exchange_items</h1>
<p> Grants one item in exchange for a set of other items.
This is an asynchronous function that will trigger the <a href="https://manual-en.yoyogames.com/The_Asset_Editors/Object_Properties/Async_Events/Steam.htm">Steam Async Event</a> when the task is finished.</p>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="warning" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/26a0.png">⚠️</g-emoji> IMPORTANT</strong></p>
<p> You must call <a href="#steam_inventory_result_destroy">steam_inventory_result_destroy</a> on the returned async result ID when you are done with it.</p>
</blockquote>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="eight_pointed_black_star" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2734.png">✴️</g-emoji> EXTERNAL</strong></p>
<p>A wrapper around <a href="https://partner.steamgames.com/doc/api/ISteamInventory#ExchangeItems">ExchangeItems</a>.</p>
</blockquote>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_inventory_exchange_items(create_arr, destroy_arr);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>create_arr</td>
<td>array&lt;<a href="#inventoryitemcreationdata">InventoryItemCreationData</a>&gt;</td>
<td>An array of <a href="https://manual.yoyogames.com/GameMaker_Language/GML_Overview/Structs.htm">structs</a> representing items to be created (see <a href="#inventoryitemcreationdata">InventoryItemCreationData</a>)</td>
</tr>
<tr>
<td>destroy_arr</td>
<td>array&lt;<a href="#inventoryitemconsumptiondata">InventoryItemConsumptionData</a>&gt;</td>
<td>An array of <a href="https://manual.yoyogames.com/GameMaker_Language/GML_Overview/Structs.htm">structs</a> representing items to be consumed (see <a href="#inventoryitemconsumptiondata">InventoryItemConsumptionData</a>)</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs"><span class="hljs-built_in">real</span></pre><p><br></p>
<p><strong>Triggers:</strong></p>
<pre class="hljs">Asynchronous Steam Event</pre><table>
<thead>
<tr>
<th>Key</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>event_type</td>
<td>string</td>
<td>The string value <code>&quot;inventory_result_ready&quot;</code></td>
</tr>
<tr>
<td>success</td>
<td>bool</td>
<td>Whether the async action succeeded</td>
</tr>
<tr>
<td>result</td>
<td><a href="#inventoryresultstatus">InventoryResultStatus</a></td>
<td>The status code as returned by <a href="#steam_inventory_result_get_status">steam_inventory_result_get_status</a></td>
</tr>
<tr>
<td>handle</td>
<td>real</td>
<td>The associated async result ID, which can be used to tell apart what result this event is for.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">var</span> arrayDestroy = [
{ item_id: player.cursed_sword, quantity: <span class="hljs-number">1</span> },
{ item_id: player.apple, quantity: <span class="hljs-number">7</span> },
];
<span class="hljs-keyword">var</span> arrayCreate = [
{ item_def: <span class="hljs-literal">global</span>.holy_sword, quantity: <span class="hljs-number">1</span> },
{ item_def: <span class="hljs-literal">global</span>.orange, quantity: <span class="hljs-number">2</span> }
];
steam_inventory_exchange_items(arrayCreate, arrayDestroy);
</pre><p> Given the provided items to be destroyed and the items to be create the code above will perform an exchange removing the current items (<code>arrayDestroy</code>) from the inventory and adding the new (<code>arrayCreate</code>) in their place. The result for this task can be caught inside the <a href="https://manual-en.yoyogames.com/The_Asset_Editors/Object_Properties/Async_Events/Steam.htm">Steam Async Event</a> with the following code:</p>
<pre class="hljs"><span class="hljs-comment">// Early exit if event type doesn&#x27;t match</span>
<span class="hljs-keyword">if</span> (<span class="hljs-symbol">async_load</span>[? <span class="hljs-string">&quot;event_type&quot;</span>] != <span class="hljs-string">&quot;inventory_result_ready&quot;</span>) <span class="hljs-keyword">exit</span>;
<span class="hljs-comment">// Early exit if handle doesn&#x27;t match</span>
<span class="hljs-keyword">if</span> (<span class="hljs-symbol">async_load</span>[? <span class="hljs-string">&quot;handle&quot;</span>] != handle) <span class="hljs-keyword">exit</span>;
<span class="hljs-comment">// Early exit if handle doesn&#x27;t match</span>
<span class="hljs-keyword">if</span> (<span class="hljs-symbol">async_load</span>[? <span class="hljs-string">&quot;success&quot;</span>])
{
<span class="hljs-built_in">show_debug_message</span>(<span class="hljs-string">&quot;Exchange was a success&quot;</span>);
}
<span class="hljs-keyword">else</span>
{
<span class="hljs-built_in">show_debug_message</span>(<span class="hljs-string">&quot;Exchange failed&quot;</span>);
}
<span class="hljs-comment">// Don&#x27;t forget to clean the ununsed handle</span>
steam_inventory_result_destroy(handle);
handle = <span class="hljs-literal">undefined</span>;
</pre><p> The code above matches the event type and checks if the handle id matches the one that initialized the request and if so we print a debug message with the success of the task. In the end we also use a call to <a href="#steam_inventory_result_destroy">steam_inventory_result_destroy</a> to make sure we dispose and free all the used memory.</p>
<p><br><br></p>
<hr>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_inventory_generate_items">steam_inventory_generate_items</h1>
<p> Generates specific items for the current user.
This is an asynchronous function that will trigger the <a href="https://manual-en.yoyogames.com/The_Asset_Editors/Object_Properties/Async_Events/Steam.htm">Steam Async Event</a> when the task is finished.</p>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="information_source" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2139.png"></g-emoji> NOTE</strong></p>
<p>This is only usable by Steam accounts that belong to the publisher group for your game.</p>
</blockquote>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="warning" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/26a0.png">⚠️</g-emoji> IMPORTANT</strong></p>
<p> You must call <a href="#steam_inventory_result_destroy">steam_inventory_result_destroy</a> on the returned async result ID when you are done with it.</p>
</blockquote>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="eight_pointed_black_star" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2734.png">✴️</g-emoji> EXTERNAL</strong></p>
<p>A wrapper around <a href="https://partner.steamgames.com/doc/api/ISteamInventory#GenerateItems">GenerateItems</a>.</p>
</blockquote>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_inventory_generate_items(create_arr);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>create_arr</td>
<td>array&lt;<a href="#inventoryitemcreationdata">InventoryItemCreationData</a>&gt;</td>
<td>An array of <a href="https://manual.yoyogames.com/GameMaker_Language/GML_Overview/Structs.htm">structs</a> representing items to be created (see <a href="#inventoryitemcreationdata">InventoryItemCreationData</a>)</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs"><span class="hljs-built_in">real</span></pre><p><br></p>
<p><strong>Triggers:</strong></p>
<pre class="hljs">Asynchronous Steam Event</pre><table>
<thead>
<tr>
<th>Key</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>event_type</td>
<td>string</td>
<td>The string value <code>&quot;inventory_result_ready&quot;</code></td>
</tr>
<tr>
<td>success</td>
<td>bool</td>
<td>Whether the async action succeeded</td>
</tr>
<tr>
<td>result</td>
<td><a href="#inventoryresultstatus">InventoryResultStatus</a></td>
<td>The status code as returned by <a href="#steam_inventory_result_get_status">steam_inventory_result_get_status</a></td>
</tr>
<tr>
<td>handle</td>
<td>real</td>
<td>The associated async result ID, which can be used to tell apart what result this event is for.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">var</span> arrayCreate = [
{item_def: item1, quantity: <span class="hljs-number">3</span>},
{item_def: item2, quantity: <span class="hljs-number">5</span>},
];
steam_inventory_generate_items(arrayCreate)
</pre><p> The code above will grant the specific items to the current user. For an example on how to use the <a href="https://manual-en.yoyogames.com/The_Asset_Editors/Object_Properties/Async_Events/Steam.htm">Steam Async Event</a> to read the callback response, refer to the function <a href="#steam_inventory_get_all_items">steam_inventory_get_all_items</a>.</p>
<p><br><br></p>
<hr>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_inventory_get_all_items">steam_inventory_get_all_items</h1>
<p> Starts retrieving all items in the current user&#39;s inventory.
This is an asynchronous function that will trigger the <a href="https://manual-en.yoyogames.com/The_Asset_Editors/Object_Properties/Async_Events/Steam.htm">Steam Async Event</a> when the task is finished.</p>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="warning" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/26a0.png">⚠️</g-emoji> IMPORTANT</strong></p>
<p> You must call <a href="#steam_inventory_result_destroy">steam_inventory_result_destroy</a> on the returned async result ID when you are done with it.</p>
</blockquote>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="eight_pointed_black_star" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2734.png">✴️</g-emoji> EXTERNAL</strong></p>
<p>A wrapper around <a href="https://partner.steamgames.com/doc/api/ISteamInventory#GetAllItems">GetAllItems</a>.</p>
</blockquote>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_inventory_get_all_items();</pre><p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs"><span class="hljs-built_in">real</span></pre><p><br></p>
<p><strong>Triggers:</strong></p>
<pre class="hljs">Asynchronous Steam Event</pre><table>
<thead>
<tr>
<th>Key</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>event_type</td>
<td>string</td>
<td>The string value <code>&quot;inventory_result_ready&quot;</code></td>
</tr>
<tr>
<td>success</td>
<td>bool</td>
<td>Whether the async action succeeded</td>
</tr>
<tr>
<td>result</td>
<td><a href="#inventoryresultstatus">InventoryResultStatus</a></td>
<td>The status code as returned by <a href="#steam_inventory_result_get_status">steam_inventory_result_get_status</a></td>
</tr>
<tr>
<td>handle</td>
<td>real</td>
<td>The associated async result ID, which can be used to tell apart what result this event is for.</td>
</tr>
</tbody>
</table>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="eight_pointed_black_star" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2734.png">✴️</g-emoji> OPTIONAL</strong></p>
<p>The asynchronous event presented below is only triggered when the result is newer/fresher than the last known result. It will not trigger if the inventory hasn&#39;t changed, or if results from two overlapping calls are reversed in flight and the earlier result is already known to be stale/out-of-date. The regular callback will still be triggered immediately afterwards; this is an additional notification for your convenience.</p>
</blockquote>
<table>
<thead>
<tr>
<th>Key</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>event_type</td>
<td>string</td>
<td>The string value <code>&quot;inventory_full_update&quot;</code></td>
</tr>
<tr>
<td>success</td>
<td>bool</td>
<td>Whether the async action succeeded</td>
</tr>
<tr>
<td>handle</td>
<td>real</td>
<td>The associated async result ID, which can be used to tell apart what result this event is for.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs">handle = steam_inventory_get_all_items();</pre><p> The code above will start a query for all the items in current users inventory. The result for this task can be caught inside the <a href="https://manual-en.yoyogames.com/The_Asset_Editors/Object_Properties/Async_Events/Steam.htm">Steam Async Event</a> with the following code:</p>
<pre class="hljs"><span class="hljs-comment">// Early exit if event type doesn&#x27;t match</span>
<span class="hljs-keyword">if</span> (<span class="hljs-symbol">async_load</span>[? <span class="hljs-string">&quot;event_type&quot;</span>] != <span class="hljs-string">&quot;inventory_result_ready&quot;</span>) <span class="hljs-keyword">exit</span>;
<span class="hljs-comment">// Early exit if handle doesn&#x27;t match</span>
<span class="hljs-keyword">if</span> (<span class="hljs-symbol">async_load</span>[? <span class="hljs-string">&quot;handle&quot;</span>] != handle) <span class="hljs-keyword">exit</span>;
<span class="hljs-comment">// Early exit if handle doesn&#x27;t match</span>
<span class="hljs-keyword">if</span> (<span class="hljs-symbol">async_load</span>[? <span class="hljs-string">&quot;success&quot;</span>])
{
<span class="hljs-keyword">var</span> items = steam_inventory_result_get_items(handle);
<span class="hljs-keyword">for</span> (<span class="hljs-keyword">var</span> i = <span class="hljs-number">0</span>; i &lt; <span class="hljs-built_in">array_length</span>(items); i++)
{
<span class="hljs-keyword">var</span> item = items[i];
<span class="hljs-comment">// access item data for each entry</span>
<span class="hljs-comment">//</span>
<span class="hljs-comment">// item.item_id</span>
<span class="hljs-comment">// item.item_def</span>
<span class="hljs-comment">// item.quantity</span>
<span class="hljs-comment">// item.flags</span>
}
}
<span class="hljs-comment">// Don&#x27;t forget to clean the ununsed handle</span>
steam_inventory_result_destroy(handle);
handle = <span class="hljs-literal">undefined</span>;
</pre><p> The code above matches the event type and checks if the handle id matches the one that initialized the request and if so gets the items from the result using the function <a href="#steam_inventory_result_get_items">steam_inventory_result_get_items</a> and loops through them. In the end we also use a call to <a href="#steam_inventory_result_destroy">steam_inventory_result_destroy</a> to make sure we dispose and free all the used memory.</p>
<p><br><br></p>
<hr>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_inventory_get_items_by_id">steam_inventory_get_items_by_id</h1>
<p> Requests information about a subset of the current user&#39;s inventory.</p>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="warning" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/26a0.png">⚠️</g-emoji> IMPORTANT</strong></p>
<p> You must call <a href="#steam_inventory_result_destroy">steam_inventory_result_destroy</a> on the returned async result ID when you are done with it.</p>
</blockquote>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="eight_pointed_black_star" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2734.png">✴️</g-emoji> EXTERNAL</strong></p>
<p>A wrapper around <a href="https://partner.steamgames.com/doc/api/ISteamInventory#GetItemsByID">GetItemsByID</a>.</p>
</blockquote>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_inventory_get_items_by_id(item_ids);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>item_ids</td>
<td>array</td>
<td>An array of <a href="https://partner.steamgames.com/doc/api/ISteamInventory#SteamItemInstanceID_t">steam_inventory_item_id</a> of items to get information of.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs"><span class="hljs-built_in">real</span></pre><p><br></p>
<p><strong>Triggers:</strong></p>
<pre class="hljs">Asynchronous Steam Event</pre><table>
<thead>
<tr>
<th>Key</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>event_type</td>
<td>string</td>
<td>The string value <code>&quot;inventory_result_ready&quot;</code></td>
</tr>
<tr>
<td>success</td>
<td>bool</td>
<td>Whether the async action succeeded</td>
</tr>
<tr>
<td>result</td>
<td><a href="#inventoryresultstatus">InventoryResultStatus</a></td>
<td>The status code as returned by <a href="#steam_inventory_result_get_status">steam_inventory_result_get_status</a></td>
</tr>
<tr>
<td>handle</td>
<td>real</td>
<td>The associated async result ID, which can be used to tell apart what result this event is for.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs">handle = steam_inventory_get_items_by_id([item1, item2])</pre><p> Similar to <a href="#steam_inventory_get_all_items">steam_inventory_get_all_items</a> but you can specify an array of items to query information instead of querying all of them. For an example on how to use the <a href="https://manual-en.yoyogames.com/The_Asset_Editors/Object_Properties/Async_Events/Steam.htm">Steam Async Event</a> to read the callback response, refer to the function <a href="#steam_inventory_get_all_items">steam_inventory_get_all_items</a>.</p>
<p><br><br></p>
<hr>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_inventory_submit_update_properties">steam_inventory_submit_update_properties</h1>
<p> Submits the transaction request to modify <a href="https://partner.steamgames.com/doc/features/inventory/dynamicproperties">dynamic properties</a> on items for the current user. See <a href="https://partner.steamgames.com/doc/api/ISteamInventory#StartUpdateProperties">StartUpdateProperties</a>.</p>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="warning" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/26a0.png">⚠️</g-emoji> IMPORTANT</strong></p>
<p> You must call <a href="#steam_inventory_result_destroy">steam_inventory_result_destroy</a> on the returned async result ID when you are done with it.</p>
</blockquote>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="eight_pointed_black_star" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2734.png">✴️</g-emoji> EXTERNAL</strong></p>
<p>A wrapper around <a href="https://partner.steamgames.com/doc/api/ISteamInventory#SubmitUpdateProperties">SubmitUpdateProperties</a>.</p>
</blockquote>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_inventory_submit_update_properties(handle);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>handle</td>
<td>real</td>
<td>The update handle corresponding to the transaction request</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs"><span class="hljs-built_in">real</span></pre><p><br></p>
<p><strong>Triggers:</strong></p>
<pre class="hljs">Asynchronous Steam Event</pre><table>
<thead>
<tr>
<th>Key</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>event_type</td>
<td>string</td>
<td>The string value <code>&quot;inventory_result_ready&quot;</code></td>
</tr>
<tr>
<td>success</td>
<td>bool</td>
<td>Whether the async action succeeded</td>
</tr>
<tr>
<td>result</td>
<td><a href="#inventoryresultstatus">InventoryResultStatus</a></td>
<td>The status code as returned by <a href="#steam_inventory_result_get_status">steam_inventory_result_get_status</a></td>
</tr>
<tr>
<td>handle</td>
<td>real</td>
<td>The associated async result ID, which can be used to tell apart what result this event is for.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">var</span> handle = steam_inventory_start_update_properties()
steam_inventory_set_property_bool(handle, item_id, <span class="hljs-string">&quot;invisible&quot;</span>, <span class="hljs-literal">true</span>)
steam_inventory_set_property_float(handle, item_id, <span class="hljs-string">&quot;power&quot;</span>, <span class="hljs-number">123.54</span>)
steam_inventory_set_property_int(handle, item_id, <span class="hljs-string">&quot;uses&quot;</span>, <span class="hljs-number">5</span>)
steam_inventory_set_property_string(handle, item_id, <span class="hljs-string">&quot;name&quot;</span>, <span class="hljs-string">&quot;Big Sword&quot;</span>)
...
steam_inventory_remove_property(handle, item_id, <span class="hljs-string">&quot;invisible&quot;</span>)
...
steam_inventory_submit_update_properties(handle)</pre><p> The code above provides a simple sample on how to set/removed some properties.
Starting with a <a href="#steam_inventory_start_update_properties">steam_inventory_start_update_properties</a> then multiple calls to set/remove property functions:</p>
<ul>
<li><a href="#steam_inventory_set_property_bool">steam_inventory_set_property_bool</a></li>
<li><a href="#steam_inventory_set_property_float">steam_inventory_set_property_float</a></li>
<li><a href="#steam_inventory_set_property_int">steam_inventory_set_property_int</a></li>
<li><a href="#steam_inventory_set_property_string">steam_inventory_set_property_string</a></li>
<li><p><a href="#steam_inventory_remove_property">steam_inventory_remove_property</a></p>
<p>Finishing with the submition of the update using the function call <a href="#steam_inventory_submit_update_properties">steam_inventory_submit_update_properties</a>. For an example on how to use the <a href="https://manual-en.yoyogames.com/The_Asset_Editors/Object_Properties/Async_Events/Steam.htm">Steam Async Event</a> to read the callback response, refer to the function <a href="#steam_inventory_get_all_items">steam_inventory_get_all_items</a>.</p>
</li>
</ul>
<p><br><br></p>
<hr>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_inventory_transfer_item_quantity">steam_inventory_transfer_item_quantity</h1>
<p> Transfer items between stacks within a user&#39;s inventory.</p>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="warning" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/26a0.png">⚠️</g-emoji> IMPORTANT</strong></p>
<p> You must call <a href="#steam_inventory_result_destroy">steam_inventory_result_destroy</a> on the returned async result ID when you are done with it.</p>
</blockquote>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="eight_pointed_black_star" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2734.png">✴️</g-emoji> EXTERNAL</strong></p>
<p>A wrapper around <a href="https://partner.steamgames.com/doc/api/ISteamInventory#TransferItemQuantity">TransferItemQuantity</a>.</p>
</blockquote>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_inventory_transfer_item_quantity(source_item_id, quantity, dest_item_id);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>source_item_id</td>
<td>int64</td>
<td>The source <a href="https://partner.steamgames.com/doc/api/ISteamInventory#SteamItemInstanceID_t">steam_inventory_item_id</a> to transfer from</td>
</tr>
<tr>
<td>quantity</td>
<td>real</td>
<td>The quantity of the item that will be transferred</td>
</tr>
<tr>
<td>dest_item_id</td>
<td>int64</td>
<td>The destination <a href="https://partner.steamgames.com/doc/api/ISteamInventory#SteamItemInstanceID_t">steam_inventory_item_id</a> to transfer to</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs"><span class="hljs-built_in">real</span></pre><p><br></p>
<p><strong>Triggers:</strong></p>
<pre class="hljs">Asynchronous Steam Event</pre><table>
<thead>
<tr>
<th>Key</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>event_type</td>
<td>string</td>
<td>The string value <code>&quot;inventory_result_ready&quot;</code></td>
</tr>
<tr>
<td>success</td>
<td>bool</td>
<td>Whether the async action succeeded</td>
</tr>
<tr>
<td>result</td>
<td><a href="#inventoryresultstatus">InventoryResultStatus</a></td>
<td>The status code as returned by <a href="#steam_inventory_result_get_status">steam_inventory_result_get_status</a></td>
</tr>
<tr>
<td>handle</td>
<td>real</td>
<td>The associated async result ID, which can be used to tell apart what result this event is for.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs">handle = steam_inventory_transfer_item_quantity(<span class="hljs-literal">global</span>.apple, <span class="hljs-number">2</span>, <span class="hljs-literal">global</span>.oranges);</pre><p> The above code will trigger a transfer between to items owned by the used the amount to be transferred in the example, the user will lose 2 apples and receive 2 oranges. For an example on how to use the <a href="https://manual-en.yoyogames.com/The_Asset_Editors/Object_Properties/Async_Events/Steam.htm">Steam Async Event</a> to read the callback response, refer to the function <a href="#steam_inventory_get_all_items">steam_inventory_get_all_items</a>.</p>
<p><br><br></p>
<hr>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_inventory_trigger_item_drop">steam_inventory_trigger_item_drop</h1>
<p> Trigger an item drop if the user has played a long enough period of time.<br>
<br>
This period can be customized in two places:</p>
<ul>
<li>At the application level within Inventory Service: Playtime Item Grants. This will automatically apply to all &quot;playtimegenerator&quot; items that do not specify any overrides.</li>
<li><p>In an individual &quot;playtimegenerator&quot; item definition. The settings would take precedence over any application-level settings.</p>
<p><br>
Only item definitions which are marked as &quot;playtime item generators&quot; can be spawned.</p>
<p>This is an asynchronous function that will trigger the <a href="https://manual-en.yoyogames.com/The_Asset_Editors/Object_Properties/Async_Events/Steam.htm">Steam Async Event</a> when the task is finished.</p>
</li>
</ul>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="warning" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/26a0.png">⚠️</g-emoji> IMPORTANT</strong></p>
<p> You must call <a href="#steam_inventory_result_destroy">steam_inventory_result_destroy</a> on the returned async result ID when you are done with it.</p>
</blockquote>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="eight_pointed_black_star" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2734.png">✴️</g-emoji> EXTERNAL</strong></p>
<p>A wrapper around <a href="https://partner.steamgames.com/doc/api/ISteamInventory#TriggerItemDrop">TriggerItemDrop</a>.</p>
</blockquote>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_inventory_trigger_item_drop(item_def);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>item_def</td>
<td>real</td>
<td>This must refer to an item definition of the type &quot;playtimegenerator&quot;. See the <a href="https://partner.steamgames.com/doc/features/inventory/schema">inventory schema</a> for more details.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">bool</pre><p><br></p>
<p><strong>Triggers:</strong></p>
<pre class="hljs">Asynchronous Steam Event</pre><table>
<thead>
<tr>
<th>Key</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>event_type</td>
<td>string</td>
<td>The string value <code>&quot;inventory_result_ready&quot;</code></td>
</tr>
<tr>
<td>success</td>
<td>bool</td>
<td>Whether the async action succeeded</td>
</tr>
<tr>
<td>result</td>
<td><a href="#inventoryresultstatus">InventoryResultStatus</a></td>
<td>The status code as returned by <a href="#steam_inventory_result_get_status">steam_inventory_result_get_status</a></td>
</tr>
<tr>
<td>handle</td>
<td>real</td>
<td>The associated async result ID, which can be used to tell apart what result this event is for.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs">handle = steam_inventory_trigger_item_drop(item_def)</pre><p> For more information on this function call please refer to the official manual. For an example on how to use the <a href="https://manual-en.yoyogames.com/The_Asset_Editors/Object_Properties/Async_Events/Steam.htm">Steam Async Event</a> to read the callback response, refer to the function <a href="#steam_inventory_get_all_items">steam_inventory_get_all_items</a>.</p>
<p><br><br></p>
<hr>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_inventory_result_destroy">steam_inventory_result_destroy</h1>
<p> Destroys a result handle and frees all associated memory.
This handle is returned by the following functions:</p>
<ul>
<li><a href="#steam_inventory_add_promo_item">steam_inventory_add_promo_item</a></li>
<li><a href="#steam_inventory_add_promo_items">steam_inventory_add_promo_items</a></li>
<li><a href="#steam_inventory_consume_item">steam_inventory_consume_item</a></li>
<li><a href="#steam_inventory_exchange_items">steam_inventory_exchange_items</a></li>
<li><a href="#steam_inventory_exchange_items-copy">steam_inventory_generate_items</a></li>
<li><a href="#steam_inventory_get_all_items">steam_inventory_get_all_items</a></li>
<li><a href="#steam_inventory_get_items_by_id">steam_inventory_get_items_by_id</a></li>
<li><a href="#steam_inventory_trigger_item_drop">steam_inventory_trigger_item_drop</a></li>
<li><a href="#steam_inventory_transfer_item_quantity">steam_inventory_transfer_item_quantity</a></li>
<li><a href="#steam_inventory_submit_update_properties">steam_inventory_submit_update_properties</a></li>
</ul>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="information_source" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2139.png"></g-emoji> NOTE</strong></p>
<p>This function can be called using an inventory result handle after the corresponding async event has been triggered.</p>
</blockquote>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="eight_pointed_black_star" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2734.png">✴️</g-emoji> EXTERNAL</strong></p>
<p>A wrapper around <a href="https://partner.steamgames.com/doc/api/ISteamInventory#DestroyResult">DestroyResult</a>.</p>
</blockquote>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_inventory_result_destroy(inv_result);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>inv_result</td>
<td>real</td>
<td>The inventory result handle to destroy</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">bool</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-comment">// Early exit if event type doesn&#x27;t match</span>
<span class="hljs-keyword">if</span> (<span class="hljs-symbol">async_load</span>[? <span class="hljs-string">&quot;event_type&quot;</span>] != <span class="hljs-string">&quot;inventory_result_ready&quot;</span>) <span class="hljs-keyword">exit</span>;
<span class="hljs-comment">// Early exit if handle doesn&#x27;t match</span>
<span class="hljs-keyword">if</span> (<span class="hljs-symbol">async_load</span>[? <span class="hljs-string">&quot;handle&quot;</span>] != handle) <span class="hljs-keyword">exit</span>;
<span class="hljs-comment">// Early exit if handle doesn&#x27;t match</span>
<span class="hljs-keyword">if</span> (<span class="hljs-symbol">async_load</span>[? <span class="hljs-string">&quot;success&quot;</span>])
{
<span class="hljs-built_in">show_debug_message</span>(<span class="hljs-string">&quot;Exchange was a success&quot;</span>);
}
<span class="hljs-keyword">else</span>
{
<span class="hljs-built_in">show_debug_message</span>(<span class="hljs-string">&quot;Exchange failed&quot;</span>);
}
<span class="hljs-comment">// Don&#x27;t forget to clean the ununsed handle</span>
steam_inventory_result_destroy(handle);
handle = <span class="hljs-literal">undefined</span>;
</pre><p> In the code above we have an example of a asynchronous callback that generates a result handle by the end of which we execute a call to <a href="#steam_inventory_result_destroy">steam_inventory_result_destroy</a> to make sure we dispose and free all the used memory.</p>
<p><br><br></p>
<hr>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_inventory_result_get_item_property">steam_inventory_result_get_item_property</h1>
<p> Gets the dynamic properties from an item in an inventory result set.
Property names are always composed of ASCII letters, numbers, and/or underscores.</p>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="information_source" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2139.png"></g-emoji> NOTE</strong></p>
<p>This function can be called using an inventory result handle after the corresponding async event has been triggered.</p>
</blockquote>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="eight_pointed_black_star" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2734.png">✴️</g-emoji> EXTERNAL</strong></p>
<p>A wrapper around <a href="https://partner.steamgames.com/doc/api/ISteamInventory#GetResultItemProperty">GetResultItemProperty</a>.</p>
</blockquote>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_inventory_result_get_item_property(inv_result, item_index, prop_name);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>inv_result</td>
<td>real</td>
<td>The inventory result handle</td>
</tr>
<tr>
<td>item_index</td>
<td>real</td>
<td>Position of the item in the result set</td>
</tr>
<tr>
<td>prop_name</td>
<td>string</td>
<td>The property name to get the value for</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs"><span class="hljs-built_in">string</span></pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs">handle = steam_inventory_get_all_items();</pre><p> The code above will start a query for all the items in current users inventory. The result for this task can be caught inside the <a href="https://manual-en.yoyogames.com/The_Asset_Editors/Object_Properties/Async_Events/Steam.htm">Steam Async Event</a> with the following code:</p>
<pre class="hljs"><span class="hljs-comment">// Early exit if event type doesn&#x27;t match</span>
<span class="hljs-keyword">if</span> (<span class="hljs-symbol">async_load</span>[? <span class="hljs-string">&quot;event_type&quot;</span>] != <span class="hljs-string">&quot;inventory_result_ready&quot;</span>) <span class="hljs-keyword">exit</span>;
<span class="hljs-comment">// Early exit if handle doesn&#x27;t match</span>
<span class="hljs-keyword">if</span> (<span class="hljs-symbol">async_load</span>[? <span class="hljs-string">&quot;handle&quot;</span>] != handle) <span class="hljs-keyword">exit</span>;
<span class="hljs-comment">// Early exit if handle doesn&#x27;t match</span>
<span class="hljs-keyword">if</span> (<span class="hljs-symbol">async_load</span>[? <span class="hljs-string">&quot;success&quot;</span>])
{
<span class="hljs-keyword">var</span> items = steam_inventory_result_get_items(handle);
<span class="hljs-keyword">var</span> status = steam_inventory_result_get_status(handle);
<span class="hljs-keyword">var</span> timestamp = steam_inventory_result_get_unix_timestamp(handle);
<span class="hljs-keyword">for</span> (<span class="hljs-keyword">var</span> i = <span class="hljs-number">0</span>; i &lt; <span class="hljs-built_in">array_length</span>(items); i++)
{
<span class="hljs-comment">// It&#x27;s also possible to get properties from each item using </span>
<span class="hljs-comment">// prop1 = steam_inventory_result_get_item_property(handle, i, &quot;property_name1&quot;)</span>
<span class="hljs-comment">// prop2 = steam_inventory_result_get_item_property(handle, i, &quot;property_name2&quot;)</span>
}
}
<span class="hljs-comment">// Don&#x27;t forget to clean the ununsed handle</span>
steam_inventory_result_destroy(handle);
handle = <span class="hljs-literal">undefined</span>;
</pre><p> The code above matches the event type and checks if the handle id matches the one that initialized the request and if so gets the items from the result using the function <a href="#steam_inventory_result_get_items">steam_inventory_result_get_items</a> and loops through them to get the item properties we want. In the end we also use a call to <a href="#steam_inventory_result_destroy">steam_inventory_result_destroy</a> to make sure we dispose and free all the used memory.</p>
<p><br><br></p>
<hr>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_inventory_result_get_items">steam_inventory_result_get_items</h1>
<p> Get the items associated with an inventory result handle.</p>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="information_source" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2139.png"></g-emoji> NOTE</strong></p>
<p>This function can be called using an inventory result handle after the corresponding async event has been triggered.</p>
</blockquote>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="eight_pointed_black_star" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2734.png">✴️</g-emoji> EXTERNAL</strong></p>
<p>A wrapper around <a href="https://partner.steamgames.com/doc/api/ISteamInventory#GetResultItems">GetResultItems</a>.</p>
</blockquote>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_inventory_result_get_items(inv_result);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>inv_result</td>
<td>real</td>
<td>The inventory result handle</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">array of structs</pre><table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>item_id</td>
<td>real</td>
<td>A representing the item instance</td>
</tr>
<tr>
<td>item_def</td>
<td>real</td>
<td>A representing the item type</td>
</tr>
<tr>
<td>quantity</td>
<td>int64</td>
<td>How many of the said item there is in the slot</td>
</tr>
<tr>
<td>flags</td>
<td>int64</td>
<td>This is a bit-masked collection of <a href="https://partner.steamgames.com/doc/api/ISteamInventory#ESteamItemFlags">ESteamItemFlags</a></td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">var</span> array = steam_inventory_result_get_items(inv_result);
<span class="hljs-keyword">for</span>(<span class="hljs-keyword">var</span> i = <span class="hljs-number">0</span> ; i &lt; array_lenght(array) ; i++)
{
<span class="hljs-keyword">var</span> struct = array[i]
<span class="hljs-keyword">var</span> item_id = struct.item_id
<span class="hljs-keyword">var</span> item_def = struct.item_def
<span class="hljs-keyword">var</span> quantity = struct.quantity
}</pre><p> For a more detailed implementation sample please refer to the <a href="#steam_inventory_get_all_items">steam_inventory_get_all_items</a> function.</p>
<p><br><br></p>
<hr>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_inventory_result_get_status">steam_inventory_result_get_status</h1>
<p> Returns status code of a result.</p>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="information_source" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2139.png"></g-emoji> NOTE</strong></p>
<p>This function can be called using an inventory result handle after the corresponding async event has been triggered.</p>
</blockquote>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="eight_pointed_black_star" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2734.png">✴️</g-emoji> EXTERNAL</strong></p>
<p>A wrapper around <a href="https://partner.steamgames.com/doc/api/ISteamInventory#GetResultStatus">GetResultStatus</a>.</p>
</blockquote>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_inventory_result_get_status(inv_result);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>inv_result</td>
<td>real</td>
<td>The inventory result handle</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">InventoryResultStatus</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs">
<span class="hljs-keyword">if</span>(steam_inventory_result_get_status(inv_result) != steam_inventory_result_status_ok)
<span class="hljs-keyword">exit</span></pre><p> For a more detailed implementation sample please refer to the <a href="#steam_inventory_result_get_item_property">steam_inventory_result_get_item_property</a> function.</p>
<p><br><br></p>
<hr>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_inventory_result_get_unix_timestamp">steam_inventory_result_get_unix_timestamp</h1>
<p> Returns a Unix timestamp for the server time at which the result was generated.</p>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="information_source" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2139.png"></g-emoji> NOTE</strong></p>
<p>This function can be called using an inventory result handle after the corresponding async event has been triggered.</p>
</blockquote>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="eight_pointed_black_star" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2734.png">✴️</g-emoji> EXTERNAL</strong></p>
<p>A wrapper around <a href="https://partner.steamgames.com/doc/api/ISteamInventory#GetResultTimestamp">GetResultTimestamp</a>.</p>
</blockquote>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_inventory_result_get_unix_timestamp(inv_result);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>inv_result</td>
<td>real</td>
<td>The inventory result handle</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs"><span class="hljs-built_in">int64</span></pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">var</span> timestamp = steam_inventory_result_get_unix_timestamp(inv_result);</pre><p> For a more detailed implementation sample please refer to the <a href="#steam_inventory_result_get_item_property">steam_inventory_result_get_item_property</a> function.</p>
<p><br><br></p>
<hr>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_inventory_start_update_properties">steam_inventory_start_update_properties</h1>
<p> Starts a transaction request to update dynamic properties on items for the current user.
Returns a steam_inventory_update_handle that can be used with the following functions:</p>
<ul>
<li><a href="#steam_inventory_remove_property">steam_inventory_remove_property</a></li>
<li><a href="#steam_inventory_set_property_bool">steam_inventory_set_property_bool</a></li>
<li><a href="#steam_inventory_set_property_float">steam_inventory_set_property_float</a></li>
<li><a href="#steam_inventory_set_property_int">steam_inventory_set_property_int</a></li>
<li><a href="#steam_inventory_set_property_string">steam_inventory_set_property_string</a></li>
</ul>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="eight_pointed_black_star" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2734.png">✴️</g-emoji> EXTERNAL</strong></p>
<p>A wrapper around <a href="https://partner.steamgames.com/doc/api/ISteamInventory#StartUpdateProperties">StartUpdateProperties</a>.</p>
</blockquote>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_inventory_start_update_properties()</pre><p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs"><span class="hljs-built_in">int64</span></pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs">handle = steam_inventory_start_update_properties()
steam_inventory_set_property_bool(handle, item_id, <span class="hljs-string">&quot;invisible&quot;</span>, <span class="hljs-literal">true</span>)
steam_inventory_set_property_float(handle, item_id, <span class="hljs-string">&quot;power&quot;</span>, <span class="hljs-number">123.54</span>)
steam_inventory_set_property_int(handle, item_id, <span class="hljs-string">&quot;uses&quot;</span>, <span class="hljs-number">5</span>)
steam_inventory_set_property_string(handle, item_id, <span class="hljs-string">&quot;name&quot;</span>, <span class="hljs-string">&quot;Big Sword&quot;</span>)
steam_inventory_submit_update_properties(handle)</pre><p> The code above provides a simple sample on how to set/removed some properties.
Starting with a <a href="#steam_inventory_start_update_properties">steam_inventory_start_update_properties</a> then mutliple calls to set/remove property functions:</p>
<ul>
<li><a href="#steam_inventory_set_property_bool">steam_inventory_set_property_bool</a></li>
<li><a href="#steam_inventory_set_property_float">steam_inventory_set_property_float</a></li>
<li><a href="#steam_inventory_set_property_int">steam_inventory_set_property_int</a></li>
<li><a href="#steam_inventory_set_property_string">steam_inventory_set_property_string</a></li>
<li><p><a href="#steam_inventory_remove_property">steam_inventory_remove_property</a></p>
<p>Finishing with the submition of the update using the function call <a href="#steam_inventory_submit_update_properties">steam_inventory_submit_update_properties</a>.</p>
</li>
</ul>
<p><br><br></p>
<hr>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_inventory_remove_property">steam_inventory_remove_property</h1>
<p> Removes a <a href="https://partner.steamgames.com/doc/features/inventory/dynamicproperties">dynamic property</a> of the given item.</p>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="eight_pointed_black_star" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2734.png">✴️</g-emoji> EXTERNAL</strong></p>
<p>A wrapper around <a href="https://partner.steamgames.com/doc/api/ISteamInventory#RemoveProperty">RemoveProperty</a>.</p>
</blockquote>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_inventory_remove_property(handle, item_id, prop_name);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>handle</td>
<td>real</td>
<td>The update handle returned by <a href="#steam_inventory_start_update_properties">steam_inventory_start_update_properties</a></td>
</tr>
<tr>
<td>item_id</td>
<td>int64</td>
<td>The <a href="https://partner.steamgames.com/doc/api/ISteamInventory#SteamItemInstanceID_t">steam_inventory_item_id</a> of the item being modified</td>
</tr>
<tr>
<td>prop_name</td>
<td>string</td>
<td>The dynamic property being removed</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">bool</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">var</span> handler = steam_inventory_start_update_properties()
steam_inventory_set_property_bool(handler, item_id, <span class="hljs-string">&quot;invisible&quot;</span>, <span class="hljs-literal">true</span>)
steam_inventory_set_property_float(handler, item_id, <span class="hljs-string">&quot;power&quot;</span>, <span class="hljs-number">123.54</span>)
steam_inventory_set_property_int(handler, item_id, <span class="hljs-string">&quot;uses&quot;</span>, <span class="hljs-number">5</span>)
steam_inventory_set_property_string(handler, item_id, <span class="hljs-string">&quot;name&quot;</span>, <span class="hljs-string">&quot;Big Sword&quot;</span>)
...
steam_inventory_remove_property(handler, item_id, <span class="hljs-string">&quot;invisible&quot;</span>)
...
steam_inventory_submit_update_properties(handler)</pre><p> The code above provides a simple sample on how to set/removed some properties.
Starting with a <a href="#steam_inventory_start_update_properties">steam_inventory_start_update_properties</a> then mutliple calls to set/remove property functions:</p>
<ul>
<li><a href="#steam_inventory_set_property_bool">steam_inventory_set_property_bool</a></li>
<li><a href="#steam_inventory_set_property_float">steam_inventory_set_property_float</a></li>
<li><a href="#steam_inventory_set_property_int">steam_inventory_set_property_int</a></li>
<li><a href="#steam_inventory_set_property_string">steam_inventory_set_property_string</a></li>
<li><p><a href="#steam_inventory_remove_property">steam_inventory_remove_property</a></p>
<p>Finishing with the submition of the update using the function call <a href="#steam_inventory_submit_update_properties">steam_inventory_submit_update_properties</a>.</p>
</li>
</ul>
<p><br><br></p>
<hr>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_inventory_set_property_bool">steam_inventory_set_property_bool</h1>
<p> Sets a <a href="https://partner.steamgames.com/doc/features/inventory/dynamicproperties">dynamic property</a> for the boolean given item </p>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="eight_pointed_black_star" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2734.png">✴️</g-emoji> EXTERNAL</strong></p>
<p>A wrapper around <a href="https://partner.steamgames.com/doc/api/ISteamInventory#SetProperty">SetProperty</a>.</p>
</blockquote>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_inventory_set_property_bool(handle, prop_name, val);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>handle</td>
<td>real</td>
<td>The update handle corresponding to the transaction request</td>
</tr>
<tr>
<td>prop_name</td>
<td>string</td>
<td>The dynamic property being added or updated.</td>
</tr>
<tr>
<td>val</td>
<td>bool</td>
<td>value being set.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">bool</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs">handle = steam_inventory_start_update_properties()
steam_inventory_set_property_bool(handle, item_id, <span class="hljs-string">&quot;invisible&quot;</span>, <span class="hljs-literal">true</span>)
steam_inventory_set_property_float(handle, item_id, <span class="hljs-string">&quot;power&quot;</span>, <span class="hljs-number">123.54</span>)
steam_inventory_set_property_int(handle, item_id, <span class="hljs-string">&quot;uses&quot;</span>, <span class="hljs-number">5</span>)
steam_inventory_set_property_string(handle, item_id, <span class="hljs-string">&quot;name&quot;</span>, <span class="hljs-string">&quot;Big Sword&quot;</span>)
...
steam_inventory_remove_property(handle, item_id, <span class="hljs-string">&quot;invisible&quot;</span>)
...
steam_inventory_submit_update_properties(handle)</pre><p> The code above provides a simple sample on how to set/removed some properties.
Starting with a <a href="#steam_inventory_start_update_properties">steam_inventory_start_update_properties</a> then mutliple calls to set/remove property functions:</p>
<ul>
<li><a href="#steam_inventory_set_property_bool">steam_inventory_set_property_bool</a></li>
<li><a href="#steam_inventory_set_property_float">steam_inventory_set_property_float</a></li>
<li><a href="#steam_inventory_set_property_int">steam_inventory_set_property_int</a></li>
<li><a href="#steam_inventory_set_property_string">steam_inventory_set_property_string</a></li>
<li><p><a href="#steam_inventory_remove_property">steam_inventory_remove_property</a></p>
<p>Finishing with the submition of the update using the function call <a href="#steam_inventory_submit_update_properties">steam_inventory_submit_update_properties</a>.</p>
</li>
</ul>
<p><br><br></p>
<hr>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_inventory_set_property_float">steam_inventory_set_property_float</h1>
<p> Sets a <a href="https://partner.steamgames.com/doc/features/inventory/dynamicproperties">dynamic property</a> for the float given item </p>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="eight_pointed_black_star" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2734.png">✴️</g-emoji> EXTERNAL</strong></p>
<p>A wrapper around <a href="https://partner.steamgames.com/doc/api/ISteamInventory#SetProperty">SetProperty</a>.</p>
</blockquote>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_inventory_set_property_float(handle, prop_name, val);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>handle</td>
<td>real</td>
<td>The update handle corresponding to the transaction request</td>
</tr>
<tr>
<td>prop_name</td>
<td>string</td>
<td>The dynamic property being added or updated.</td>
</tr>
<tr>
<td>val</td>
<td>real</td>
<td>value being set.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">bool</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs">handle = steam_inventory_start_update_properties()
steam_inventory_set_property_bool(handle, item_id, <span class="hljs-string">&quot;invisible&quot;</span>, <span class="hljs-literal">true</span>)
steam_inventory_set_property_float(handle, item_id, <span class="hljs-string">&quot;power&quot;</span>, <span class="hljs-number">123.54</span>)
steam_inventory_set_property_int(handle, item_id, <span class="hljs-string">&quot;uses&quot;</span>, <span class="hljs-number">5</span>)
steam_inventory_set_property_string(handle, item_id, <span class="hljs-string">&quot;name&quot;</span>, <span class="hljs-string">&quot;Big Sword&quot;</span>)
...
steam_inventory_remove_property(handle, item_id, <span class="hljs-string">&quot;invisible&quot;</span>)
...
steam_inventory_submit_update_properties(handle)</pre><p> The code above provides a simple sample on how to set/removed some properties.
Starting with a <a href="#steam_inventory_start_update_properties">steam_inventory_start_update_properties</a> then mutliple calls to set/remove property functions:</p>
<ul>
<li><a href="#steam_inventory_set_property_bool">steam_inventory_set_property_bool</a></li>
<li><a href="#steam_inventory_set_property_float">steam_inventory_set_property_float</a></li>
<li><a href="#steam_inventory_set_property_int">steam_inventory_set_property_int</a></li>
<li><a href="#steam_inventory_set_property_string">steam_inventory_set_property_string</a></li>
<li><p><a href="#steam_inventory_remove_property">steam_inventory_remove_property</a></p>
<p>Finishing with the submition of the update using the function call <a href="#steam_inventory_submit_update_properties">steam_inventory_submit_update_properties</a>.</p>
</li>
</ul>
<p><br><br></p>
<hr>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_inventory_set_property_int">steam_inventory_set_property_int</h1>
<p> Sets a <a href="https://partner.steamgames.com/doc/features/inventory/dynamicproperties">dynamic property</a> for the int given item </p>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="eight_pointed_black_star" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2734.png">✴️</g-emoji> EXTERNAL</strong></p>
<p>A wrapper around <a href="https://partner.steamgames.com/doc/api/ISteamInventory#SetProperty">SetProperty</a>.</p>
</blockquote>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_inventory_set_property_int(handle, prop_name, val);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>handle</td>
<td>real</td>
<td>The update handle corresponding to the transaction request</td>
</tr>
<tr>
<td>prop_name</td>
<td>string</td>
<td>The dynamic property being added or updated.</td>
</tr>
<tr>
<td>val</td>
<td>real</td>
<td>value being set.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">bool</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs">handle = steam_inventory_start_update_properties()
steam_inventory_set_property_bool(handle, item_id, <span class="hljs-string">&quot;invisible&quot;</span>, <span class="hljs-literal">true</span>)
steam_inventory_set_property_float(handle, item_id, <span class="hljs-string">&quot;power&quot;</span>, <span class="hljs-number">123.54</span>)
steam_inventory_set_property_int(handle, item_id, <span class="hljs-string">&quot;uses&quot;</span>, <span class="hljs-number">5</span>)
steam_inventory_set_property_string(handle, item_id, <span class="hljs-string">&quot;name&quot;</span>, <span class="hljs-string">&quot;Big Sword&quot;</span>)
...
steam_inventory_remove_property(handle, item_id, <span class="hljs-string">&quot;invisible&quot;</span>)
...
steam_inventory_submit_update_properties(handle)</pre><p> The code above provides a simple sample on how to set/removed some properties.
Starting with a <a href="#steam_inventory_start_update_properties">steam_inventory_start_update_properties</a> then mutliple calls to set/remove property functions:</p>
<ul>
<li><a href="#steam_inventory_set_property_bool">steam_inventory_set_property_bool</a></li>
<li><a href="#steam_inventory_set_property_float">steam_inventory_set_property_float</a></li>
<li><a href="#steam_inventory_set_property_int">steam_inventory_set_property_int</a></li>
<li><a href="#steam_inventory_set_property_string">steam_inventory_set_property_string</a></li>
<li><p><a href="#steam_inventory_remove_property">steam_inventory_remove_property</a></p>
<p>Finishing with the submition of the update using the function call <a href="#steam_inventory_submit_update_properties">steam_inventory_submit_update_properties</a>.</p>
</li>
</ul>
<p><br><br></p>
<hr>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_inventory_result_get_status">steam_inventory_result_get_status</h1>
<p> Sets a <a href="https://partner.steamgames.com/doc/features/inventory/dynamicproperties">dynamic property</a> for the string given item </p>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="eight_pointed_black_star" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2734.png">✴️</g-emoji> EXTERNAL</strong></p>
<p>A wrapper around <a href="https://partner.steamgames.com/doc/api/ISteamInventory#SetProperty">SetProperty</a>.</p>
</blockquote>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_inventory_set_property_string(handle, prop_name, val);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>handle</td>
<td>real</td>
<td>The update handle corresponding to the transaction request</td>
</tr>
<tr>
<td>prop_name</td>
<td>string</td>
<td>The dynamic property being added or updated.</td>
</tr>
<tr>
<td>val</td>
<td>string</td>
<td>value being set.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">bool</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">var</span> handle = steam_inventory_start_update_properties()
steam_inventory_set_property_bool(handle, item_id, <span class="hljs-string">&quot;invisible&quot;</span>, <span class="hljs-literal">true</span>)
steam_inventory_set_property_float(handle, item_id, <span class="hljs-string">&quot;power&quot;</span>, <span class="hljs-number">123.54</span>)
steam_inventory_set_property_int(handle, item_id, <span class="hljs-string">&quot;uses&quot;</span>, <span class="hljs-number">5</span>)
steam_inventory_set_property_string(handle, item_id, <span class="hljs-string">&quot;name&quot;</span>, <span class="hljs-string">&quot;Big Sword&quot;</span>)
...
steam_inventory_remove_property(handle, item_id, <span class="hljs-string">&quot;invisible&quot;</span>)
...
steam_inventory_submit_update_properties(handle)</pre><p> The code above provides a simple sample on how to set/removed some properties.
Starting with a <a href="#steam_inventory_start_update_properties">steam_inventory_start_update_properties</a> then mutliple calls to set/remove property functions:</p>
<ul>
<li><a href="#steam_inventory_set_property_bool">steam_inventory_set_property_bool</a></li>
<li><a href="#steam_inventory_set_property_float">steam_inventory_set_property_float</a></li>
<li><a href="#steam_inventory_set_property_int">steam_inventory_set_property_int</a></li>
<li><a href="#steam_inventory_set_property_string">steam_inventory_set_property_string</a></li>
<li><p><a href="#steam_inventory_remove_property">steam_inventory_remove_property</a></p>
<p>Finishing with the submition of the update using the function call <a href="#steam_inventory_submit_update_properties">steam_inventory_submit_update_properties</a>.</p>
</li>
</ul>
<p><br><br></p>
<hr>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="inventoryresultstatus">InventoryResultStatus</h1>
<p> These constants represent the status of an inventory result async event, and are returned by the async events of the following functions:</p>
<ul>
<li><a href="#steam_inventory_add_promo_item">steam_inventory_add_promo_item</a></li>
<li><a href="#steam_inventory_add_promo_items">steam_inventory_add_promo_items</a></li>
<li><a href="#steam_inventory_consume_item">steam_inventory_consume_item</a></li>
<li><a href="#steam_inventory_exchange_items">steam_inventory_exchange_items</a></li>
<li><a href="#steam_inventory_get_all_items">steam_inventory_get_all_items</a></li>
</ul>
<table>
<thead>
<tr>
<th>Inventory Result Status Constant</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>steam_inventory_result_status_pending</code></td>
<td>Pending</td>
</tr>
<tr>
<td><code>steam_inventory_result_status_ok</code></td>
<td>Ok</td>
</tr>
<tr>
<td><code>steam_inventory_result_status_expired</code></td>
<td>Expired</td>
</tr>
<tr>
<td><code>steam_inventory_result_status_invalid</code></td>
<td>Invalid</td>
</tr>
<tr>
<td><code>steam_inventory_result_status_fail</code></td>
<td>Fail</td>
</tr>
<tr>
<td><code>steam_inventory_result_status_invalid_param</code></td>
<td>Iinvalid</td>
</tr>
<tr>
<td><code>steam_inventory_result_status_service_unavailable</code></td>
<td>Unavailable</td>
</tr>
<tr>
<td><code>steam_inventory_result_status_limit_exceeded</code></td>
<td>Exceeded</td>
</tr>
</tbody>
</table>
<p> <br></p>
<p><br><br></p>
<hr>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="inventoryitemconsumptiondata">InventoryItemConsumptionData</h1>
<p> This struct is used as an argument when performing a call to the following functions</p>
<ul>
<li><p><a href="#steam_inventory_exchange_items">steam_inventory_exchange_items</a></p>
<p>and it contains the following details about an item consumption:</p>
</li>
</ul>
<table>
<thead>
<tr>
<th>Key</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>item_id</td>
<td>int64</td>
<td>A <a href="https://partner.steamgames.com/doc/api/ISteamInventory#SteamItemInstanceID_t">steam_inventory_item_id</a> of an item to be consumed</td>
</tr>
<tr>
<td>quantity</td>
<td>real</td>
<td>How much of the said item is to be consumed</td>
</tr>
</tbody>
</table>
<p><br><br></p>
<hr>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="inventoryitemcreationdata">InventoryItemCreationData</h1>
<p> This struct is used as an argument when performing a call to the following functions</p>
<ul>
<li><a href="#steam_inventory_exchange_items">steam_inventory_exchange_items</a></li>
<li><a href="#steam_inventory_exchange_items-copy">steam_inventory_generate_items</a></li>
<li><p><a href="#steam_inventory_start_purchase">steam_inventory_start_purchase</a></p>
<p>and it contains the following details about an item creation/purchase:</p>
</li>
</ul>
<table>
<thead>
<tr>
<th>Key</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>item_def</td>
<td>int64</td>
<td>A <a href="https://partner.steamgames.com/doc/api/ISteamInventory#SteamItemDef_t">steam_inventory_item_def</a> representing the item type</td>
</tr>
<tr>
<td>quantity</td>
<td>real</td>
<td>Number of items of type to be created</td>
</tr>
</tbody>
</table>
<p><br><br></p>
<hr>
<p class="page" id="Networking"></p><h1>Networking</h1>
<p><a id="top"></a>
<a id="top"></a>
<!-- Page HTML do not touch -->
<a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="networking">Networking</h1>
<p> The following functions and constants allow you to use Steam&#39;s Networking functionality.</p>
<h2 id="packets-io">Packets IO</h2>
<p> These functions are provided for handling sending and receiving packets:</p>
<ul>
<li><a href="#steam_net_packet_get_data">steam_net_packet_get_data</a></li>
<li><a href="#steam_net_packet_get_sender_id">steam_net_packet_get_sender_id</a></li>
<li><a href="#steam_net_packet_get_size">steam_net_packet_get_size</a></li>
<li><a href="#steam_net_packet_receive">steam_net_packet_receive</a></li>
<li><a href="#steam_net_packet_send">steam_net_packet_send</a></li>
<li><a href="#steam_net_packet_set_type">steam_net_packet_set_type</a></li>
</ul>
<h2 id="session">Session</h2>
<p> The following functions allow handling P2P sessions:</p>
<ul>
<li><a href="#steam_net_accept_p2p_session">steam_net_accept_p2p_session</a></li>
<li><a href="#steam_net_close_p2p_session">steam_net_close_p2p_session</a></li>
<li><a href="#steam_net_set_auto_accept_p2p_sessions">steam_net_set_auto_accept_p2p_sessions</a></li>
</ul>
<h2 id="constants">Constants</h2>
<p> These are the constants used by this API:</p>
<ul>
<li><a href="#packettype">PacketType</a></li>
</ul>
<p><br><br></p>
<hr>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_net_packet_get_data">steam_net_packet_get_data</h1>
<p> Copies the contents of last received packet to the given buffer. Data is copied to the start of the buffer (position remains unaffected), meaning that if you reuse the same buffer, you should &quot;rewind&quot; it prior to reading.</p>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="information_source" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2139.png"></g-emoji> NOTE</strong></p>
<p>If the buffer is not big enough to fit data, it will be resized automatically (the buffer needs to be created using the using the <code>buffer_grow</code> type).</p>
</blockquote>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_net_packet_get_data(buffer)</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>buffer</td>
<td>real</td>
<td>The buffer to write the incoming data to.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">bool</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">while</span> (steam_net_packet_receive())
{
steam_net_packet_get_data(inbuf);
<span class="hljs-built_in">buffer_seek</span>(inbuf, <span class="hljs-literal">buffer_seek_start</span>, <span class="hljs-number">0</span>);
<span class="hljs-keyword">switch</span> (<span class="hljs-built_in">buffer_read</span>(inbuf, <span class="hljs-literal">buffer_u8</span>))
{
<span class="hljs-keyword">case</span> <span class="hljs-number">1</span>: <span class="hljs-built_in">show_debug_message</span>(<span class="hljs-string">&quot;packet ID 1&quot;</span>); <span class="hljs-keyword">break</span>;
<span class="hljs-keyword">case</span> <span class="hljs-number">2</span>: <span class="hljs-built_in">show_debug_message</span>(<span class="hljs-string">&quot;packet ID 2&quot;</span>); <span class="hljs-keyword">break</span>;
<span class="hljs-keyword">default</span>: <span class="hljs-built_in">show_debug_message</span>(<span class="hljs-string">&quot;unknown packet&quot;</span>); <span class="hljs-keyword">break</span>;
}
}</pre><p> The code above will check for an incoming packet and get its data into a buffer (resizing if necessary) and reads from it.</p>
<p><br><br></p>
<hr>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_net_packet_get_sender_id">steam_net_packet_get_sender_id</h1>
<p> Returns Steam ID of the user that sent the last received packet.
Can be used in conjunction with <a href="#steam_net_packet_send">steam_net_packet_send</a> to send something back and for just telling the senders apart.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_net_packet_get_sender_id();</pre><p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs"><span class="hljs-built_in">int64</span></pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">while</span>(steam_net_packet_receive())
{
<span class="hljs-keyword">var</span> sender = steam_net_packet_get_sender_id();
<span class="hljs-built_in">buffer_seek</span>(outbuf, <span class="hljs-literal">buffer_seek_start</span>, <span class="hljs-number">0</span>);
<span class="hljs-built_in">buffer_write</span>(outbuf, <span class="hljs-literal">buffer_u8</span>, test_network_packet.ping);
steam_net_packet_send(sender, outbuf);
}
</pre><p> The above code will show a code example.</p>
<p><br><br></p>
<hr>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_net_packet_get_size">steam_net_packet_get_size</h1>
<p> Returns the size of last received packet, in bytes.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_net_packet_get_size();</pre><p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs"><span class="hljs-built_in">real</span></pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">while</span> (steam_net_packet_receive())
{
<span class="hljs-keyword">var</span> size = steam_net_packet_size();
<span class="hljs-built_in">show_debug_message</span>(<span class="hljs-string">&quot;Received &quot;</span> + <span class="hljs-built_in">string</span>(size) + <span class="hljs-string">&quot; bytes.&quot;</span>);
}</pre><p> The code above will display the size of each incoming packet.</p>
<p><br><br></p>
<hr>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_net_packet_receive">steam_net_packet_receive</h1>
<p> Attempts to get the next packet from Steam API and returns whether successfully done so.
Other steam_net_ functions can then be used to get packet information/contents.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_net_packet_receive();</pre><p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">bool</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">while</span> (steam_net_packet_receive())
{
<span class="hljs-comment">// process the received packet</span>
}</pre><p> The code above will attempt to get the next packet from Steam API, would be used every step while in lobby or with less frequency otherwise.</p>
<p><br><br></p>
<hr>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_net_packet_send">steam_net_packet_send</h1>
<p> Sends a packet to the given endpoint, returns whether successful (as opposed to incorrect arguments/invalid ID). If no packet type is passed in then default value will be used, the default value can be set using the <a href="#steam_net_packet_set_type">steam_net_packet_set_type</a> function. Returns whether or not the packet was successfully sent.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_net_packet_send(user_id, buffer, size, packet_type)</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>user_id</strong></td>
<td>int64</td>
<td>The target user to send the packet to</td>
</tr>
<tr>
<td><strong>buffer</strong></td>
<td>real</td>
<td>Buffer that contains the raw byte array for the packet data to send</td>
</tr>
<tr>
<td>size</td>
<td>real</td>
<td>The size of data to send (default -1, sends the entire buffer) <g-emoji class="g-emoji" alias="eight_pointed_black_star" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2734.png">✴️</g-emoji> OPTIONAL</td>
</tr>
<tr>
<td>packet_type</td>
<td><a href="#packettype">PacketType</a></td>
<td>The type of packet to be used <g-emoji class="g-emoji" alias="eight_pointed_black_star" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2734.png">✴️</g-emoji> OPTIONAL</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">bool</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">var</span> buf = <span class="hljs-built_in">buffer_create</span>(<span class="hljs-number">16</span>, <span class="hljs-literal">buffer_grow</span>, <span class="hljs-number">1</span>);
<span class="hljs-built_in">buffer_write</span>(buf, <span class="hljs-literal">buffer_string</span>, <span class="hljs-string">&quot;Hello!&quot;</span>);
steam_net_packet_send(steam_id, buf, <span class="hljs-number">-1</span>);
<span class="hljs-built_in">buffer_delete</span>(buff);</pre><p> The code sample will create a buffer and write to it, sending the total length of it to the given <code>steam_id</code>, the buffer is then deleted.</p>
<p><br><br></p>
<hr>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_net_packet_set_type">steam_net_packet_set_type</h1>
<p> Set the default connection protocol used when sending the data packets (using the <a href="#steam_net_packet_send">steam_net_packet_send</a> function). Returns whether or not the default protocol was successfully set.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_net_packet_set_type(protocol);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>protocol</td>
<td><a href="#packettype">PacketType</a></td>
<td>The default connection protocol to be used</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">bool</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs">steam_net_packet_set_type(steam_net_packet_type_reliable)</pre><p> The above code will set the current connection to use the <code>steam_net_packet_type_reliable</code> protocol to send data packages.</p>
<p><br><br></p>
<hr>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_net_accept_p2p_session">steam_net_accept_p2p_session</h1>
<p> Accepts a P2P session request from the specified user. Returns whether successful or not.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_net_accept_p2p_session(userID);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>userID</td>
<td>int64</td>
<td>The User ID of the user that sent the initial packet to us.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">bool</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">if</span> (isMyFriend(userID))
{
steam_net_accept_p2p_session(userID);
}</pre><p> The code above uses a custom implemented function that will check if a given <code>userID</code> is a friend and if it is it will accept the P2P session.</p>
<p><br><br></p>
<hr>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_net_close_p2p_session">steam_net_close_p2p_session</h1>
<p> Closes a P2P session with the specified user. Returns whether successful or not.
Steam will automatically close sessions after a period of inactivity, but you could also do it manually if you so desired.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_net_close_p2p_session(user_id)</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>user_id</td>
<td>int64</td>
<td>The user ID of the user to close the connection with.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">bool</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">if</span> (<span class="hljs-literal">global</span>.chat_closed)
{
steam_net_close_p2p_session(user_id)
}</pre><p> The code above check to see if a global variable (<code>chat_closed</code>) is true and if so, it will close the P2P session.</p>
<p><br><br></p>
<hr>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_net_set_auto_accept_p2p_sessions">steam_net_set_auto_accept_p2p_sessions</h1>
<p> Sets whether to auto-accept session requests coming from players in the same lobby. This is enabled by default for convenience. If you disable it, you will need to handle the async event when someone uses the <a href="#steam_lobby_join_id">steam_lobby_join_id</a> function.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_net_set_auto_accept_p2p_sessions(enable);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>enable</td>
<td>bool</td>
<td>disable/enable auto accept sessions</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">N/A</pre><p><br></p>
<p><strong>Triggers:</strong></p>
<pre class="hljs">Asynchronous Steam Event (<span class="hljs-keyword">for</span> each request, <span class="hljs-keyword">if</span> disabled)</pre><table>
<thead>
<tr>
<th>Key</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>type</td>
<td>string</td>
<td>The string value <code>&quot;lobby_join_requested&quot;</code></td>
</tr>
<tr>
<td>lobby_id</td>
<td>int64</td>
<td>The lobby unique identifier</td>
</tr>
<tr>
<td>friend_id</td>
<td>int64</td>
<td>The friend unique identifier</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs">steam_net_set_auto_accept_p2p_sessions(<span class="hljs-literal">false</span>);</pre><p> The code above will disable the auto accept P2P sessions functionality meaning we should deal with the requests manually. In order to do so we need to use the <a href="https://manual-en.yoyogames.com/The_Asset_Editors/Object_Properties/Async_Events/Steam.htm">Steam Async Event</a> to catch the callback:</p>
<pre class="hljs"><span class="hljs-keyword">if</span> (<span class="hljs-symbol">async_load</span>[?<span class="hljs-string">&quot;event_type&quot;</span>] == <span class="hljs-string">&quot;lobby_join_requested&quot;</span>)
{
steam_net_accept_p2p_session(<span class="hljs-symbol">async_load</span>[?<span class="hljs-string">&quot;friend_id&quot;</span>]);
}</pre><p><br><br></p>
<hr>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="packettype">PacketType</h1>
<p> These constants specify the type of a steam packet and should be used with the function <a href="#steam_net_packet_set_type">steam_net_packet_set_type</a>.</p>
<table>
<thead>
<tr>
<th>Packet Type Constant</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>steam_net_packet_type_unreliable</code></td>
<td>Equivalent to UDP the data may or may not be delivered, will not be resent automatically.</td>
</tr>
<tr>
<td><code>steam_net_packet_type_unreliable_nodelay</code></td>
<td>Similar to &quot;unreliable&quot; type, but always sent instantly (as soon as function is called). Intended for things like streaming voice data, where you want lowest latency possible and only care about the current data.</td>
</tr>
<tr>
<td><code>steam_net_packet_type_reliable</code></td>
<td>Equivalent to TCP, the data is warranted to be delivered in order and intact.</td>
</tr>
<tr>
<td><code>steam_net_packet_type_reliable_buffer</code></td>
<td>Similar to &quot;reliable&quot; type, but utilizes <a href="https://en.wikipedia.org/wiki/Nagle&#39;s_algorithm">Nagle&#39;s algorithm</a> to reduce the number of packets at cost of potential delay while the data accumulates until the sending threshold.</td>
</tr>
</tbody>
</table>
<p><br><br></p>
<hr>
<p class="page" id="Input"></p><h1>Steam Input</h1>
<p><a id="top"></a>
<a id="top"></a>
<!--<div class="body-scroll" style="top: 150px;">--></p>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="input">Input</h1>
<p> The Steam Input API is designed to allow you to easily enable <em>full support</em> for Steam Input devices in your game. This means things such as:</p>
<ul>
<li>Ability to use proper controller-specific glyphs for input hints.</li>
<li>Allow the user to easily rebind controls however they like via the Steam Input Configurator.</li>
<li>Share input mappings with others via the Steam Workshop.</li>
<li><p>and many more!</p>
<p><br></p>
<p>Before proceeding, please read <a href="https://partner.steamgames.com/doc/features/steam_controller/getting_started_for_devs">this page</a> about the Steam Input API for developers before reading this page to have a good understanding of what are Input Handles, Action Sets, Action Set Layers, Digital Actions, Analog Actions, Action Origins, the Steam Input Configurator, and bindings.</p>
</li>
</ul>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="information_source" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2139.png"></g-emoji> NOTE</strong></p>
<p>This API is designed for <strong>advanced users only</strong>, if you don&#39;t know why you need it, please use the native GML <code>gamepad_</code> functions instead.</p>
</blockquote>
<p> The following functions can be used to access the Steam Input from within GameMaker Studio 2</p>
<ul>
<li><a href="#steam_input_init">steam_input_init</a></li>
<li><a href="#steam_input_shutdown">steam_input_shutdown</a></li>
<li><a href="#steam_input_set_input_action_manifest_file_path">steam_input_set_input_action_manifest_file_path</a></li>
<li><a href="#steam_input_run_frame">steam_input_run_frame</a></li>
<li><a href="#steam_input_wait_for_data">steam_input_wait_for_data</a></li>
<li><a href="#steam_input_new_data_available">steam_input_new_data_available</a></li>
<li><a href="#steam_input_get_connected_controllers">steam_input_get_connected_controllers</a></li>
<li><a href="#steam_input_enable_device_callbacks">steam_input_enable_device_callbacks</a></li>
<li><a href="#steam_input_enable_action_event_callbacks">steam_input_enable_action_event_callbacks</a></li>
<li><a href="#steam_input_get_action_set_handle">steam_input_get_action_set_handle</a></li>
<li><a href="#steam_input_activate_action_set">steam_input_activate_action_set</a></li>
<li><a href="#steam_input_get_current_action_set">steam_input_get_current_action_set</a></li>
<li><a href="#steam_input_activate_action_set_layer">steam_input_activate_action_set_layer</a></li>
<li><a href="#steam_input_deactivate_action_set_layer">steam_input_deactivate_action_set_layer</a></li>
<li><a href="#steam_input_deactivate_all_action_set_layers">steam_input_deactivate_all_action_set_layers</a></li>
<li><a href="#steam_input_get_active_action_set_layers">steam_input_get_active_action_set_layers</a></li>
<li><a href="#steam_input_get_digital_action_handle">steam_input_get_digital_action_handle</a></li>
<li><a href="#steam_input_get_digital_action_data">steam_input_get_digital_action_data</a></li>
<li><a href="#steam_input_get_digital_action_origins">steam_input_get_digital_action_origins</a></li>
<li><a href="#steam_input_get_string_for_digital_action_name">steam_input_get_string_for_digital_action_name</a></li>
<li><a href="#steam_input_get_analog_action_handle">steam_input_get_analog_action_handle</a></li>
<li><a href="#steam_input_get_analog_action_data">steam_input_get_analog_action_data</a></li>
<li><a href="#steam_input_get_analog_action_origins">steam_input_get_analog_action_origins</a></li>
<li><a href="#steam_input_get_glyph_png_for_action_origin">steam_input_get_glyph_png_for_action_origin</a></li>
<li><a href="#steam_input_get_glyph_svg_for_action_origin">steam_input_get_glyph_svg_for_action_origin</a></li>
<li><a href="#steam_input_get_glyph_for_action_origin_legacy">steam_input_get_glyph_for_action_origin_legacy</a></li>
<li><a href="#steam_input_get_string_for_action_origin">steam_input_get_string_for_action_origin</a></li>
<li><a href="#steam_input_get_string_for_analog_action_name">steam_input_get_string_for_analog_action_name</a></li>
<li><a href="#steam_input_stop_analog_action_momentum">steam_input_stop_analog_action_momentum</a></li>
<li><a href="#steam_input_get_motion_data">steam_input_get_motion_data</a></li>
<li><a href="#steam_input_trigger_vibration">steam_input_trigger_vibration</a></li>
<li><a href="#steam_input_trigger_vibration_extended">steam_input_trigger_vibration_extended</a></li>
<li><a href="#steam_input_trigger_simple_haptic_event">steam_input_trigger_simple_haptic_event</a></li>
<li><a href="#steam_input_set_led_color">steam_input_set_led_color</a></li>
<li><a href="#steam_input_trigger_haptic_pulse_legacy">steam_input_trigger_haptic_pulse_legacy</a></li>
<li><a href="#steam_input_trigger_repeated_haptic_pulse_legacy">steam_input_trigger_repeated_haptic_pulse_legacy</a></li>
<li><a href="#steam_input_show_binding_panel">steam_input_show_binding_panel</a></li>
<li><a href="#steam_input_get_input_type_for_handle">steam_input_get_input_type_for_handle</a></li>
<li><a href="#steam_input_get_controller_for_gamepad_index">steam_input_get_controller_for_gamepad_index</a></li>
<li><a href="#steam_input_get_gamepad_index_for_controller">steam_input_get_gamepad_index_for_controller</a></li>
<li><a href="#steam_input_get_string_for_xbox_origin">steam_input_get_string_for_xbox_origin</a></li>
<li><a href="#steam_input_get_glyph_for_xbox_origin">steam_input_get_glyph_for_xbox_origin</a></li>
<li><a href="#steam_input_get_action_origin_from_xbox_origin">steam_input_get_action_origin_from_xbox_origin</a></li>
<li><a href="#steam_input_translate_action_origin">steam_input_translate_action_origin</a></li>
<li><a href="#steam_input_get_device_binding_revision">steam_input_get_device_binding_revision</a></li>
<li><a href="#steam_input_get_remote_play_session_id">steam_input_get_remote_play_session_id</a></li>
<li><a href="#steam_input_get_session_input_configuration_settings">steam_input_get_session_input_configuration_settings</a></li>
<li><p><a href="#steam_input_set_dualsense_trigger_effect">steam_input_set_dualsense_trigger_effect</a></p>
<!-- KEYWORDS
Steam Input
-->
<!-- TAGS
steam_input_functions
-->
</li>
</ul>
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_input_init">steam_input_init</h1>
<p> With this function you can initialize the Steam Input API. It will return <tt>true</tt> if initialization was successful and <tt>false</tt> otherwise. If argument <code>explicitly_call_run_frame</code> is <tt>true</tt>, then you must manually call <a href="#steam_input_run_frame">steam_input_run_frame</a> to poll for input data and async events, otherwise that will be performed by the <code>steam_update</code> function. After you initialize the Steam Input API, configuration events will be dispatched for any controllers connected while your game is running, they can be used to detect gamepad connection and when bindings have been updated so you need to refresh the sprites, input hints, etc.</p>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="warning" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/26a0.png">⚠️</g-emoji> IMPORTANT</strong></p>
<p>This function must be called ONLY if you <strong>REALLY wish to use</strong> the Steam Input API, or some other extensions in your project rely on Steam Input, otherwise calling it <em>may</em> make native GameMaker <code>gamepad_</code> functions not see any controllers plugged in!</p>
</blockquote>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_input_init(explicitly_call_run_frame);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>explicitly_call_run_frame</td>
<td>bool</td>
<td>Are you going to call <a href="#steam_input_run_frame">steam_input_run_frame</a> manually or not?</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>async_load contents:</strong></p>
<table>
<thead>
<tr>
<th>Key</th>
<th>Value</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>event_type</td>
<td>string</td>
<td>A constant string <code>&quot;steam_input_configuration_loaded&quot;</code>.</td>
</tr>
<tr>
<td>app_id</td>
<td>real</td>
<td>Your game&#39;s app id.</td>
</tr>
<tr>
<td>device_handle</td>
<td>real</td>
<td>Input handle of the device this event refers to.</td>
</tr>
<tr>
<td>mapping_creator</td>
<td>real</td>
<td>Steam ID of the user that created the loaded input mapping or <code>0</code> if none.</td>
</tr>
<tr>
<td>major_revision</td>
<td>real</td>
<td>Major version digit of the mapping.</td>
</tr>
<tr>
<td>minor_revision</td>
<td>real</td>
<td>Minor version digit of the mapping.</td>
</tr>
<tr>
<td>uses_steam_input_api</td>
<td>bool</td>
<td>Whether this device is using the Action Set and Actions API.</td>
</tr>
<tr>
<td>uses_steam_gamepad_api</td>
<td>bool</td>
<td>Whether this device is using the XInput emulation API.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Bool</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">if</span> (!steam_input_init(<span class="hljs-literal">false</span>))
{
throw <span class="hljs-string">&quot;Failed to initialize the Steam Input API&quot;</span>;
}</pre><pre class="hljs"><span class="hljs-comment">/// @description Async - Steam event</span>
<span class="hljs-keyword">if</span> (<span class="hljs-symbol">async_load</span>[? <span class="hljs-string">&quot;event_type&quot;</span>] == <span class="hljs-string">&quot;steam_input_configuration_loaded&quot;</span>) {
<span class="hljs-comment">// bindings refreshed, update any sprites we&#x27;ve fetched in some handler script</span>
scr_refresh_input_hints(<span class="hljs-symbol">async_load</span>[? <span class="hljs-string">&quot;device_handle&quot;</span>]);
}</pre><p> The above code checks to see if the Steam Input API was initialized, and throws an exception if it wasn&#39;t, then handles &quot;configuration loaded&quot; async events.</p>
<!-- KEYWORDS
steam_input_init
-->
<!-- TAGS
steam_input_init
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_input_shutdown">steam_input_shutdown</h1>
<p> With this function you can tell Steam that you are done using the Steam Input API. It will return <tt>true</tt> if the operation was successful and <tt>false</tt> otherwise. Usually you do not need to call this, as when your game ends Steam will automatically release Steam Input for you. After this function had returned, no other Steam Input functions must be called.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_input_shutdown();</pre><p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Bool</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs">steam_input_shutdown();</pre><p> The above code shuts down the Steam Input API.</p>
<!-- KEYWORDS
steam_input_shutdown
-->
<!-- TAGS
steam_input_shutdown
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_input_set_input_action_manifest_file_path">steam_input_set_input_action_manifest_file_path</h1>
<p> This function can be used to set the absolute path to the input action manifest, in case you do not wish to use the Steam Workshop for this. Returns <tt>true</tt> if the operation was successful and <tt>false</tt> otherwise.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_input_set_input_action_manifest_file_path(absolute_path);</pre><p><br></p>
<table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>absolute_path</td>
<td>string</td>
<td>Absolute path to the input action manifest file</td>
</tr>
</tbody>
</table>
<p><strong>Returns:</strong></p>
<pre class="hljs">Bool</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs">steam_input_set_input_action_manifest_file_path(<span class="hljs-symbol">working_directory</span> + <span class="hljs-string">&quot;manifest.vdf&quot;</span>);</pre><p> The above code sets the full path to the input action manifest file the game wants to use.</p>
<!-- KEYWORDS
steam_input_set_input_action_manifest_file_path
-->
<!-- TAGS
steam_input_set_input_action_manifest_file_path
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_input_run_frame">steam_input_run_frame</h1>
<p> With this function you can poll for new input data from Steam Input if it is available, you do not need to call it manually unless you explicitly specified this when calling <a href="#steam_input_init">steam_input_init</a>.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_input_run_frame();</pre><p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Bool</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs">steam_input_run_frame();</pre><p> The above code asks Steam Input to poll for new data if available.</p>
<!-- KEYWORDS
steam_input_run_frame
-->
<!-- TAGS
steam_input_run_frame
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_input_wait_for_data">steam_input_wait_for_data</h1>
<p> With this function you can freeze the game until new input data had arrived, returns <tt>true</tt> if new data did arrive, or <tt>false</tt> if the timeout had expired or an error had occurred. This function is only useful for lockstep multiplayer games.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_input_wait_for_data(wait_forever,timeout);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>wait_forever</td>
<td>bool</td>
<td>Whether to wait for data to arrive forever.</td>
</tr>
<tr>
<td>timeout</td>
<td>real</td>
<td>Data arrival timeout.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Bool</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs">steam_input_wait_for_data(<span class="hljs-literal">true</span>, <span class="hljs-number">0</span>);</pre><p> The above code will freeze the entire game until new input data is received from Steam Input.</p>
<!-- KEYWORDS
steam_input_wait_for_data
-->
<!-- TAGS
steam_input_wait_for_data
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_input_new_data_available">steam_input_new_data_available</h1>
<p> With this function you can check if there is new input data available since last read. Returns <tt>true</tt> if there is, <tt>false</tt> otherwise.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_input_new_data_available();</pre><p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Bool</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">if</span> (steam_input_new_data_available())
{
<span class="hljs-literal">global</span>.data_check_flag = <span class="hljs-literal">true</span>;
}</pre><p> The above code checks if new data has been received since last poll, and sets a flag to <tt>true</tt> if there is.</p>
<!-- KEYWORDS
steam_input_new_data_available
-->
<!-- TAGS
steam_input_new_data_available
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_input_get_connected_controllers">steam_input_get_connected_controllers</h1>
<p> With this function you can get an array of currently connected controller handles. This function returns an array of controller handles on success, and <tt>undefined</tt> on failure.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_input_get_connected_controllers();</pre><p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Array&lt;Real&gt; OR Undefined</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs">controllers = steam_input_get_connected_controllers();
<span class="hljs-keyword">if</span> (<span class="hljs-built_in">is_undefined</span>(controllers))
{
throw <span class="hljs-string">&quot;Unable to poll for controllers!&quot;</span>;
}</pre><p> The above code will poll the current connected controllers array, and throw an exception if there was an error.</p>
<!-- KEYWORDS
steam_input_get_connected_controllers
-->
<!-- TAGS
steam_input_get_connected_controllers
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_input_enable_device_callbacks">steam_input_enable_device_callbacks</h1>
<p> You can use this function to enable <code>Async - Steam</code> device connection and disconnection events, similar to <code>Async - System</code> type <code>gamepad connected</code> and <code>gamepad lost</code> events. The contents of <code>async_load</code> are described below. Returns <tt>true</tt> if the operation was successful, and <tt>false</tt> otherwise. This can be used as an alternative to <a href="#steam_input_get_connected_controllers">steam_input_get_connected_controllers</a> since in that case you don&#39;t need to iterate through the entire array, which may be faster depending on how your game is coded. Both methods can be used simultaneously without issues. This function needs to be called only once and cannot be undone.</p>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="warning" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/26a0.png">⚠️</g-emoji> IMPORTANT</strong></p>
<p>Depending on the type of the controller, multiple connection or disconnection events may be sent for one handle, be sure to handle that in your code, e.g. don&#39;t show a disconnection pop-up if the controller was already lost, and don&#39;t show a connection pop-up if this controller was already connected (and is not lost).</p>
</blockquote>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_input_enable_device_callbacks();</pre><p><br></p>
<p><strong>async_load contents:</strong></p>
<table>
<thead>
<tr>
<th>Key</th>
<th>Value</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>event_type</td>
<td>String</td>
<td><code>&quot;steam_input_device_connected&quot;</code> or <code>&quot;steam_input_device_disconnected&quot;</code></td>
</tr>
<tr>
<td>disconnected_device_handle</td>
<td>Real</td>
<td>Only present if <code>event_type</code> is <code>&quot;steam_input_device_disconnected&quot;</code></td>
</tr>
<tr>
<td>connected_device_handle</td>
<td>Real</td>
<td>Only present if <code>event_type</code> is <code>&quot;steam_input_device_connected&quot;</code></td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Bool</pre><p><br></p>
<p><strong>Extended Example:</strong></p>
<pre class="hljs"><span class="hljs-comment">/// @description Create event</span>
steam_input_enable_device_callbacks(); <span class="hljs-comment">// enable connection events</span></pre><pre class="hljs"><span class="hljs-comment">/// @description Async - Steam event</span>
<span class="hljs-keyword">if</span> (<span class="hljs-symbol">async_load</span>[? <span class="hljs-string">&quot;event_type&quot;</span>] == <span class="hljs-string">&quot;steam_input_device_connected&quot;</span>) {
scr_game_add_device(<span class="hljs-symbol">async_load</span>[? <span class="hljs-string">&quot;connected_device_handle&quot;</span>]); <span class="hljs-comment">// register an input_handle</span>
<span class="hljs-built_in">show_debug_message</span>(<span class="hljs-string">&quot;Discovered a new input_handle!&quot;</span>);
}
<span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span> (<span class="hljs-symbol">async_load</span>[? <span class="hljs-string">&quot;event_type&quot;</span>] == <span class="hljs-string">&quot;steam_input_device_disconnected&quot;</span>) {
scr_game_remove_device(<span class="hljs-symbol">async_load</span>[? <span class="hljs-string">&quot;disconnected_device_handle&quot;</span>]); <span class="hljs-comment">// de-register an input_handle</span>
<span class="hljs-built_in">show_debug_message</span>(<span class="hljs-string">&quot;Lost an input_handle!&quot;</span>);
}</pre><p> The above code will enable device connection and disconnection events, then it will react to them by calling some handler function. </p>
<!-- KEYWORDS
steam_input_enable_device_callbacks
-->
<!-- TAGS
steam_input_enable_device_callbacks
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_input_enable_action_event_callbacks">steam_input_enable_action_event_callbacks</h1>
<p> This function will enable <code>Async - Steam</code> action events, this event will be called only when some digital or analog action will change it&#39;s state, in case of digital actions that means a button is held or released, in case of analog actions that means the analog stick had moved, or the stick type had changed. The contents of <code>async_load</code> are described below. This is similar to <a href="#steam_input_get_digital_action_data">steam_input_get_digital_action_data</a> and <a href="#steam_input_get_analog_action_data">steam_input_get_analog_action_data</a>, only here you don&#39;t have to poll for the actions manually, but you still need to obtain the handles via <a href="#steam_input_get_digital_action_handle">steam_input_get_digital_action_handle</a> and <a href="#steam_input_get_analog_action_handle">steam_input_get_analog_action_handle</a> respectively, otherwise Steam will think you don&#39;t care about these actions. This function needs to be called only once and cannot be undone.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_input_enable_action_event_callbacks();</pre><p><br></p>
<p><strong>async_load contents:</strong></p>
<table>
<thead>
<tr>
<th>Key</th>
<th>Value</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>event_type</td>
<td>string</td>
<td><code>&quot;steam_input_action_event&quot;</code></td>
</tr>
<tr>
<td>controller_handle</td>
<td>Real</td>
<td>Handle of the controller this event is for.</td>
</tr>
<tr>
<td>action_event_type</td>
<td>Real</td>
<td>A <code>steam_input_action_event_type_</code> constant</td>
</tr>
<tr>
<td>action_handle</td>
<td>Real</td>
<td>Handle of the digital or analog action, depending on the type</td>
</tr>
<tr>
<td>active</td>
<td>bool</td>
<td>Whether or not this action is currently available to be bound in the active action set. If it is not available, OR does not belong to the active action set, this will be false.</td>
</tr>
<tr>
<td>state</td>
<td>bool</td>
<td><strong>DIGITAL ACTIONS ONLY:</strong> state of the digital action, <code>true</code> or <code>false</code>.</td>
</tr>
<tr>
<td>mode</td>
<td>real</td>
<td><strong>ANALOG ACTIONS ONLY:</strong> A <code>steam_input_source_mode_</code> constant.</td>
</tr>
<tr>
<td>x</td>
<td>real</td>
<td><strong>ANALOG ACTIONS ONLY:</strong> X axis of the input</td>
</tr>
<tr>
<td>y</td>
<td>real</td>
<td><strong>ANALOG ACTIONS ONLY:</strong> Y axis of the input</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Bool</pre><p><br></p>
<p><strong>Extended Example:</strong></p>
<pre class="hljs"><span class="hljs-comment">/// @description Create event</span>
steam_input_enable_action_event_callbacks(); <span class="hljs-comment">// enable action input events</span></pre><pre class="hljs"><span class="hljs-comment">/// @description Async - System event</span>
<span class="hljs-keyword">if</span> (<span class="hljs-symbol">async_load</span>[? <span class="hljs-string">&quot;event_type&quot;</span>] == <span class="hljs-string">&quot;steam_input_action_event&quot;</span>) {
<span class="hljs-keyword">var</span> _controller_handle = <span class="hljs-symbol">async_load</span>[? <span class="hljs-string">&quot;controller_handle&quot;</span>];
<span class="hljs-keyword">var</span> _action_handle = <span class="hljs-symbol">async_load</span>[? <span class="hljs-string">&quot;action_handle&quot;</span>];
<span class="hljs-keyword">var</span> _is_action_active = <span class="hljs-symbol">async_load</span>[? <span class="hljs-string">&quot;active&quot;</span>];
<span class="hljs-keyword">if</span> (_is_action_active) { <span class="hljs-comment">// it&#x27;s useless to try and handle an inactive action</span>
<span class="hljs-keyword">if</span> (<span class="hljs-symbol">async_load</span>[? <span class="hljs-string">&quot;action_event_type&quot;</span>] == steam_input_action_event_type_digital_action) {
<span class="hljs-keyword">var</span> _digital_state = <span class="hljs-symbol">async_load</span>[? <span class="hljs-string">&quot;state&quot;</span>]; <span class="hljs-comment">// true or false only, held or not held</span>
scr_register_digital_input(_controller_handle, _action_handle, _digital_state); <span class="hljs-comment">// some handler</span>
}
<span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span> (<span class="hljs-symbol">async_load</span>[? <span class="hljs-string">&quot;action_event_type&quot;</span>] == steam_input_action_event_type_digital_action) {
<span class="hljs-keyword">var</span> _analog_mode = <span class="hljs-symbol">async_load</span>[? <span class="hljs-string">&quot;mode&quot;</span>]; <span class="hljs-comment">// the user may be using a stick, or a mouse, or a touchpad...</span>
<span class="hljs-keyword">var</span> _analog_x = <span class="hljs-symbol">async_load</span>[? <span class="hljs-string">&quot;x&quot;</span>];
<span class="hljs-keyword">var</span> _analog_y = <span class="hljs-symbol">async_load</span>[? <span class="hljs-string">&quot;y&quot;</span>];
scr_register_analog_input(_controller_handle, _action_handle, _analog_mode, _analog_x, _analog_y); <span class="hljs-comment">// some handler</span>
}
}
<span class="hljs-keyword">else</span> {
<span class="hljs-built_in">show_debug_message</span>(<span class="hljs-string">&quot;Action &quot;</span> + <span class="hljs-built_in">string</span>(_action_handle) + <span class="hljs-string">&quot; not active for con &quot;</span> + <span class="hljs-built_in">string</span>(_controller_handle)); <span class="hljs-comment">// not bound?</span>
}
}</pre><p> The above code will activate action input async events, and handle them correctly.</p>
<!-- KEYWORDS
steam_input_enable_action_event_callbacks
-->
<!-- TAGS
steam_input_enable_action_event_callbacks
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_input_get_action_set_handle">steam_input_get_action_set_handle</h1>
<p> This function will try to resolve an action set by name, returning the handle of that action set.</p>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="warning" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/26a0.png">⚠️</g-emoji> IMPORTANT</strong></p>
<p>Due to a bug in the Steam Input API, if the game was launched without any controllers connected, all action set and action handle resolver functions will return 0, an invalid handle, as such it is required that you try to obtain handles every frame until at least one controller gets connected and you succeed.</p>
</blockquote>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_input_get_action_set_handle(action_set_name);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>action_set_name</td>
<td>string</td>
<td>The name of the action set.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Real</pre><p><br></p>
<p><strong>Extended Example:</strong></p>
<pre class="hljs"><span class="hljs-comment">/// @description Create event</span>
main_action_set = <span class="hljs-number">0</span>; <span class="hljs-comment">// &#x27;0&#x27; is an invalid handle.</span>
menu_action_set = <span class="hljs-number">0</span>;</pre><pre class="hljs"><span class="hljs-comment">/// @description Step event</span>
<span class="hljs-comment">// due to a bug in the Steam Input API, we have to try and obtain these every frame until we succeed.</span>
<span class="hljs-comment">// check if any handle is invalid:</span>
<span class="hljs-keyword">if</span> (main_action_set == <span class="hljs-number">0</span> || menu_action_set == <span class="hljs-number">0</span>) {
<span class="hljs-comment">// try to resolve:</span>
main_action_set = steam_input_get_action_set_handle(<span class="hljs-string">&quot;Set_Main&quot;</span>);
menu_action_set = steam_input_get_action_set_handle(<span class="hljs-string">&quot;Set_Menu&quot;</span>);
<span class="hljs-comment">// if we failed and the functions return 0, we will try again, on the next frame.</span>
}</pre><p> The above code checks if any handle is 0, and if it is, it tries to obtain all handles again, until it eventually completes and all handles are valid.</p>
<!-- KEYWORDS
steam_input_get_action_set_handle
-->
<!-- TAGS
steam_input_get_action_set_handle
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_input_activate_action_set">steam_input_activate_action_set</h1>
<p> With this function you can activate an action set on a specific controller, or all controllers by specifying the <code>steam_input_handle_all_controllers</code> constant as the controller handle. Returns <code>true</code> if the operation was successful, and <code>false</code> otherwise. This function is cheap to call and can be safely called every frame without hitting performance issues.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_input_activate_action_set(controller, action_set);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>controller</td>
<td>Real</td>
<td>Input handle of the controller.</td>
</tr>
<tr>
<td>action_set</td>
<td>Real</td>
<td>Handle of the action set, cannot be zero.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Bool</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">switch</span> (state) {
<span class="hljs-keyword">case</span> game_state.menu: {
steam_input_activate_action_set(steam_input_handle_all_controllers, menu_action_set);
scr_do_menu_input();
<span class="hljs-keyword">break</span>;
}
<span class="hljs-keyword">case</span> game_state.play: {
steam_input_activate_action_set(player_controller_handle, main_action_set);
scr_do_gameplay_input(player_controller_handle);
<span class="hljs-keyword">break</span>;
}
}</pre><p> The above code will activate the appropriate action set based on which state the game is currently in.</p>
<!-- KEYWORDS
steam_input_activate_action_set
-->
<!-- TAGS
steam_input_activate_action_set
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_input_get_current_action_set">steam_input_get_current_action_set</h1>
<p> This function will return the handle of the currently activated action set on a given controller handle, or <code>0</code> if there is no action set currently active.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_input_get_current_action_set(controller);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>controller</td>
<td>input_handle</td>
<td>Handle of the controller.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Real</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">if</span> (steam_input_get_current_action_set(player_handle) == <span class="hljs-number">0</span>) {
steam_input_activate_action_set(player_handle, menu_action_set);
}</pre><p> The above code will check to see if there is no action set activated for a controller, and if there isn&#39;t, it will activate a menu action set.</p>
<!-- KEYWORDS
steam_input_get_current_action_set
-->
<!-- TAGS
steam_input_get_current_action_set
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_input_activate_action_set_layer">steam_input_activate_action_set_layer</h1>
<p> This function will activate an action set layer on top of the current action set on a specified controller. Returns <code>true</code> if the operation was successful and <code>false</code> otherwise.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_input_activate_action_set_layer(controller, action_set_layer);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>controller</td>
<td>real</td>
<td>Handle of the controller.</td>
</tr>
<tr>
<td>action_set_layer</td>
<td>real</td>
<td>Handle of the action set layer.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Bool</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs">steam_input_activate_action_set_layer(player_handle, action_set_layer_sniper);</pre><p> The above code will activate a &quot;sniper&quot; action set layer on top of any currently activated action sets. Returns <code>true</code> if the operation was successful and <code>false</code> otherwise.</p>
<!-- KEYWORDS
steam_input_activate_action_set_layer
-->
<!-- TAGS
steam_input_activate_action_set_layer
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_input_deactivate_action_set_layer">steam_input_deactivate_action_set_layer</h1>
<p> This function will deactivate a specific action set layer from the specified controller. Returns <code>true</code> if the operation was successful and <code>false</code> otherwise.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_input_deactivate_action_set_layer(controller, action_set_layer);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>controller</td>
<td>real</td>
<td>Handle of the controller.</td>
</tr>
<tr>
<td>action_set_layer</td>
<td>real</td>
<td>Handle of the action set layer.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Bool</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs">steam_input_deactivate_action_set_layer(player_handle, action_set_layer_sniper);</pre><p> The above code will deactivate the &quot;sniper&quot; action set layer from the <code>player_handle</code> controller.</p>
<!-- KEYWORDS
steam_input_deactivate_action_set_layer
-->
<!-- TAGS
steam_input_deactivate_action_set_layer
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_input_deactivate_all_action_set_layers">steam_input_deactivate_all_action_set_layers</h1>
<p> This function will deactivate all action set layers on a specified controller. Returns <code>true</code> if the operation was successful and <code>false</code> otherwise.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_input_deactivate_all_action_set_layers(controller);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>controller</td>
<td>real</td>
<td>Handle of the controller.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Bool</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs">steam_input_deactivate_all_action_set_layers(player_handle);</pre><p> The above code will deactivate all action set layers on the <code>player_handle</code> controller.</p>
<!-- KEYWORDS
steam_input_deactivate_all_action_set_layers
-->
<!-- TAGS
steam_input_deactivate_all_action_set_layers
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_input_get_active_action_set_layers">steam_input_get_active_action_set_layers</h1>
<p> This function will return an array of currently active action set layer handles on a specified controller. Returns an array of action set layer handles on success, and <code>undefined</code> on failure.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_input_get_active_action_set_layers(controller);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>controller</td>
<td>real</td>
<td>Handle of the controller.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Array&lt;Real&gt; OR Undefined</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">var</span> layers = steam_input_get_active_action_set_layers(player_handle);
<span class="hljs-keyword">if</span> (<span class="hljs-built_in">array_length</span>(layers) &gt; <span class="hljs-number">0</span>) {
steam_input_deactivate_all_action_set_layers(player_handle);
}</pre><p> The above code will retrieve all currently active action set layers for <code>player_handle</code>, and if there are some active, it will deactivate all action set layers.</p>
<!-- KEYWORDS
steam_input_get_active_action_set_layers
-->
<!-- TAGS
steam_input_get_active_action_set_layers
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_input_get_digital_action_handle">steam_input_get_digital_action_handle</h1>
<p> This function will resolve a digital action by name, and return that action&#39;s handle. Keep in mind that no two actions cannot have the same name, even if they are defined in different action sets, since Steam does not differentiate action names for each set.</p>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="warning" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/26a0.png">⚠️</g-emoji> IMPORTANT</strong></p>
<p>Due to a bug in the Steam Input API, if the game was launched without any controllers connected, all action set and action handle resolver functions will return 0, an invalid handle, as such it is required that you try to obtain handles every frame until at least one controller gets connected and you succeed.</p>
</blockquote>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_input_get_digital_action_handle(digital_action_name);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>digital_action_name</td>
<td>string</td>
<td>Name of the digital action.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Real</pre><p><br></p>
<p><strong>Extended Example:</strong></p>
<pre class="hljs"><span class="hljs-comment">/// @description Create event</span>
action_shoot = <span class="hljs-number">0</span>; <span class="hljs-comment">// &#x27;0&#x27; is an invalid handle.</span>
action_roll = <span class="hljs-number">0</span>;</pre><pre class="hljs"><span class="hljs-comment">/// @description Step event</span>
<span class="hljs-keyword">if</span> (action_shoot == <span class="hljs-number">0</span> || action_roll == <span class="hljs-number">0</span>) {
action_shoot = steam_input_get_digital_action_handle(<span class="hljs-string">&quot;DAction_Shoot&quot;</span>);
action_roll = steam_input_get_digital_action_handle(<span class="hljs-string">&quot;DAction_Roll&quot;</span>);
}</pre><p> The above code will try to obtain handles of digital actions <code>shoot</code> and <code>roll</code>, if it failed, it will try again on the next frame.</p>
<!-- KEYWORDS
steam_input_get_digital_action_handle
-->
<!-- TAGS
steam_input_get_digital_action_handle
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_input_get_digital_action_data">steam_input_get_digital_action_data</h1>
<p> This function will return current input data for a given digital action on a given controller. It returns the <code>digital_action_data</code> struct on success and <code>undefined</code> on failure.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_input_get_digital_action_data(controller,action_handle);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>controller</td>
<td>Real</td>
<td>Handle of the controller to use.</td>
</tr>
<tr>
<td>action_handle</td>
<td>Real</td>
<td>Handle of the digital action to poll for.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Struct OR Undefined</pre><p><strong>Struct fields:</strong>
|Name|Type|Description|
|----|----|----|
|active|Bool|Whether the action is bound to any button|
|state|Bool|Whether the action is currently held or not|</p>
<p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">var</span> _data = steam_input_get_digital_action_data(player_handle, action_shoot);
<span class="hljs-keyword">with</span> (objPlayer) {
isShooting = _data.active &amp;&amp; _data.state;
}</pre><p> The above code will set the <code>isShooting</code> variable in the player object to <code>true</code> if the action is active and is currently held, or <code>false</code> otherwise.</p>
<!-- KEYWORDS
steam_input_get_digital_action_data
-->
<!-- TAGS
steam_input_get_digital_action_data
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_input_get_digital_action_origins">steam_input_get_digital_action_origins</h1>
<p> This function will retrieve an array of input origins for a specified action and controller handles. This is the function you should use when trying to obtain input hint prompts, keep in mind that it returns an array because multiple buttons can be bound to one action in the Steam Input Configurator. Also keep in mind that input hints may change mid-game as the Steam Input Configurator is accessible inside the Steam Overlay, this is why it&#39;s recommended that you update all input sprites when you get a Configuration <code>Async - Steam</code> event for the controller(s) you are interested in.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_input_get_digital_action_origins(controller, action_set, digital_action);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>controller</td>
<td>Real</td>
<td>Handle of the controller to use.</td>
</tr>
<tr>
<td>action_set</td>
<td>Real</td>
<td>Handle of the action set.</td>
</tr>
<tr>
<td>digital_action</td>
<td>Real</td>
<td>Handle of the digital action inside the action set.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Array&lt;Real&gt; OR Undefined</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-comment">// this example function returns a horizontal strip of input hints as a single sprite frame</span>
<span class="hljs-comment">// do not forget to use sprite_delete() when you no longer need the returned sprite.</span>
<span class="hljs-keyword">function</span> scr_sprite_for_action(player_handle, action_set_handle, action_handle, is_digital_action) {
<span class="hljs-keyword">var</span> _origins = is_digital_action
? steam_input_get_digital_action_origins(player_handle, action_set_handle, action_handle)
: steam_input_get_analog_action_origins(player_handle, action_set_handle, action_handle);
<span class="hljs-keyword">if</span> (<span class="hljs-built_in">is_undefined</span>(_origins) || <span class="hljs-built_in">array_length</span>(_origins) == <span class="hljs-number">0</span>) {
<span class="hljs-comment">// something is wrong or no buttons are bound</span>
<span class="hljs-keyword">return</span> <span class="hljs-number">-1</span>;
}
<span class="hljs-keyword">var</span> _hint_count = <span class="hljs-built_in">array_length</span>(_origins),
_hint_width = <span class="hljs-number">32</span>,
_hint_height = <span class="hljs-number">32</span>,
_hint_size = steam_input_glyph_size_small, <span class="hljs-comment">// _small is 32x32 pixels</span>
_hint_style = steam_input_glyph_style_dark; <span class="hljs-comment">// prefer dark glyphs for the sake of this example</span>
<span class="hljs-keyword">var</span> _surf = <span class="hljs-built_in">surface_create</span>(_hint_count * _hint_width, _hint_height);
<span class="hljs-built_in">surface_set_target</span>(_surf);
<span class="hljs-built_in">draw_clear_alpha</span>(<span class="hljs-literal">c_black</span>, <span class="hljs-number">0</span>);
<span class="hljs-keyword">for</span> (<span class="hljs-keyword">var</span> _h = <span class="hljs-number">0</span>; _h &lt; _hint_count; ++_h) {
<span class="hljs-keyword">var</span> _origin = _origins[_h];
<span class="hljs-keyword">var</span> _path = steam_input_get_glyph_png_for_action_origin(_origin, _hint_size, _hint_style);
<span class="hljs-keyword">var</span> _tempspr = <span class="hljs-built_in">sprite_add</span>(_path, <span class="hljs-number">1</span>, <span class="hljs-literal">false</span>, <span class="hljs-literal">false</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>);
<span class="hljs-built_in">draw_sprite</span>(_tempspr, <span class="hljs-number">0</span>, _hint_width * _h, <span class="hljs-number">0</span>);
<span class="hljs-built_in">sprite_delete</span>(_tempspr);
}
<span class="hljs-built_in">surface_reset_target</span>();
<span class="hljs-keyword">var</span> _sprstrip = <span class="hljs-built_in">sprite_create_from_surface</span>(_surf, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-built_in">surface_get_width</span>(_surf), <span class="hljs-built_in">surface_get_height</span>(_surf), <span class="hljs-literal">false</span>, <span class="hljs-literal">false</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>);
<span class="hljs-comment">// you can add a call to sprite_set_offset() if you wish to auto-set the sprite origin to middle centre.</span>
<span class="hljs-built_in">surface_free</span>(_surf);
<span class="hljs-keyword">return</span> _sprstrip;
}
<span class="hljs-literal">global</span>.shoot_sprite = scr_sprite_for_action(player_handle, main_action_set, action_shoot, <span class="hljs-literal">true</span>);
<span class="hljs-built_in">draw_sprite</span>(<span class="hljs-literal">global</span>.shoot_sprite, <span class="hljs-number">0</span>, <span class="hljs-number">64</span>, <span class="hljs-number">64</span>);</pre><p> The above code defines an example of how to turn action origins into a sprite that you can draw in-game, for example on the GUI Layer.</p>
<!-- KEYWORDS
steam_input_get_digital_action_origins
-->
<!-- TAGS
steam_input_get_digital_action_origins
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_input_get_string_for_digital_action_name">steam_input_get_string_for_digital_action_name</h1>
<p> This function will return the localized name of a digital action as specified by Steam localization settings. Keep in mind that the Steam language may be different than the OS language, and this function will always use the language settings of the Steam client, not the OS.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_input_get_string_for_digital_action_name(digital_action);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>digital_action</td>
<td>Real</td>
<td>Handle of the digital action.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs"><span class="hljs-built_in">string</span></pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs">shoot_name_loc = steam_input_get_string_for_digital_action_name(action_shoot);</pre><p> The above code will get the localized name for the shoot action, and store it in the variable <code>shoot_name_loc</code>.</p>
<!-- KEYWORDS
steam_input_get_string_for_digital_action_name
-->
<!-- TAGS
steam_input_get_string_for_digital_action_name
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_input_get_analog_action_handle">steam_input_get_analog_action_handle</h1>
<p> This function will resolve an analog action by name, and return that action&#39;s handle. Keep in mind that no two actions cannot have the same name, even if they are defined in different action sets, since Steam does not differentiate action names for each set.</p>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="warning" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/26a0.png">⚠️</g-emoji> IMPORTANT</strong></p>
<p>Due to a bug in the Steam Input API, if the game was launched without any controllers connected, all action set and action handle resolver functions will return 0, an invalid handle, as such it is required that you try to obtain handles every frame until at least one controller gets connected and you succeed.</p>
</blockquote>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_input_get_analog_action_handle(analog_action_name);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>analog_action_name</td>
<td>string</td>
<td>Name of the analog action.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Real</pre><p><br></p>
<p><strong>Extended Example:</strong></p>
<pre class="hljs"><span class="hljs-comment">/// @description Create event</span>
action_move = <span class="hljs-number">0</span>; <span class="hljs-comment">// &#x27;0&#x27; is an invalid handle.</span>
action_aim = <span class="hljs-number">0</span>;</pre><pre class="hljs"><span class="hljs-comment">/// @description Step event</span>
<span class="hljs-keyword">if</span> (action_move == <span class="hljs-number">0</span> || action_aim == <span class="hljs-number">0</span>) {
action_move = steam_input_get_analog_action_handle(<span class="hljs-string">&quot;AAction_Move&quot;</span>);
action_aim = steam_input_get_analog_action_handle(<span class="hljs-string">&quot;AAction_Aim&quot;</span>);
}</pre><p> The above code will try to obtain handles of analog actions <code>move</code> and <code>aim</code>, if it failed, it will try again on the next frame.</p>
<!-- KEYWORDS
steam_input_get_analog_action_handle
-->
<!-- TAGS
steam_input_get_analog_action_handle
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_input_get_analog_action_data">steam_input_get_analog_action_data</h1>
<p> This function will return current input data for a given analog action on a given controller. It returns the <code>analog_action_data</code> struct on success and <code>undefined</code> on failure.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_input_get_analog_action_data(controller, action_handle);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>controller</td>
<td>Real</td>
<td>Handle of the controller to use.</td>
</tr>
<tr>
<td>action_handle</td>
<td>Real</td>
<td>Handle of the analog action to poll for.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Struct Fields:</strong></p>
<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>active</td>
<td>Bool</td>
<td>Whether this action is bound to any input element.</td>
</tr>
<tr>
<td>mode</td>
<td>Real</td>
<td>A <code>steam_input_source_mode_</code> constant.</td>
</tr>
<tr>
<td>x</td>
<td>Real</td>
<td>X axis of the input.</td>
</tr>
<tr>
<td>y</td>
<td>Real</td>
<td>Y axis of the input, <strong>inverted by default</strong>. See example code.</td>
</tr>
</tbody>
</table>
<p><strong>Returns:</strong></p>
<pre class="hljs">Struct OR Undefined</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">var</span> _data = steam_input_get_analog_action_data(player_handle, action_move);
<span class="hljs-keyword">if</span> (_data.active) {
<span class="hljs-keyword">with</span> (objPlayer) {
<span class="hljs-symbol">x</span> += _data.<span class="hljs-symbol">x</span> * move_speed;
<span class="hljs-comment">// in Steam Input the Y axis is in a different direction than GameMaker, so we need to invert it.</span>
<span class="hljs-symbol">y</span> += -_data.<span class="hljs-symbol">y</span> * move_speed;
<span class="hljs-comment">// you might want to use different crosshairs if the movement came from a touchpad or an analog stick.</span>
last_input_mode = _data.mode;
}
}</pre><p> The above code will move the player object accordingly to the input data for the <code>move</code> analog action.</p>
<!-- KEYWORDS
steam_input_get_analog_action_data
-->
<!-- TAGS
steam_input_get_analog_action_data
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_input_get_analog_action_origins">steam_input_get_analog_action_origins</h1>
<p> This function will retrieve an array of input origins for a specified action and controller handles. This is the function you should use when trying to obtain input hint prompts, keep in mind that it returns an array because multiple buttons can be bound to one action in the Steam Input Configurator. Also keep in mind that input hints may change mid-game as the Steam Input Configurator is accessible inside the Steam Overlay, this is why it&#39;s recommended that you update all input sprites when you get a Configuration <code>Async - Steam</code> event for the controller(s) you are interested in.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_input_get_analog_action_origins(controller, action_set, action);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>controller</td>
<td>Real</td>
<td>Handle of the controller to use.</td>
</tr>
<tr>
<td>action_set</td>
<td>Real</td>
<td>Handle of the action set.</td>
</tr>
<tr>
<td>action</td>
<td>Real</td>
<td>Handle of the analog action inside the action set.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Array&lt;Real&gt; OR Undefined</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-comment">// this example function returns a horizontal strip of input hints as a single sprite frame</span>
<span class="hljs-comment">// do not forget to use sprite_delete() when you no longer need the returned sprite.</span>
<span class="hljs-keyword">function</span> scr_sprite_for_action(player_handle, action_set_handle, action_handle, is_digital_action) {
<span class="hljs-keyword">var</span> _origins = is_digital_action
? steam_input_get_digital_action_origins(player_handle, action_set_handle, action_handle)
: steam_input_get_analog_action_origins(player_handle, action_set_handle, action_handle);
<span class="hljs-keyword">if</span> (<span class="hljs-built_in">is_undefined</span>(_origins) || <span class="hljs-built_in">array_length</span>(_origins) == <span class="hljs-number">0</span>) {
<span class="hljs-comment">// something is wrong or no buttons are bound</span>
<span class="hljs-keyword">return</span> <span class="hljs-number">-1</span>;
}
<span class="hljs-keyword">var</span> _hint_count = <span class="hljs-built_in">array_length</span>(_origins),
_hint_width = <span class="hljs-number">32</span>,
_hint_height = <span class="hljs-number">32</span>,
_hint_size = steam_input_glyph_size_small, <span class="hljs-comment">// _small is 32x32 pixels</span>
_hint_style = steam_input_glyph_style_dark; <span class="hljs-comment">// prefer dark glyphs for the sake of this example</span>
<span class="hljs-keyword">var</span> _surf = <span class="hljs-built_in">surface_create</span>(_hint_count * _hint_width, _hint_height);
<span class="hljs-built_in">surface_set_target</span>(_surf);
<span class="hljs-built_in">draw_clear_alpha</span>(<span class="hljs-literal">c_black</span>, <span class="hljs-number">0</span>);
<span class="hljs-keyword">for</span> (<span class="hljs-keyword">var</span> _h = <span class="hljs-number">0</span>; _h &lt; _hint_count; ++_h) {
<span class="hljs-keyword">var</span> _origin = _origins[_h];
<span class="hljs-keyword">var</span> _path = steam_input_get_glyph_png_for_action_origin(_origin, _hint_size, _hint_style);
<span class="hljs-keyword">var</span> _tempspr = <span class="hljs-built_in">sprite_add</span>(_path, <span class="hljs-number">1</span>, <span class="hljs-literal">false</span>, <span class="hljs-literal">false</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>);
<span class="hljs-built_in">draw_sprite</span>(_tempspr, <span class="hljs-number">0</span>, _hint_width * _h, <span class="hljs-number">0</span>);
<span class="hljs-built_in">sprite_delete</span>(_tempspr);
}
<span class="hljs-built_in">surface_reset_target</span>();
<span class="hljs-keyword">var</span> _sprstrip = <span class="hljs-built_in">sprite_create_from_surface</span>(_surf, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-built_in">surface_get_width</span>(_surf), <span class="hljs-built_in">surface_get_height</span>(_surf), <span class="hljs-literal">false</span>, <span class="hljs-literal">false</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>);
<span class="hljs-comment">// you can add a call to sprite_set_offset() if you wish to auto-set the sprite origin to middle centre.</span>
<span class="hljs-built_in">surface_free</span>(_surf);
<span class="hljs-keyword">return</span> _sprstrip;
}
<span class="hljs-literal">global</span>.move_sprite = scr_sprite_for_action(player_handle, main_action_set, action_move, <span class="hljs-literal">false</span> <span class="hljs-comment">/* not digital this time! */</span>);
<span class="hljs-built_in">draw_sprite</span>(<span class="hljs-literal">global</span>.move_sprite, <span class="hljs-number">0</span>, <span class="hljs-number">64</span>, <span class="hljs-number">64</span>);</pre><p> The above code defines an example of how to turn action origins into a sprite that you can draw in-game, for example on the GUI Layer.</p>
<!-- KEYWORDS
steam_input_get_analog_action_origins
-->
<!-- TAGS
steam_input_get_analog_action_origins
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_input_get_glyph_png_for_action_origin">steam_input_get_glyph_png_for_action_origin</h1>
<p> This function will return a full path to a PNG file of the glyph image of an action origin. The path is automatically added into the GameMaker&#39;s filesystem sandbox list, so that you can use the returned path in <code>sprite_add</code> or <code>buffer_load</code> no matter if you have the sandbox enabled or disabled.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_input_get_glyph_png_for_action_origin(origin, size, flags);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>origin</td>
<td>Real</td>
<td>Action origin to get the PNG of.</td>
</tr>
<tr>
<td>size</td>
<td>Real</td>
<td>A <code>steam_input_glyph_size_</code> constant.</td>
</tr>
<tr>
<td>flags</td>
<td>Real</td>
<td>A <code>steam_input_glyph_style_</code> bit flags constant.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs"><span class="hljs-built_in">string</span></pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">var</span> _path = steam_input_get_glyph_png_for_action_origin(<span class="hljs-literal">global</span>.shoot_origin, steam_input_glyph_size_small, steam_input_glyph_style_dark);
<span class="hljs-literal">global</span>.shoot_sprite = <span class="hljs-built_in">sprite_add</span>(_path, <span class="hljs-number">1</span>, <span class="hljs-literal">false</span>, <span class="hljs-literal">false</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>);</pre><p> The above code will get a PNG representing an action origin and load it as a sprite. For an extended example please see the example code from <a href="#steam_input_get_digital_action_origins">steam_input_get_digital_action_origins</a>.</p>
<!-- KEYWORDS
steam_input_get_glyph_png_for_action_origin
-->
<!-- TAGS
steam_input_get_glyph_png_for_action_origin
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_input_get_glyph_svg_for_action_origin">steam_input_get_glyph_svg_for_action_origin</h1>
<p> This function will return a full path to an SVG file of the glyph image of an action origin. The path is automatically added into the GameMaker&#39;s filesystem sandbox list, so that you can use the returned path in <code>buffer_load</code> no matter if you have the sandbox enabled or disabled. As for now GameMaker has no native capabilities to draw SVG files, but such ability may be added in the future. If you have your own SVG renderer then this function might be useful for you. Since SVGs do not have a fixed size and can be freely scaled, there is no <code>size</code> argument like in <a href="#steam_input_get_glyph_png_for_action_origin">steam_input_get_glyph_png_for_action_origin</a>.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_input_get_glyph_svg_for_action_origin(origin, flags);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>origin</td>
<td>Real</td>
<td>Action origin to get the SVG of.</td>
</tr>
<tr>
<td>flags</td>
<td>Real</td>
<td>A <code>steam_input_glyph_style_</code> bit flags constant.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs"><span class="hljs-built_in">string</span></pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">var</span> _svg_path = steam_input_get_glyph_svg_for_action_origin(<span class="hljs-literal">global</span>.shoot_origin, steam_input_glyph_style_dark);</pre><p> The above code will get the path to an SVG representing an action origin and store it in a local variable <code>_svg_path</code>.</p>
<!-- KEYWORDS
steam_input_get_glyph_svg_for_action_origin
-->
<!-- TAGS
steam_input_get_glyph_svg_for_action_origin
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_input_get_glyph_for_action_origin_legacy">steam_input_get_glyph_for_action_origin_legacy</h1>
<p> This function will return a full path to a PNG file of the glyph image of an action origin. The path is automatically added into the GameMaker&#39;s filesystem sandbox list, so that you can use the returned path in <code>sprite_add</code> or <code>buffer_load</code> no matter if you have the sandbox enabled or disabled. The image will be in legacy Steam Big Picture design style, if you wish to use the new Steam Deck styled glyphs (also called Knockout glyphs in Valve&#39;s documentation), please use the function <a href="#steam_input_get_glyph_png_for_action_origin">steam_input_get_glyph_png_for_action_origin</a> instead.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_input_get_glyph_for_action_origin_legacy(origin);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>origin</td>
<td>Real</td>
<td>Action origin to get the PNG of.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs"><span class="hljs-built_in">string</span></pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">var</span> _path = steam_input_get_glyph_for_action_origin_legacy(<span class="hljs-literal">global</span>.shoot_origin);
<span class="hljs-literal">global</span>.shoot_sprite = <span class="hljs-built_in">sprite_add</span>(_path, <span class="hljs-number">1</span>, <span class="hljs-literal">false</span>, <span class="hljs-literal">false</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>);</pre><p> The above code will get a PNG representing an action origin and load it as a sprite.</p>
<!-- KEYWORDS
steam_input_get_glyph_for_action_origin_legacy
-->
<!-- TAGS
steam_input_get_glyph_for_action_origin_legacy
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_input_get_string_for_action_origin">steam_input_get_string_for_action_origin</h1>
<p> This function will return a localized name of an action origin, for example <code>&quot;Y Button&quot;</code> if the Steam language is set to English, or <code>&quot;Кнопка Y&quot;</code> if it is set to Russian. Keep in mind that the OS language may be different from the Steam client language, and the Steam language will be used instead.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_input_get_string_for_action_origin(origin);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>origin</td>
<td>Real</td>
<td>Action origin to get the localized name of.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs"><span class="hljs-built_in">string</span></pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-literal">global</span>.shoot_name = steam_input_get_string_for_action_origin(<span class="hljs-literal">global</span>.shoot_origin);</pre><p> The above code will get a localized name of the shoot origin and store it in a global variable <code>shoot_name</code>.</p>
<!-- KEYWORDS
steam_input_get_string_for_action_origin
-->
<!-- TAGS
steam_input_get_string_for_action_origin
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_input_get_string_for_analog_action_name">steam_input_get_string_for_analog_action_name</h1>
<p> This function will return the localized name of an analog action as specified by Steam localization settings. Keep in mind that the Steam language may be different than the OS language, and this function will always use the language settings of the Steam client, not the OS.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_input_get_string_for_analog_action_name(action);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>action</td>
<td>Real</td>
<td>Handle of the analog action.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs"><span class="hljs-built_in">string</span></pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs">move_name_loc = steam_input_get_string_for_analog_action_name(action_move);</pre><p> The above code will get the localized name for the move action, and store it in the variable <code>move_name_loc</code>.</p>
<!-- KEYWORDS
steam_input_get_string_for_analog_action_name
-->
<!-- TAGS
steam_input_get_string_for_analog_action_name
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_input_stop_analog_action_momentum">steam_input_stop_analog_action_momentum</h1>
<p> This function will stop the momentum of an analog action if the input device is, for example, a trackball. Returns <code>true</code> if the operation was successful and <code>false</code> otherwise.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_input_stop_analog_action_momentum(controller,action);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>controller</td>
<td>Real</td>
<td>Input handle of the controller.</td>
</tr>
<tr>
<td>action</td>
<td>Real</td>
<td>Handle of the analog action.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Bool</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs">steam_input_stop_analog_action_momentum(player_handle, action_move);</pre><p> The above code will stop the analog momentum of the move action.</p>
<!-- KEYWORDS
steam_input_stop_analog_action_momentum
-->
<!-- TAGS
steam_input_stop_analog_action_momentum
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_input_get_motion_data">steam_input_get_motion_data</h1>
<p> This function will obtain raw gyroscope and accelerometer data in the controller&#39;s native format. Returns the <code>motion_data</code> struct on success and <code>undefined</code> on failure.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_input_get_motion_data(controller);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>controller</td>
<td>Real</td>
<td>Input handle of the controller.</td>
</tr>
</tbody>
</table>
<p><strong>Struct Fields:</strong></p>
<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>rot_quat_x</td>
<td>Real</td>
<td>X component of the orientation quaternion.</td>
</tr>
<tr>
<td>rot_quat_y</td>
<td>Real</td>
<td>Y component of the orientation quaternion.</td>
</tr>
<tr>
<td>rot_quat_z</td>
<td>Real</td>
<td>Z component of the orientation quaternion.</td>
</tr>
<tr>
<td>rot_quat_w</td>
<td>Real</td>
<td>W component of the orientation quaternion.</td>
</tr>
<tr>
<td>pos_accel_x</td>
<td>Real</td>
<td>X component of the acceleration.</td>
</tr>
<tr>
<td>pos_accel_y</td>
<td>Real</td>
<td>Y component of the acceleration.</td>
</tr>
<tr>
<td>pos_accel_z</td>
<td>Real</td>
<td>Z component of the acceleration.</td>
</tr>
<tr>
<td>rot_vel_x</td>
<td>Real</td>
<td>X component of the angular velocity.</td>
</tr>
<tr>
<td>rot_vel_y</td>
<td>Real</td>
<td>Y component of the angular velocity.</td>
</tr>
<tr>
<td>rot_vel_z</td>
<td>Real</td>
<td>Z component of the angular velocity.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Struct OR Undefined</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">var</span> _data = steam_input_get_motion_data(player_handle);
<span class="hljs-keyword">if</span> (<span class="hljs-built_in">is_undefined</span>(_data)) {
<span class="hljs-keyword">exit</span>;
}
<span class="hljs-keyword">var</span> _dt = <span class="hljs-symbol">delta_time</span> / <span class="hljs-number">1000000</span>;
<span class="hljs-comment">// this math will only work for the DualShock 4 controller</span>
<span class="hljs-symbol">x</span> += _dt * <span class="hljs-symbol">room_width</span> * (_data.rot_vel_y / <span class="hljs-number">-32767</span>);
<span class="hljs-symbol">y</span> += _dt * <span class="hljs-symbol">room_height</span> * (_data.rot_vel_x / <span class="hljs-number">-32767</span>);
<span class="hljs-symbol">image_angle</span> = <span class="hljs-built_in">radtodeg</span>(_dt * (_data.rot_vel_z / <span class="hljs-number">32767</span>));</pre><p> The above code will rotate and move the object based on the angular velocity data of the controller.</p>
<!-- KEYWORDS
steam_input_get_motion_data
-->
<!-- TAGS
steam_input_get_motion_data
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_input_trigger_vibration">steam_input_trigger_vibration</h1>
<p> This function will trigger a vibration effect on the target controller. Keep in mind that due to physical differences of each controller, the motors may not be the exact same, for example on the DualShock 4 controller the left motor is bigger and faster than the right one. Returns <code>true</code> on success and <code>false</code> otherwise.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_input_trigger_vibration(controller,left_speed,right_speed);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>controller</td>
<td>real</td>
<td>Input handle of the controller.</td>
</tr>
<tr>
<td>left_speed</td>
<td>real</td>
<td>Speed of the left motor from 0 to 65535.</td>
</tr>
<tr>
<td>right_speed</td>
<td>real</td>
<td>Speed of the right motor from 0 to 65535.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Bool</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs">steam_input_trigger_vibration(player_handle, <span class="hljs-number">65535</span> / <span class="hljs-number">2</span>, <span class="hljs-number">65535</span> / <span class="hljs-number">2</span>);</pre><p> The above code will trigger a vibration effect at half the maximum power on both motors.</p>
<!-- KEYWORDS
steam_input_trigger_vibration
-->
<!-- TAGS
steam_input_trigger_vibration
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_input_trigger_vibration_extended">steam_input_trigger_vibration_extended</h1>
<p> This function will trigger an extended vibration effect on the target controller. Keep in mind that due to physical differences of each controller, the motors may not be the exact same, for example on the DualShock 4 controller the left motor is bigger and faster than the right one. Also keep in mind that not all controllers may support the extended vibration effects. Returns <code>true</code> on success and <code>false</code> otherwise.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_input_trigger_vibration_extended(controller,left_speed,right_speed,left_trigger_speed,right_trigger_speed);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>controller</td>
<td>real</td>
<td>Input handle of the controller.</td>
</tr>
<tr>
<td>left_speed</td>
<td>real</td>
<td>Speed of the left motor from 0 to 65535.</td>
</tr>
<tr>
<td>right_speed</td>
<td>real</td>
<td>Speed of the right motor from 0 to 65535.</td>
</tr>
<tr>
<td>left_trigger_speed</td>
<td>real</td>
<td>Speed of the left trigger from 0 to 65535.</td>
</tr>
<tr>
<td>right_trigger_speed</td>
<td>real</td>
<td>Speed of the right trigger from 0 to 65535.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Bool</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs">steam_input_trigger_vibration_extended(player_handle, <span class="hljs-number">65535</span> / <span class="hljs-number">2</span>, <span class="hljs-number">65535</span> / <span class="hljs-number">2</span>, <span class="hljs-number">65535</span> / <span class="hljs-number">4</span>, <span class="hljs-number">65535</span> / <span class="hljs-number">4</span>);</pre><p> The above code will trigger a vibration effect at half the maximum power on vibration motors, and set the trigger speed for both triggers to a quarter.</p>
<!-- KEYWORDS
steam_input_trigger_vibration_extended
-->
<!-- TAGS
steam_input_trigger_vibration_extended
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_input_trigger_simple_haptic_event">steam_input_trigger_simple_haptic_event</h1>
<p> This function will trigger a simple haptic event if the target controller supports them. Returns <code>true</code> on success and <code>false</code> on failure.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_input_trigger_simple_haptic_event(controller,location,intensity,gain_db,other_intensity,other_gain_db);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>controller</td>
<td>real</td>
<td>Input handle of the controller.</td>
</tr>
<tr>
<td>location</td>
<td>real</td>
<td>A <code>steam_input_controller_haptic_location_</code> constant.</td>
</tr>
<tr>
<td>intensity</td>
<td>real</td>
<td>Intensity of the first motor from 0 to 255.</td>
</tr>
<tr>
<td>gain_db</td>
<td>real</td>
<td>Gain in DB units, can be negative, from -127 to 128.</td>
</tr>
<tr>
<td>other_intensity</td>
<td>real</td>
<td>Intensity of the second motor from 0 to 255.</td>
</tr>
<tr>
<td>other_gain_db</td>
<td>real</td>
<td>Gain of the second motor in DB units, can be negative, from -127 to 128.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Bool</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs">steam_input_trigger_simple_haptic_event(controller, steam_input_controller_haptic_location_both, <span class="hljs-number">255</span> / <span class="hljs-number">2</span>, <span class="hljs-number">0</span>, <span class="hljs-number">255</span> / <span class="hljs-number">2</span>, <span class="hljs-number">0</span>);</pre><p> The above code will trigger a simple haptic event with half intensity and neutral db gain on both motors of the controller.</p>
<!-- KEYWORDS
steam_input_trigger_simple_haptic_event
-->
<!-- TAGS
steam_input_trigger_simple_haptic_event
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_input_set_led_color">steam_input_set_led_color</h1>
<p> This function will set or reset the color of the LED on the controller. Keep in mind that not all controllers have LEDs in them, and that the default user color of the controller differs between manufacturers, but your custom ones should always look almost the same.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_input_set_led_color(controller,color,flags);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>controller</td>
<td>real</td>
<td>Input handle of the controller.</td>
</tr>
<tr>
<td>color</td>
<td>real</td>
<td>Color value to use.</td>
</tr>
<tr>
<td>flags</td>
<td>real</td>
<td>A <code>steam_input_led_flag_</code> constant.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Bool</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-comment">// to set your own color:</span>
<span class="hljs-keyword">var</span> _rainbow = <span class="hljs-built_in">make_color_hsv</span>((<span class="hljs-built_in">get_timer</span>() / <span class="hljs-number">100000</span>) <span class="hljs-keyword">mod</span> (<span class="hljs-number">255</span> + <span class="hljs-number">1</span>), <span class="hljs-number">255</span>, <span class="hljs-number">255</span>); <span class="hljs-comment">// cycle through the Hue.</span>
steam_input_set_led_color(controller, _rainbow, steam_input_led_flag_set_color);
<span class="hljs-comment">// to reset to the default color:</span>
steam_input_set_led_color(controller, <span class="hljs-literal">c_black</span>, steam_input_led_flag_restore_user_default);</pre><p> The above code first sets the LED color to a custom one, then resets the color to the default one.</p>
<!-- KEYWORDS
steam_input_set_led_color
-->
<!-- TAGS
steam_input_set_led_color
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_input_trigger_haptic_pulse_legacy">steam_input_trigger_haptic_pulse_legacy</h1>
<p> This function runs a haptic pulse through the legacy API, this is only useful if the target controller is a Steam Controller. Returns <code>true</code> on success and <code>false</code> otherwise.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_input_trigger_haptic_pulse_legacy(controller,pad,duration_in_ms);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>controller</td>
<td>real</td>
<td>Input handle of the controller.</td>
</tr>
<tr>
<td>pad</td>
<td>real</td>
<td>A <code>steam_input_steam_controller_pad_</code> constant.</td>
</tr>
<tr>
<td>duration_in_ms</td>
<td>real</td>
<td>Duration of the pulse in miliseconds.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Bool</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs">steam_input_trigger_haptic_pulse_legacy(player_handle, steam_input_steam_controller_pad_left, <span class="hljs-number">2</span> * <span class="hljs-number">1000</span>);</pre><p> The above code runs a haptic pulse on the left motor for two seconds (2000 miliseconds).</p>
<!-- KEYWORDS
steam_input_trigger_haptic_pulse_legacy
-->
<!-- TAGS
steam_input_trigger_haptic_pulse_legacy
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_input_trigger_repeated_haptic_pulse_legacy">steam_input_trigger_repeated_haptic_pulse_legacy</h1>
<p> This function runs a repeated haptic pulse through the legacy API, this is only useful if the target controller is a Steam Controller. Returns <code>true</code> on success and <code>false</code> otherwise.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_input_trigger_repeated_haptic_pulse_legacy(controller,pad,duration_in_ms,offset_in_ms,repeat_times,flags);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>controller</td>
<td>real</td>
<td>Input handle of the controller.</td>
</tr>
<tr>
<td>pad</td>
<td>real</td>
<td>A <code>steam_input_steam_controller_pad_</code> constant.</td>
</tr>
<tr>
<td>duration_in_ms</td>
<td>real</td>
<td>Duration of the pulse in miliseconds.</td>
</tr>
<tr>
<td>offset_in_ms</td>
<td>real</td>
<td>The offset from which to start looping in miliseconds.</td>
</tr>
<tr>
<td>repeat_times</td>
<td>real</td>
<td>How many times to repeat the loop?</td>
</tr>
<tr>
<td>flags</td>
<td>real</td>
<td>Repeated haptic pulse flags</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Bool</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs">steam_input_trigger_repeated_haptic_pulse_legacy(player_handle, steam_input_steam_controller_pad_left, <span class="hljs-number">2</span> * <span class="hljs-number">1000</span>, <span class="hljs-number">100</span>, <span class="hljs-number">2</span>, <span class="hljs-number">0</span>);</pre><p> The above code runs a repeated haptic pulse on the left motor for two seconds (2000 miliseconds), the next iterations will start at 100 miliseconds and this will repeat two times.</p>
<!-- KEYWORDS
steam_input_trigger_repeated_haptic_pulse_legacy
-->
<!-- TAGS
steam_input_trigger_repeated_haptic_pulse_legacy
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_input_show_binding_panel">steam_input_show_binding_panel</h1>
<p> This function opens the Steam Input Configurator for the target controller which allows the player to rebind controls in-game. If Steam is not running in Big Picture, a new window will be opened, otherwise the configurator will be invoked as a part of the Steam Overlay. Keep in mind that the player can open the Configurator without this function too, by pressing the &quot;Controller Layout&quot; button in the Steam Overlay. Returns <code>true</code> if the operation was successful and <code>false</code> otherwise.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_input_show_binding_panel(controller);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>controller</td>
<td>real</td>
<td>Input handle of the controller.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Bool</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs">steam_input_show_binding_panel(player_handle);</pre><p> The above code opens the Steam Input Configurator for the controller handle stored in <code>player_handle</code>.</p>
<!-- KEYWORDS
steam_input_show_binding_panel
-->
<!-- TAGS
steam_input_show_binding_panel
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_input_get_input_type_for_handle">steam_input_get_input_type_for_handle</h1>
<p> This function returns the type of the target controller. Useful if you want to know which features are most likely supported by the target contorller.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_input_get_input_type_for_handle(controller);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>controller</td>
<td>real</td>
<td>Input handle of the controller.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs"><span class="hljs-built_in">real</span></pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">var</span> _input_type = steam_input_get_input_type_for_handle(player_handle);
<span class="hljs-keyword">var</span> _msg = <span class="hljs-string">&quot;The controller type is &quot;</span>;
<span class="hljs-keyword">var</span> _typestr = <span class="hljs-string">&quot;Unknown&quot;</span>;
<span class="hljs-keyword">switch</span> (_input_type) {
<span class="hljs-keyword">case</span> steam_input_type_steam_controller: _typestr = <span class="hljs-string">&quot;Steam Controller&quot;</span>; <span class="hljs-keyword">break</span>;
<span class="hljs-keyword">case</span> steam_input_type_xbox_360_controller: _typestr = <span class="hljs-string">&quot;Xbox 360&quot;</span>; <span class="hljs-keyword">break</span>;
<span class="hljs-keyword">case</span> steam_input_type_xbox_one_controller: _typestr = <span class="hljs-string">&quot;Xbox One&quot;</span>; <span class="hljs-keyword">break</span>;
<span class="hljs-keyword">case</span> steam_input_type_generic_gamepad: _typestr = <span class="hljs-string">&quot;Generic Gamepad&quot;</span>; <span class="hljs-keyword">break</span>;
<span class="hljs-keyword">case</span> steam_input_type_ps4_controller: _typestr = <span class="hljs-string">&quot;DualShock 4&quot;</span>; <span class="hljs-keyword">break</span>;
<span class="hljs-keyword">case</span> steam_input_type_apple_mfi_controller: _typestr = <span class="hljs-string">&quot;Apple MFi&quot;</span>; <span class="hljs-keyword">break</span>;
<span class="hljs-keyword">case</span> steam_input_type_android_controller: _typestr = <span class="hljs-string">&quot;Android&quot;</span>; <span class="hljs-keyword">break</span>;
<span class="hljs-keyword">case</span> steam_input_type_switch_joycon_pair: _typestr = <span class="hljs-string">&quot;Joy-Con Pair&quot;</span>; <span class="hljs-keyword">break</span>;
<span class="hljs-keyword">case</span> steam_input_type_switch_joycon_single: _typestr = <span class="hljs-string">&quot;Single Joy-Con&quot;</span>; <span class="hljs-keyword">break</span>;
<span class="hljs-keyword">case</span> steam_input_type_switch_pro_controller: _typestr = <span class="hljs-string">&quot;Pro Controller&quot;</span>; <span class="hljs-keyword">break</span>;
<span class="hljs-keyword">case</span> steam_input_type_mobile_touch: _typestr = <span class="hljs-string">&quot;Mobile Touch&quot;</span>; <span class="hljs-keyword">break</span>;
<span class="hljs-keyword">case</span> steam_input_type_ps3_controller: _typestr = <span class="hljs-string">&quot;DualShock 3&quot;</span>; <span class="hljs-keyword">break</span>;
<span class="hljs-keyword">case</span> steam_input_type_ps5_controller: _typestr = <span class="hljs-string">&quot;DualSense&quot;</span>; <span class="hljs-keyword">break</span>;
<span class="hljs-keyword">case</span> steam_input_type_steam_deck_controller: _typestr = <span class="hljs-string">&quot;Steam Deck&quot;</span>; <span class="hljs-keyword">break</span>;
}
<span class="hljs-built_in">show_debug_message</span>(_msg + _typestr);</pre><p> The above code prints the type of the controller as a string to debug output.</p>
<!-- KEYWORDS
steam_input_get_input_type_for_handle
-->
<!-- TAGS
steam_input_get_input_type_for_handle
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_input_get_controller_for_gamepad_index">steam_input_get_controller_for_gamepad_index</h1>
<p> This function returns the input handle for an XInput gamepad slot, or 0 if that slot is not powered by Steam Input. That can be used to match between native GameMaker <code>gamepad_</code> slots and Steam Input controllers on Windows. Since on Windows the GameMaker pad slots from 0 to 3 are XInput controllers, and from 4 to 12 are DirectInput controllers. This function only works with emulated XInput controllers.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_input_get_controller_for_gamepad_index(index);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>index</td>
<td>real</td>
<td>XInput slot from 0 to 3 included.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs"><span class="hljs-built_in">real</span></pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">var</span> _slot0h = steam_input_get_controller_for_gamepad_index(<span class="hljs-number">0</span>);
<span class="hljs-keyword">if</span> (_slot0h != <span class="hljs-number">0</span>) {
<span class="hljs-built_in">show_debug_message</span>(<span class="hljs-string">&quot;GM slot 0 handle = &quot;</span> + <span class="hljs-built_in">string</span>(_slot0h));
}</pre><p> The above code prints the controller handle for the first XInput gamepad slot if it is valid.</p>
<!-- KEYWORDS
steam_input_get_controller_for_gamepad_index
-->
<!-- TAGS
steam_input_get_controller_for_gamepad_index
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_input_get_controller_for_gamepad_index">steam_input_get_controller_for_gamepad_index</h1>
<p> This function is the reverse of <a href="#steam_input_get_controller_for_gamepad_index">steam_input_get_controller_for_gamepad_index</a>, except it allows you to determine whether a Steam Input handle is being emulated as XInput as well or not. See the definition of the reverse function for more information about slots.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_input_get_controller_for_gamepad_index(controller);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>controller</td>
<td>real</td>
<td>Input handle of the controller.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Real</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">var</span> _slot0i = steam_input_get_gamepad_index_for_controller(player_handle);
<span class="hljs-keyword">if</span> (_slot0i &gt;= <span class="hljs-number">0</span>) {
<span class="hljs-built_in">show_debug_message</span>(<span class="hljs-string">&quot;GM slot for player is = &quot;</span> + <span class="hljs-built_in">string</span>(_slot0i));
}</pre><p> The above code prints the XInput slot for the player controller if it&#39;s valid.</p>
<!-- KEYWORDS
steam_input_get_gamepad_index_for_controller
-->
<!-- TAGS
steam_input_get_gamepad_index_for_controller
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_input_get_string_for_xbox_origin">steam_input_get_string_for_xbox_origin</h1>
<p> This function turns a <code>steam_input_xbox_origin_</code> constant into a localized string, the language will be taken from Steam client settings. For example <code>&quot;A Button&quot;</code> if it&#39;s English or <code>&quot;Кнопка A&quot;</code> if it&#39;s Russian.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_input_get_string_for_xbox_origin(origin);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>origin</td>
<td>real</td>
<td>A <code>steam_input_xbox_origin_</code> constant.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs"><span class="hljs-built_in">string</span></pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-built_in">show_debug_message</span>(<span class="hljs-string">&quot;A Button is &quot;</span> + steam_input_get_string_for_xbox_origin(steam_input_xbox_origin_a));</pre><p> The above code prints the localized name of the Xbox 360 A button origin.</p>
<!-- KEYWORDS
steam_input_get_string_for_xbox_origin
-->
<!-- TAGS
steam_input_get_string_for_xbox_origin
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_input_get_glyph_for_xbox_origin">steam_input_get_glyph_for_xbox_origin</h1>
<p> This returns a path to a PNG associated with a <code>steam_input_xbox_origin_</code> constant. The returned path will be automatically added into the GameMaker filesystem sandbox list so it can be used with <code>buffer_load</code> or <code>sprite_add</code> no matter whether you have sandbox enabled or not.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_input_get_glyph_for_xbox_origin(origin);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>origin</td>
<td>real</td>
<td>A <code>steam_input_xbox_origin_</code> constant.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs"><span class="hljs-built_in">string</span></pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">var</span> _path = steam_input_get_glyph_for_xbox_origin(steam_input_xbox_origin_a);
<span class="hljs-keyword">var</span> _sprite = <span class="hljs-built_in">sprite_add</span>(_path, <span class="hljs-number">1</span>, <span class="hljs-literal">false</span>, <span class="hljs-literal">false</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>);
<span class="hljs-comment">// ...</span>
<span class="hljs-comment">// do not forget to free the sprite when you&#x27;re done:</span>
<span class="hljs-built_in">sprite_delete</span>(_sprite);</pre><p> The above code loads a PNG file associated with <code>steam_input_xbox_origin_a</code> as a sprite.</p>
<!-- KEYWORDS
steam_input_get_glyph_for_xbox_origin
-->
<!-- TAGS
steam_input_get_glyph_for_xbox_origin
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_input_get_action_origin_from_xbox_origin">steam_input_get_action_origin_from_xbox_origin</h1>
<p> This function returns the closest origin that maps to the <code>steam_input_xbox_origin_</code> constant for the target controller. So for a DualShock 4 controller handle <code>steam_input_xbox_origin_a</code> will return the &quot;cross&quot; button origin. Useful for transposing Xbox 360 button hints into the target controller button hints without using the Actions and Action Sets.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_input_get_action_origin_from_xbox_origin(controller, origin);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>controller</td>
<td>real</td>
<td>Target controller handle to use.</td>
</tr>
<tr>
<td>origin</td>
<td>real</td>
<td>A <code>steam_input_xbox_origin_</code> constant.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs"><span class="hljs-built_in">real</span></pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-comment">// original origin:</span>
<span class="hljs-keyword">var</span> _xbox_origin = steam_input_xbox_origin_y;
<span class="hljs-comment">// transposed origin: (ex: (Y) -&gt; (TRIANGLE) on DS4)</span>
<span class="hljs-keyword">var</span> _transposed_origin = steam_input_get_action_origin_from_xbox_origin(player_handle, _xbox_origin);
<span class="hljs-keyword">var</span> _path = steam_input_get_glyph_png_for_action_origin(_transposed_origin, steam_input_glyph_size_small, steam_input_glyph_style_dark);
<span class="hljs-keyword">var</span> _sprite = <span class="hljs-built_in">sprite_add</span>(_path, <span class="hljs-number">1</span>, <span class="hljs-literal">false</span>, <span class="hljs-literal">false</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>);
<span class="hljs-comment">// do something with the sprite</span>
<span class="hljs-comment">// ...</span>
<span class="hljs-comment">// free the sprite:</span>
<span class="hljs-built_in">sprite_delete</span>(_sprite);</pre><p> The above code loads an input sprite of the Xbox 360 button &quot;Y&quot; in the target controller&#39;s style.</p>
<!-- KEYWORDS
steam_input_get_action_origin_from_xbox_origin
-->
<!-- TAGS
steam_input_get_action_origin_from_xbox_origin
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_input_translate_action_origin">steam_input_translate_action_origin</h1>
<p> This function allows to translate an action origin for a new unknown controller type into an origin that this extension will understand. This is useful if a new controller is released, it&#39;s support is added into Steam Input, the Steam client is updated, the Steam Input Configurator is updated, but your game is not, and it doesn&#39;t know about this controller. With this function you can try to obtain the closest origin that maps to that unknown-for-your-game controller origin.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_input_translate_action_origin(type, origin);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>type</td>
<td>real</td>
<td><code>steam_input_type_</code> you would like to map to, or <code>steam_input_type_unknown</code> to let Steam do a best guess.</td>
</tr>
<tr>
<td>origin</td>
<td>real</td>
<td>An unknown input action origin you would like to translate.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs"><span class="hljs-built_in">real</span></pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-comment">// do a best guess here, let&#x27;s pretend we have absolutely no idea how to handle this new controller</span>
<span class="hljs-keyword">var</span> _transposed_origin = steam_input_translate_action_origin(steam_input_type_unknown, <span class="hljs-literal">global</span>.shoot_origin);
<span class="hljs-keyword">var</span> _path = steam_input_get_glyph_png_for_action_origin(_transposed_origin, steam_input_glyph_size_small, steam_input_glyph_style_dark);
<span class="hljs-keyword">var</span> _sprite = <span class="hljs-built_in">sprite_add</span>(_path, <span class="hljs-number">1</span>, <span class="hljs-literal">false</span>, <span class="hljs-literal">false</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>);
<span class="hljs-comment">// do something with the sprite</span>
<span class="hljs-comment">// ...</span>
<span class="hljs-comment">// free the sprite:</span>
<span class="hljs-built_in">sprite_delete</span>(_sprite);</pre><p> The above code tries to map an unknown action origin into something that this extension understands, and then loads a sprite representing that origin.</p>
<!-- KEYWORDS
steam_input_translate_action_origin
-->
<!-- TAGS
steam_input_translate_action_origin
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_input_get_device_binding_revision">steam_input_get_device_binding_revision</h1>
<p> This function returns the current action bindings revision as a struct, or <code>undefined</code> if there was an error.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_input_get_device_binding_revision(controller);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>controller</td>
<td>real</td>
<td>Input controller handle to use.</td>
</tr>
</tbody>
</table>
<p><strong>Struct Fields:</strong></p>
<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>major</td>
<td>real</td>
<td>Major version digit.</td>
</tr>
<tr>
<td>minor</td>
<td>real</td>
<td>Minor version digit.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Struct OR Undefined</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">var</span> _bindvers = steam_input_get_device_binding_revision(player_handle);
<span class="hljs-built_in">show_debug_message</span>(<span class="hljs-string">&quot;Major = &quot;</span> + <span class="hljs-built_in">string</span>(_bindvers.major) + <span class="hljs-string">&quot;, minor = &quot;</span> + <span class="hljs-built_in">string</span>(_bindvers.minor));</pre><p> The above code prints the current device bindings revision into debug output.</p>
<!-- KEYWORDS
steam_input_get_device_binding_revision
-->
<!-- TAGS
steam_input_get_device_binding_revision
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_input_get_remote_play_session_id">steam_input_get_remote_play_session_id</h1>
<p> This function returns the current Steam Remote Play session id associated with the controller, or 0 if no session is associated.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_input_get_remote_play_session_id(controller);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>controller</td>
<td>input_handle</td>
<td>Input controller handle to use.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Real</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">var</span> _sessid = steam_input_get_remote_play_session_id(player_handle);
<span class="hljs-built_in">show_debug_message</span>(<span class="hljs-string">&quot;Session ID = &quot;</span> + <span class="hljs-built_in">string</span>(_sessid));</pre><p> The above code prints the current Steam Remote Play session id associated with the player controller.</p>
<!-- KEYWORDS
steam_input_get_remote_play_session_id
-->
<!-- TAGS
steam_input_get_remote_play_session_id
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_input_get_session_input_configuration_settings">steam_input_get_session_input_configuration_settings</h1>
<p> This function returns the Steam Remote Play session opted-in gamepad types bitmask. Specifically the <code>steam_input_configuration_enable_type_</code> constants.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_input_get_session_input_configuration_settings();</pre><p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Real</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">var</span> _setmask = steam_input_get_session_input_configuration_settings();
<span class="hljs-comment">// how to detect for opt-in:</span>
<span class="hljs-keyword">var</span> _opted_into_ps = (_setmask &amp; steam_input_configuration_enable_type_playstation) != <span class="hljs-number">0</span>;
<span class="hljs-keyword">var</span> _opted_into_switch = (_setmask &amp; steam_input_configuration_enable_type_switch) != <span class="hljs-number">0</span>;
<span class="hljs-comment">// just print the bitmask:</span>
<span class="hljs-built_in">show_debug_message</span>(<span class="hljs-string">&quot;Settings bit mask = &quot;</span> + <span class="hljs-built_in">string</span>(_setmask));</pre><p> The above code prints the current Steam Remote Play session input bitmask into the debug output.</p>
<!-- KEYWORDS
steam_input_get_session_input_configuration_settings
-->
<!-- TAGS
steam_input_get_session_input_configuration_settings
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_input_set_dualsense_trigger_effect">steam_input_set_dualsense_trigger_effect</h1>
<p> This function is for input handles of DualSense controllers only, allows to apply an adaptive trigger effect to a DualSense input handle. The format of the struct is described in the example code. Returns <code>true</code> if the operation was successful and <code>false</code> otherwise.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_input_set_dualsense_trigger_effect(controller, param);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>controller</td>
<td>real</td>
<td>Input controller handle to use.</td>
</tr>
<tr>
<td>param</td>
<td>struct</td>
<td>Trigger effect parameter struct, see the example.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Bool</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-comment">// please PLEASE PLEASE read the comments for each field here,</span>
<span class="hljs-comment">// your struct MUST follow this format, otherwise the extension will throw an exception.</span>
<span class="hljs-comment">// field comments taken from isteamdualsense.h header file from the Steamworks SDK.</span>
<span class="hljs-keyword">var</span> _param = {
<span class="hljs-comment">// which triggers to modify, L2, R2, or both</span>
trigger_mask: steam_input_sce_pad_trigger_effect_trigger_mask_l2 | steam_input_sce_pad_trigger_effect_trigger_mask_r2,
<span class="hljs-comment">// must be a valid array of 2 elements, always</span>
command: [
<span class="hljs-comment">// L2 data:</span>
{
mode: steam_input_sce_pad_trigger_effect_mode_multiple_position_vibration,
<span class="hljs-comment">// command_data must be a valid struct, never undefined</span>
command_data: {
<span class="hljs-comment">// if mode_off then no fields from command_data will be read, otherwise:</span>
feedback_param: {
<span class="hljs-comment">// if mode_feedback</span>
position: <span class="hljs-number">0</span>, <span class="hljs-comment">/*E position where the strength of target trigger start changing(0~9). */</span>
strength: <span class="hljs-number">0</span> <span class="hljs-comment">/*E strength that the motor arm pushes back target trigger(0~8 (0: Same as Off mode)). */</span>
},
weapon_param: {
<span class="hljs-comment">// if mode_weapon</span>
start_position: <span class="hljs-number">0</span>, <span class="hljs-comment">/*E position where the stiffness of trigger start changing(2~7). */</span>
end_position: <span class="hljs-number">0</span>, <span class="hljs-comment">/*E position where the stiffness of trigger finish changing(start_position+1~8). */</span>
strength: <span class="hljs-number">0</span> <span class="hljs-comment">/*E strength of gun trigger(0~8 (0: Same as Off mode)). */</span>
},
vibration_param: {
<span class="hljs-comment">// if mode_vibration</span>
position: <span class="hljs-number">0</span>, <span class="hljs-comment">/*E position where the motor arm start vibrating(0~9). */</span>
amplitude: <span class="hljs-number">0</span>, <span class="hljs-comment">/*E vibration amplitude(0~8 (0: Same as Off mode)). */</span>
frequency: <span class="hljs-number">0</span>, <span class="hljs-comment">/*E vibration frequency(0~255[Hz] (0: Same as Off mode)). */</span>
},
multiple_position_feedback_param: {
<span class="hljs-comment">// if mode_multiple_position_feedback</span>
<span class="hljs-comment">/*E strength that the motor arm pushes back target trigger at position(0~8 (0: Same as Off mode)).
* strength[0] means strength of motor arm at position0.
* strength[1] means strength of motor arm at position1.
* ...
* */</span>
strength: [ <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span> ]
},
slope_feedback_param: {
<span class="hljs-comment">// if mode_slope_feedback</span>
start_position: <span class="hljs-number">0</span>, <span class="hljs-comment">/*E position where the strength of target trigger start changing(0~end_position). */</span>
end_position: <span class="hljs-number">0</span>, <span class="hljs-comment">/*E position where the strength of target trigger finish changing(start_position+1~9). */</span>
start_strength: <span class="hljs-number">0</span>, <span class="hljs-comment">/*E strength when trigger&#x27;s position is start_position(1~8) */</span>
end_strength: <span class="hljs-number">0</span> <span class="hljs-comment">/*E strength when trigger&#x27;s position is end_position(1~8) */</span>
},
multiple_position_vibration_param: {
<span class="hljs-comment">// if mode_multiple_position_vibration</span>
frequency: <span class="hljs-number">0</span>, <span class="hljs-comment">/*E vibration frequency(0~255 (0: Same as Off mode)) */</span>
<span class="hljs-comment">/*E vibration amplitude at position(0~8 (0: Same as Off mode)).
* amplitude[0] means amplitude of vibration at position0.
* amplitude[1] means amplitude of vibration at position1.
* ...
* */</span>
amplitude: [ <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span> ]
}
}
},
<span class="hljs-comment">// R2 data: even if your mask tells &quot;only l2&quot;, you MUST still include the dummy r2 field:</span>
{
mode: steam_input_sce_pad_trigger_effect_mode_off,
command_data: {
<span class="hljs-comment">// MUST be present even when mode_off!!</span>
}
}
]
};
<span class="hljs-comment">// apply the parameters to the dualsense controller:</span>
steam_input_set_dualsense_trigger_effect(player_handle, _param);</pre><p> The above code demonstrates the use of DualSense adaptive trigger effects in Steam Input, along with documenting every field in the struct.</p>
<!-- KEYWORDS
steam_input_set_dualsense_trigger_effect
-->
<!-- TAGS
steam_input_set_dualsense_trigger_effect
-->
<p><br><br></p>
<p class="page" id="Utils"></p><h1>Steam Utilities</h1>
<p><a id="top"></a>
<a id="top"></a>
<!--<div class="body-scroll" style="top: 150px;">--></p>
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="utilities">Utilities</h1>
<p> The Steam utility functions provide access to gamepad keyboard UI and Steam Deck getters.</p>
<p> The following functions can be used to access Steam Utilities from within GameMaker Studio 2</p>
<ul>
<li><a href="#steam_show_floating_gamepad_text_input">steam_show_floating_gamepad_text_input</a></li>
<li><a href="#steam_dismiss_floating_gamepad_text_input">steam_dismiss_floating_gamepad_text_input</a></li>
<li><a href="#steam_show_gamepad_text_input">steam_show_gamepad_text_input</a></li>
<li><a href="#steam_get_entered_gamepad_text_input">steam_get_entered_gamepad_text_input</a></li>
<li><a href="#steam_utils_enable_callbacks">steam_utils_enable_callbacks</a></li>
<li><a href="#steam_utils_is_steam_running_on_steam_deck">steam_utils_is_steam_running_on_steam_deck</a></li>
</ul>
<!-- KEYWORDS
Steam Utilities
-->
<!-- TAGS
steam_utils_functions
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_show_floating_gamepad_text_input">steam_show_floating_gamepad_text_input</h1>
<p> With this function you can show a floating gamepad keyboard window, all input is emulated as if it is a physical keyboard, so <code>keyboard_string</code> or <code>keyboard_check</code> can be used to obtain the input. This function only works in Big Picture or on the Steam Deck. Returns <code>true</code> if the keyboard has been shown successfully, <code>false</code> otherwise.</p>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="warning" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/26a0.png">⚠️</g-emoji> IMPORTANT</strong></p>
<p>You must call <a href="#steam_utils_enable_callbacks">steam_utils_enable_callbacks</a> prior to calling this function if you wish to receive <code>Async - Steam</code> gamepad keyboard events.</p>
</blockquote>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_show_floating_gamepad_text_input(mode, text_field_x, text_field_y, text_field_width, text_field_height);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>mode</td>
<td>real</td>
<td>A <code>steam_floating_gamepad_text_input_mode_</code> constant.</td>
</tr>
<tr>
<td>text_field_x</td>
<td>real</td>
<td>X position of the keyboard window in display coordinates.</td>
</tr>
<tr>
<td>text_field_y</td>
<td>real</td>
<td>Y position of the keyboard window in display coordinates.</td>
</tr>
<tr>
<td>text_field_width</td>
<td>real</td>
<td>Width of the keyboard window in display coordinates.</td>
</tr>
<tr>
<td>text_field_height</td>
<td>real</td>
<td>Height of the keyboard window in display coordinates.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>async_load contents:</strong></p>
<table>
<thead>
<tr>
<th>Key</th>
<th>Value</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>event_type</td>
<td>string</td>
<td>A constant string <code>&quot;floating_gamepad_text_input_dismissed&quot;</code>.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Bool</pre><p><br></p>
<p><strong>Extended Example:</strong></p>
<pre class="hljs">steam_utils_enable_callbacks(); <span class="hljs-comment">// do this somewhere once.</span>
<span class="hljs-comment">// show the dialog:</span>
steam_show_floating_gamepad_text_input(
steam_floating_gamepad_text_input_mode_single_line,
<span class="hljs-comment">// in Display coordinates: use window_get_ or display_get_ functions to obtain the dimensions</span>
<span class="hljs-built_in">window_get_x</span>(),
<span class="hljs-built_in">window_get_y</span>()/<span class="hljs-number">2</span>,
<span class="hljs-built_in">window_get_width</span>(),
<span class="hljs-built_in">window_get_height</span>()/<span class="hljs-number">2</span>
);</pre><pre class="hljs"><span class="hljs-comment">/// @description Async - Steam event</span>
<span class="hljs-keyword">if</span> (<span class="hljs-symbol">async_load</span>[? <span class="hljs-string">&quot;event_type&quot;</span>] == <span class="hljs-string">&quot;floating_gamepad_text_input_dismissed&quot;</span>) {
<span class="hljs-built_in">show_debug_message</span>(<span class="hljs-string">&quot;Floating gamepad keyboard UI dialog dismissed.&quot;</span>);
}</pre><p> The above code shows a floating keyboard window in the bottom half of the window, then print a message to debug output when the dialog is dismissed.</p>
<!-- KEYWORDS
steam_show_floating_gamepad_text_input
-->
<!-- TAGS
steam_show_floating_gamepad_text_input
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_dismiss_floating_gamepad_text_input">steam_dismiss_floating_gamepad_text_input</h1>
<p> With this function you can dismiss a floating keyboard window if it is being currently shown. Returns <code>true</code> if the operation was successful, <code>false</code> otherwise.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_dismiss_floating_gamepad_text_input();</pre><p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Bool</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs">steam_dismiss_floating_gamepad_text_input();</pre><p> The above code will dismiss the floating keyboard window if it is being displayed.</p>
<!-- KEYWORDS
steam_dismiss_floating_gamepad_text_input
-->
<!-- TAGS
steam_dismiss_floating_gamepad_text_input
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_show_gamepad_text_input">steam_show_gamepad_text_input</h1>
<p> With this function you can show a full-screen old-style Big Picture Mode-only keyboard UI. This one does not emulate the physical keyboard so you must use the <a href="#steam_get_entered_gamepad_text_input">steam_get_entered_gamepad_text_input</a> function inside a corresponding <code>Async - Steam</code> event to obtain the input. Returns <code>true</code> if the window is being shown successfully, <code>false</code> otherwise.</p>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="warning" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/26a0.png">⚠️</g-emoji> IMPORTANT</strong></p>
<p>You must call <a href="#steam_utils_enable_callbacks">steam_utils_enable_callbacks</a> prior to calling this function if you wish to receive <code>Async - Steam</code> gamepad keyboard events.</p>
</blockquote>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_show_gamepad_text_input(mode,lines_mode,description,chars_max,existing_text);</pre><table>
<thead>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>mode</td>
<td>real</td>
<td>A <code>steam_gamepad_text_input_mode_</code> constant.</td>
</tr>
<tr>
<td>lines_mode</td>
<td>real</td>
<td>A <code>steam_gamepad_text_input_line_mode_</code> constant.</td>
</tr>
<tr>
<td>description</td>
<td>string</td>
<td>The description of the window.</td>
</tr>
<tr>
<td>chars_max</td>
<td>real</td>
<td>The maximum amount of characters the player can enter.</td>
</tr>
<tr>
<td>existing_text</td>
<td>string</td>
<td>Some existing text to put into the text field or an empty string.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>async_load contents:</strong></p>
<table>
<thead>
<tr>
<th>Key</th>
<th>Value</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>event_type</td>
<td>string</td>
<td>A string <code>&quot;gamepad_text_input_dismissed&quot;</code>.</td>
</tr>
<tr>
<td>submitted</td>
<td>bool</td>
<td><code>true</code> if the dialog was submitted successfully and <code>false</code> if it was cancelled.</td>
</tr>
<tr>
<td>submitted_text_raw_byte_length</td>
<td>real</td>
<td>Raw length of the text in bytes.</td>
</tr>
</tbody>
</table>
<p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Bool</pre><p><br></p>
<p><strong>Extended Example:</strong></p>
<pre class="hljs">steam_utils_enable_callbacks(); <span class="hljs-comment">// somewhere once.</span>
<span class="hljs-comment">// show the dialog:</span>
steam_show_gamepad_text_input(
steam_gamepad_text_input_mode_normal,
steam_gamepad_text_input_line_mode_single_line,
<span class="hljs-string">&quot;Some Description&quot;</span>,
<span class="hljs-number">100</span>, <span class="hljs-comment">// up to 100 string characters</span>
<span class="hljs-string">&quot;&quot;</span> <span class="hljs-comment">// no default text, can be any string, ex: &quot;Player 1&quot; etc</span>
);</pre><pre class="hljs"><span class="hljs-comment">/// @description Async - Steam event</span>
<span class="hljs-keyword">if</span> (<span class="hljs-symbol">async_load</span>[? <span class="hljs-string">&quot;event_type&quot;</span>] == <span class="hljs-string">&quot;gamepad_text_input_dismissed&quot;</span>) {
<span class="hljs-keyword">if</span> (<span class="hljs-symbol">async_load</span>[? <span class="hljs-string">&quot;submitted&quot;</span>]) {
<span class="hljs-keyword">var</span> _input = steam_get_entered_gamepad_text_input();
<span class="hljs-built_in">show_debug_message</span>(<span class="hljs-string">&quot;Old-style dialog result: &quot;</span> + _input);
}
}</pre><p> The above code will show a modal gamepad keyboard input dialog with <code>&quot;Some Description&quot;</code> as the description and an empty text field, then print the typed text.</p>
<!-- KEYWORDS
steam_show_gamepad_text_input
-->
<!-- TAGS
steam_show_gamepad_text_input
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_get_entered_gamepad_text_input">steam_get_entered_gamepad_text_input</h1>
<p> With this function you can obtain the result of the <a href="#steam_show_gamepad_text_input">steam_show_gamepad_text_input</a> input dialog. This function must only be called in the corresponding <code>Async - Steam</code> event.</p>
<blockquote>
<p><strong><g-emoji class="g-emoji" alias="warning" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/26a0.png">⚠️</g-emoji> IMPORTANT</strong></p>
<p>You must call <a href="#steam_utils_enable_callbacks">steam_utils_enable_callbacks</a> prior to calling this function if you wish to receive <code>Async - Steam</code> gamepad keyboard events.</p>
</blockquote>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_get_entered_gamepad_text_input();</pre><p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs"><span class="hljs-built_in">string</span></pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-comment">/// @description Async - Steam event</span>
<span class="hljs-keyword">if</span> (<span class="hljs-symbol">async_load</span>[? <span class="hljs-string">&quot;event_type&quot;</span>] == <span class="hljs-string">&quot;gamepad_text_input_dismissed&quot;</span>) {
<span class="hljs-keyword">if</span> (<span class="hljs-symbol">async_load</span>[? <span class="hljs-string">&quot;submitted&quot;</span>]) {
<span class="hljs-keyword">var</span> _input = steam_get_entered_gamepad_text_input();
<span class="hljs-built_in">show_debug_message</span>(<span class="hljs-string">&quot;Old-style dialog result: &quot;</span> + _input);
}
}</pre><p> The above code will activate the use of gamepad keyboard UI async events.</p>
<!-- KEYWORDS
steam_get_entered_gamepad_text_input
-->
<!-- TAGS
steam_get_entered_gamepad_text_input
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_utils_enable_callbacks">steam_utils_enable_callbacks</h1>
<p> With this function you can activate the dispatch of <code>Async - Steam</code> events for gamepad keyboard UI. Returns <code>true</code> if the operation was successful and <code>false</code> otherwise.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_utils_enable_callbacks();</pre><p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Bool</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs">steam_utils_enable_callbacks();</pre><p> The above code will activate the use of gamepad keyboard UI async events.</p>
<!-- KEYWORDS
steam_utils_enable_callbacks
-->
<!-- TAGS
steam_utils_enable_callbacks
-->
<p><br><br></p>
<hr>
<!--<div class="body-scroll" style="top: 150px;">-->
<!-- Page HTML do not touch -->
<p><a></a><p align="right"><a href="#top">Back To Top</a></p>
<h1 id="steam_utils_is_steam_running_on_steam_deck">steam_utils_is_steam_running_on_steam_deck</h1>
<p> With this function you can check if your game is currently running on a Steam Deck, returns <code>true</code> if yes and <code>false</code> otherwise.</p>
<p><br></p>
<p><strong>Syntax:</strong></p>
<pre class="hljs">steam_utils_is_steam_running_on_steam_deck();</pre><p><br></p>
<p><strong>Returns:</strong></p>
<pre class="hljs">Bool</pre><p><br></p>
<p><strong>Example:</strong></p>
<pre class="hljs"><span class="hljs-keyword">if</span> (steam_utils_is_steam_running_on_steam_deck()) {
<span class="hljs-built_in">show_debug_message</span>(<span class="hljs-string">&quot;The game is running on a Steam Deck.&quot;</span>);
}</pre><p> The above code will print a message to debug output if the game is running on the Steam Deck.</p>
<!-- KEYWORDS
steam_utils_is_steam_running_on_steam_deck
-->
<!-- TAGS
steam_utils_is_steam_running_on_steam_deck
-->
<p><br><br></p>
</div> <!-- /div.col-md-9 -->
</div> <!-- /div.row -->
</div> <!-- /div.container -->
</body>
<script>
$('body').scrollspy({ target: '#scroll-spy', offset: 40 })
</script>
</html>