No text when loading a saved game online (a couple of fixes)

K.V.

Hello,

When the player enters SAVE instead of clicking on 'Save' during online play, Quest does not save the text on the screen.

A couple of fixes:


Dirty:

//Offline first:
request (RequestSave, "")

//Online cleanup
JS.saveGame ()
JS.afterSave ()

Not so dirty:

<!--Saved by Quest 5.7.6404.16853-->
<asl version="550">
  <include ref="English.aslx" />
  <include ref="Core.aslx" />
  <game name="Loaded Save Tester">
    <gameid>68e8daeb-f2c6-4560-a6c2-b886785f742e</gameid>
    <version>1.0</version>
    <firstpublished>2017</firstpublished>
    <menufont>Georgia, serif</menufont>
  </game>
  <object name="room">
    <inherit name="editor_room" />
    <description><![CDATA[When I load a saved game, I can't see this!<br/>]]></description>
    <enter type="script">
      webCheck
    </enter>
    <object name="player">
      <inherit name="editor_object" />
      <inherit name="editor_player" />
    </object>
  </object>
  <command name="kv_saveCmd">
    <pattern>save</pattern>
    <script><![CDATA[
      JS.eval ("addText (Date()+\"&nbsp;\") ")
      if (not game.online) {
        request (RequestSave, "")
      }
      else {
        JS.saveGame ()
        JS.afterSave ()
      }
    ]]></script>
  </command>
  <function name="webCheck"><![CDATA[
    JS.eval ("addText(\"<br/>webCheck initialized<br/>\");var bool = false; if(webPlayer) {bool = true;ASLEvent('setOnline', bool);}else { bool = false; ASLEvent('setOnline', bool);}addText(\"<br/>webCheck complete<br/>\");")
  ]]></function>
  <function name="setOnline" parameters="bool">
    switch (bool) {
      case ("true") {
        msg ("You are playing online!")
        game.online = true
      }
      case ("false") {
        msg ("You are playing in the desktop version.")
        game.online = false
      }
      default {
        error ("Error checking for online player.")
      }
    }
  </function>
</asl>

This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums