gm-docs-parser 1.0.0

A collection of typings for GameMaker Studio 2 manual pages
Documentation
<?xml version="1.0" encoding="utf-8" ?>

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head>

  <script type="text/javascript" language="JavaScript">
    //<![CDATA[
    function reDo() {
      if (innerWidth != origWidth || innerHeight != origHeight)
        location.reload();
    }
    if ((parseInt(navigator.appVersion) == 4) && (navigator.appName == "Netscape")) {
      origWidth = innerWidth;
      origHeight = innerHeight;
      onresize = reDo;
    }
    onerror = null;
  //]]>
  </script>
  <style type="text/css">/*<![CDATA[*/

    < !-- div.WebHelpPopupMenu {
      position: absolute;
      left: 0px;
      top: 0px;
      z-index: 4;
      visibility: hidden;
    }

    p.WebHelpNavBar {
      text-align: right;
    }

    -->
  
/*]]>*/</style>

  <script type="text/javascript">//<![CDATA[

    gRootRelPath = "../../..";
    gCommonRootRelPath = "../../..";
    gTopicId = "9.2.17.0_24";
  
//]]></script>

  <script type="text/javascript" src="../../../template/scripts/rh.min.js"></script>
  <script type="text/javascript" src="../../../template/scripts/common.min.js"></script>
  <script type="text/javascript" src="../../../template/scripts/topic.min.js"></script>
  <script type="text/javascript" src="../../../template/scripts/topicwidgets.min.js"></script>
<script type="text/javascript" src="../../../whxdata/projectsettings.js"></script>
  <link rel="stylesheet" type="text/css" href="../../../template/styles/topic.min.css"/>
  <link rel="stylesheet" type="text/css" href="../../../template/Charcoal_Grey/topicheader.css"/>
  <meta name="topic-status" content="Draft"/>

  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  <title>buffer_async_group_end</title>
  <meta name="generator" content="Adobe RoboHelp 2019"/>
  <link rel="stylesheet" href="../../../assets/css/default.css" type="text/css"/>
  <meta name="rh-authors" content="Mark Alexander"/>
  <meta name="topic-comment" content="Reference page for buffer_async_group_end"/>
  <meta name="rh-index-keywords" content="buffer_async_group_end"/>
  <meta name="search-keywords" content="buffer_async_group_end"/>
</head>

<body>
  <div class="topic-header rh-hide" id="rh-topic-header" onclick="rh._.goToFullLayout()">
    <div class="logo">
    </div>
    <div class="nav">
      <div class="title" title="buffer_async_group_end">
        <span>buffer_async_group_end</span>
      </div>
      <div class="gotohome" title="Click here to see this page in full context">
        <span>Click here to see this page in full context</span>
      </div>
    </div>
  </div>
  <div class="topic-header-shadow rh-hide" id="rh-topic-header-shadow"></div>



  <!--<div class="body-scroll" style="top: 150px;">-->
  <h1>buffer_async_group_end</h1>
  <p>This function finishes the definition of a buffer save group. You must have previously called the function <a href="buffer_async_group_begin.htm"><tt>buffer_async_group_begin()</tt></a> to initiate the group, then call the function <a href="buffer_save_async.htm"><tt>buffer_save_async()</tt></a>    for each file that you wish to save out. Finally you call this function, which will start the saving of the files. The function will return a unique ID value for the save, which can then be used in the <a href="../../../The_Asset_Editors/Object_Properties/Async_Events/Save_Load.htm">Asynchronous Save / Load event</a>    to parse the results from the <a href="../../GML_Overview/Variables/Builtin_Global_Variables/async_load.htm">async_load</a> DS map.</p>
  <p> </p>
  <h4>Syntax:</h4>
  <p class="code">buffer_async_group_end();</p>
  <p> </p>
  <h4>Returns:</h4>
  <p class="code">Real</p>
  <p> </p>
  <h4>Extended Example:</h4>
  <p>The <tt>buffer_async_group_end()</tt> function can be called from any event, and since it is asynchronous the callback can be almost instantaneous or could take several seconds. Calling the function is simple and would look something like this:</p>
  <p class="code">buffer_async_group_begin(&quot;SaveGame&quot;);<br/> save1 = buffer_save_async(buff1, &quot;Player_Save1.sav&quot;, 0, 16384);<br/> save2 = buffer_save_async(buff2, &quot;Player_Save2.sav&quot;, 0, 16384);<br/> save3 = buffer_save_async(buff3, &quot;Player_Save3.sav&quot;,
    0, 16384);<br/> save4 = buffer_save_async(buff4, &quot;Player_Save4.sav&quot;, 0, 16384);<br/> save_id = buffer_async_group_end();</p>
  <p>The above code starts a buffer group then sets it to save out 4 files asynchronously. The group definition is then ended (at which point saving will begin), storing the ID of the function call in the variable &quot;<i>save_id</i>&quot;. When the save
    is complete, the asynchronous Save/Load event will be triggered and you can parse the <tt>async_load</tt> map for the correct ID of the function, like this:</p>
  <p class="code">if ds_map_find_value(async_load, &quot;id&quot;) == saveid<br/>     {
    <br/>     if ds_map_find_value(async_load, &quot;status&quot;) == false<br/>         {
    <br/>         show_debug_message(&quot;Save failed!&quot;);<br/>         }
    <br/>     }
  </p>
  <p>The above code will first check the id of the DS map that has been created, then check the status of the callback, posting a debug message if there has been any issues.</p>
  <p> </p>
  <p> </p>
  <p> </p>
  <div class="footer">
    <div class="buttons">
      <div class="clear">
        <div style="float:left">Back: <a href="Buffers.htm">Buffers</a></div>
        <div style="float:right">Next: <a href="buffer_copy.htm">buffer_copy</a></div>
      </div>
    </div>
    <h5>© Copyright YoYo Games Ltd. 2020 All Rights Reserved</h5>
  </div>
  <!-- KEYWORDS
buffer_async_group_end
-->
  <!-- TAGS
buffer_async_group_end
-->

</body></html>