Save files

I wonder if you can save your page in Gamebook as a "Saved file". If it possible, how do you do this? For example, a player have reached page 20 and wanted to get out, so he can save the page like a bookmark.


Hello.

First, add new page named save.

Make it a script, and paste this into the script in code view:

request (RequestSave, "")

Next, go to the 'Script' tab on the game object.

In the 'Script when entering page' script, flip to code view and paste this in (add it to the beginning or the end if have other code in this script already):

JS.eval ("$('#save-link').remove();")
msg ("<div id='save-link' style='text-align:right;position:fixed;right:10px;top:30px;display:none;'>{command:save}</div>")
JS.eval ("var saveLink = $('#save-link');$('gameContent').prepend(saveLink);saveLink.show();")

This works in the desktop player, but I didn't test it out online.


Here's my example game's entire code:

<!--Saved by Quest 5.7.6663.35475-->
<asl version="550">
  <include ref="GamebookCore.aslx" />
  <game name="Let Them SAVE!">
    <gameid>956cde5a-b3d3-4fd3-a4d0-9595bb17f5a6</gameid>
    <version>1.0</version>
    <firstpublished>2018</firstpublished>
    <roomenter type="script"><![CDATA[
      JS.eval ("$('#save-link').remove();")
      msg ("<div id='save-link' style='text-align:right;position:fixed;right:10px;top:30px;display:none;'>{command:save}</div>")
      JS.eval ("var saveLink = $('#save-link');$('gameContent').prepend(saveLink);saveLink.show();")
    ]]></roomenter>
  </game>
  <object name="Page1">
    <description>This is page 1. Type a description here, and then create links to other pages below.</description>
    <options type="stringdictionary">
      <item>
        <key>Page2</key>
        <value>This link goes to page 2</value>
      </item>
      <item>
        <key>Page3</key>
        <value>And this link goes to page 3</value>
      </item>
    </options>
    <object name="player">
      <inherit name="defaultplayer" />
    </object>
  </object>
  <object name="Page2">
    <description>This is page 2. Type a description here, and then create links to other pages below.</description>
  </object>
  <object name="Page3">
    <description>This is page 3. Type a description here, and then create links to other pages below.</description>
  </object>
  <object name="save">
    <inherit name="script" />
    <script type="script">
      request (RequestSave, "")
    </script>
  </object>
</asl>

Log in to post a reply.

Support

Forums