Pause function in CYOA?

Is there a pause function for the CYOA side of Quest? I searched through the drop box, but I am not seeing something that stands out for that particular feature.

I want it in typewriter mode where it types out and then it pauses for a moment before continuing with the rest of the story. Right now if I use two typewriters one under the other, they type out at the same time instead of it waiting for the first to get done.

If I put all of the intro in that one typewriter section/word bar, it continually types it all out with no pauses, thus it loses it's suspense/atmosphere.

I see I can change the typing speed, but I am looking for a pause between typings. Thank you.


Hello.

This thread will probably be moved to the Quest forum. (Squiffy is completely different software.)


You can do this in Quest:

// CUSTOMIZABLE -  Set the message.
s = "This is the message."
// CUSTOMIZABLE -  Set the typewriter speed in milliseconds
typespeed = 100
// CUSTOMIZABLE -  Set the pause time after the message has finished in milliseconds
pausetime = 3000
// INTERNAL - Calculating wait time
waittime = LengthOf(s)*typespeed/1000
// INTERNAL - Calculating total wait time
totalwait = waittime + (pausetime/1000)
// INTERNAL - Begin typewriter effect
TextFX_Typewriter (s, typespeed)
// INTERNAL - Set the timeout
SetTimeout (totalwait) {
  // CUSTOMIZABLE - Put your script to run after the message has printed here!!!
  msg ("FIXME:  This line should be replaced with a custom script!")
}

But can you do that in Gamebook? And I thought Squiffy was the CYOA mode.


But can you do that in Gamebook?

Whoops!

I forgot Quest Gamebook mode lacked the SetTimeout stuff.

If you have the desktop version of Quest, you can make the above code work if you add this stuff to your game in full code view, just before the very last line of code (which is </asl>):

  <function name="SetTimeout" parameters="interval, script">
    SetTimeoutID (interval, "", script)
  </function>
  <function name="SetTimeoutID" parameters="interval, name, script">
    timername = ""
    if (name = "") {
      timername = GetUniqueElementName("timeout")
    }
    else {
      if (GetTimer(name) = null and GetObject(name) = null) {
        timername = name
      }
      else {
        error ("Error creating timer: There is already an existing object named " + name)
      }
    }
    if (not timername = "") {
      create timer (timername)
      timer = GetTimer(timername)
      SetTimerInterval (timer, interval)
      timer.timeoutscript = script
      SetTimerScript (timer) {
        this.enabled = false
        invoke (this.timeoutscript)
        destroy (this.name)
      }
      EnableTimer (timer)
    }
  </function>
    <function name="SetTimerInterval" parameters="timer, interval">
    timer.interval = interval
  </function>
  <function name="SetTimerScript" parameters="timer, script">
    timer.script = script
  </function>
    <function name="EnableTimer" parameters="timer">
    timer.enabled = true
    timer.trigger = game.timeelapsed + timer.interval
  </function>

And I thought Squiffy was the CYOA mode.

Nope. Totally different. They were both created by Alex Warren, and they're both tied to this site, but that's all they have in common.


EDITED

Here's the entire test game:

<!--Saved by Quest 5.7.6606.27193-->
<asl version="550">
  <include ref="GamebookCore.aslx" />
  <game name="gbbbbb">
    <gameid>ca8f06e8-c2df-43b9-abcd-ba3a1dba2800</gameid>
    <version>1.0</version>
    <firstpublished>2018</firstpublished>
  </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>Test the typewriter</value>
      </item>
      <item>
        <key>Page3</key>
        <value>This link goes to page 3</value>
      </item>
    </options>
    <object name="player">
      <inherit name="defaultplayer" />
    </object>
  </object>
  <object name="Page2">
    <inherit name="scripttext" />
    <description> </description>
    <script type="script">
      // CUSTOMIZABLE -  Set the message.
      s = "This is the message."
      // CUSTOMIZABLE -  Set the typewriter speed in milliseconds
      typespeed = 100
      // CUSTOMIZABLE -  Set the pause time after the message has finished in milliseconds
      pausetime = 3000
      // INTERNAL - Calculating wait time
      waittime = LengthOf(s)*typespeed/1000
      // INTERNAL - Calculating total wait time
      totalwait = waittime + (pausetime/1000)
      // INTERNAL - Begin typewriter effect
      TextFX_Typewriter (s, typespeed)
      // INTERNAL - Set the timeout
      SetTimeout (totalwait) {
        // CUSTOMIZABLE - Put your script to run after the message has printed here!!!
        msg ("FIXME:  This line should be replaced with a custom script!")
        msg("{page:Page1:Go back}")
      }
    </script>
  </object>
  <object name="Page3">
    <description>This is page 3. Type a description here, and then create links to other pages below.</description>
    <options type="stringdictionary">
      <item>
        <key>Page1</key>
        <value>Go back</value>
      </item>
    </options>
  </object>
  <function name="SetTimeout" parameters="interval, script">
    SetTimeoutID (interval, "", script)
  </function>
  <function name="SetTimeoutID" parameters="interval, name, script">
    timername = ""
    if (name = "") {
      timername = GetUniqueElementName("timeout")
    }
    else {
      if (GetTimer(name) = null and GetObject(name) = null) {
        timername = name
      }
      else {
        error ("Error creating timer: There is already an existing object named " + name)
      }
    }
    if (not timername = "") {
      create timer (timername)
      timer = GetTimer(timername)
      SetTimerInterval (timer, interval)
      timer.timeoutscript = script
      SetTimerScript (timer) {
        this.enabled = false
        invoke (this.timeoutscript)
        destroy (this.name)
      }
      EnableTimer (timer)
    }
  </function>
    <function name="SetTimerInterval" parameters="timer, interval">
    timer.interval = interval
  </function>
  <function name="SetTimerScript" parameters="timer, script">
    timer.script = script
  </function>
    <function name="EnableTimer" parameters="timer">
    timer.enabled = true
    timer.trigger = game.timeelapsed + timer.interval
  </function>
</asl>

{Squiffy is a tool for creating interactive fiction - that is, multiple choice games that focus on text and story. Players navigate through the game or story by clicking links. Sometimes these kinds of games or stories are known as gamebooks.}

That is one of the first things you see when you come to the Quest site. If that is not the CYOA mode than I am totally lost. I call everything "Quest", but I figured I was posting in the correct forum section... >_<

Thank you for the bit of code though. However on a side note does all code, or that which affects the entire game, always go at the very last line of code? But then how does Quest differentiate one code from another so it does not crash? Do they have to be in some kind of order or Quest does that on it's own?


@Text_Quester

Squiffy is a tool for creating interactive fiction - that is, multiple choice games that focus on text and story. Players navigate through the game or story by clicking links. Sometimes these kinds of games or stories are known as gamebooks.

Yep.

Squiffy is a tool for creating gamebooks.

Quest is a tool for creating text adventures or gamebooks.

They can both do gamebooks, but they're different applications, and use a different language for scripting.


@ Text Quester:

Quest Text Adventure: the full bore program/software of quest, able to do pretty much anything you want (quest is really powerful): skyrim-level RPG world/mechanics, CYOA, creating your own engine itself, etc etc etc

Quest Game Book: the most limited/weakest program/software by Alex (original creator of quest and squiffy). Meant for (simple) CYOA, though can do scripting/rpg-mechanics too, as well, but doesn't have the nice features for them that the Quest Text Adventure does (you have to do everything via scripting, no nice Tabs and controls/options like in the Quest Text Adventure GUI/Editor)

Squiffy (Edit, thanks Mrangel for this edit/correction: Squiffy is a completely different software/program from Quest, but still made by Alex, original creator of quest) this software/program/engine is made more for authoring/writing (verbose/narrative/story-plot-heavy-descriptive/fancy/advanced) heavy CYOA, more powerful/useful than Quest Game Book for CYOA. I've never used it, so not sure if it can (or if can, then how easy it can), do scripting/RPG-mechanics or not.


@HK

Quest Squiffy: this software/program/engine of quest

It's called Squiffy. Not "Quest Squiffy".
Quest and Squiffy are both on this site, and they were originally written by the same guy, but they're completely different software.


So if I am using Quest and choose Gamebook mode, it goes to the Quest forum and not the Squiffy forum?


there should be a 'Game Book' forum board... but there's not currently...

Squiffy related stuff is for Squiffy forum board

if it's just about CYOA in general and/or a design question, that can go in the interactive fiction design (or whatever it is called) forum board

otherwise, use the (main) quest forum and/or the libraries and code samples forum board, for everything else: Text Adventure and/or Game Book


So if I am using Quest and choose Gamebook mode, it goes to the Quest forum and not the Squiffy forum?

Squiffy users generally know how to use Squiffy, not Quest, and vice-versa.

If you'd like to ask Squiffy people (who generally don't use Quest) how to use Quest, knock yourself out, but it's basically like asking how to do something in Windows on a Mac forum.


You can easily check out the differences between Quest and Squiffy. They are both available to download, or you can use the online versions. (You could also peruse the documentation.)


Also, have you read the Quest docs concerning authoring game-books? (The creator and maintainers of Quest suggest you avoid Gamebook Mode in Quest.)

http://docs.textadventures.co.uk/quest/tutorial/creating_a_gamebook.html

https://textadventures.co.uk/forum/samples/topic/4772/how-to-make-a-text-adventure-look-like-a-gamebook


[Also, have you read the Quest docs concerning authoring game-books? (The creator and maintainers of Quest suggest you avoid Gamebook Mode in Quest.)]

I must not of... Why would they have it available if they suggest not to use it? O_o


Why would they have it available if they suggest not to use it?

I believe that's mostly for the authors who have works in progress online. Whenever Quest is updated, the online version is updated as well. Not all things carry over to the online version, but, if the Gamebook stuff was removed, I don't think the online users would have access to it at all anymore.

Desktop users could just download an older version of Quest, of course, but The Pixie takes care of everyone, even those of us with no Windows machines.


Plus, you can make a very basic game in Gamebook mode, and kids in schools use Quest to do so.

http://activelit.com/


I've made "games" (or things not unlike games, at any rate) in Quest's Gamebook mode. It's basically Quest, but it only has like 1/25th of the functions included. The main difference is that the command prompt is hidden, along with the panes and the location bar.

That second link in my last post shows you how to Easily make a CYOA in Quest's Text Adventure mode.


If you're not fluent in Javascript, I advise against Squiffy. You also have to learn lots of little Squiffy tricks to make the Javascript work.

Plus, Squiffy has no GUI interface.

Yeah... Squiffy was made for coders.


I think I will continue with Game Book as Squiffy had my eyes glaze over when I first looked at it. I of course will have another look, but presently I was just wanting to make a CYOA book, while still working on my main TA game. If GB is the place for CYOA then I guess I will stick with that. I just thought Squiffy was a side name for the CYOA part, hence the Game Book of Quest. And I shall try that string of code thank you.


[Whoops!
I forgot Quest Gamebook mode lacked the SetTimeout stuff.
If you have the desktop version of Quest, you can make the above code work if you add this stuff to your game in full code view, just before the very last line of code (which is ):]

(For what ever reason the forum will not let me copy and paste the code here, it simply either refuses to allow me to post or it is invisible... But it was the code directly after what you typed which should be the second/middle code you posted...)

I tried the code as specified with it being the very last thing before the "asl" and only the first sentence was shown, then an error, which I can no longer even document as I tried to redo it with a space or a paragraph space to see if that was needed and now I can not even open the game with it saying-

"Failed to load game due to the following errors:

  • Invalid XML: The 'object' start tag on line 39 position 4 does not match the end tag of 'asl'. Line 81, position 5."

I can not even get into it to edit the game, which seems very odd to me. Sure I understand it is not playable until fixed, but I am clearly pressing the EDIT button, yet that message pops up. Thankfully it was early on in the game, virtually nothing was lost. But had it been almost fully complete with me just putting the finishing touches, hence the code, that would of been something else entirely. So how does one edit a game that wont even allow you even into it to mess with the code to begin with? Do I have to go into the game folder specifically and fiddle with it?

Right now I can just start from scratch, but that code did not seem to work. Also to be more specific, I want only a few lines to pause so to speak. The rest I want like normal. It just depends how the game ends up flowing.


Your game's main folder should be in this directory: Documents\Quest Games\

Once you are in the game's main folder, you will see your_game_name.aslx. RIght-click on that and open it up in notepad (or your preferred text editor).

image


image


You can edit the code manually that way. Once you save, if you have corrected your errors, the file should open in Quest again.


Just to show how it all should work, here is a GIF which begins with a blank game, shows me adding the two bits of code from those posts, and shows the code in action:


as KV/RH said:

errors in code happen all the time, trouble-shooting bad code is what coders do 90% of their time coding, lol. Welcome to the wonderful world of coding!

you can always get into your game's code:

  1. right click on the game file itself (NAME_OF_YOUR_GAME_FILE.aslx), and then choose to 'open' it with a text editor software (notepad, wordpad, Apple: text editor, notepad++, etc), and ta-da, you're now seeing you entire game code (your game entire), and now it's just a matter of finding (harder part) and fixing (easier part) your bad part/s of code.

  2. if your game is published online, you got to download it, and then unzip (using such free software: winzip, winrar, etc) its 'NAME_OF_GAME_FILE.quest' published game file, to get at your 'NAME_OF_GAME_FILE.aslx' game file, which then you can open it up (see #1 above)


some errors in code are 'in-game' errors (some game mechanic/feature/stat/attribute/action/whatever doesn't work right, which may be either minor or major, in terms of being able to continue to play your game and/or complete your game)

some errors in code make the game unplayable (it crashes and/or is unable to start/load/initialize, either during game play, or just when trying to start/play the game upon its load-up/initialization/starting-up)

some errors in code make it not even able to compile/load/start-up into the GUI/Editor

whatever the code error, don't panic, as this is common in programming, you just got to find and fix up the errors in your code


some of quest's error messages are ambigious (non-helpful), but whenever you got one that gives you the 'line and position' those are the best (most helpful) error messages, and that's the one you got:

Invalid XML: The 'object' start tag on line 39 position 4 does not match the end tag of 'asl'. Line 81, position 5."

literally, go to line 81 of your entire game code, and count (from left to right) over 5 characters/spaces (position 5)

I highly recommend downloading and installing 'notepad+', as it's a really powerful/useful text editor software, and it's free too:

https://notepad-plus-plus.org

once you got it installed (and opened up), at the top horizontal menu bar, click on 'languages', and select the 'xml' language for your quest code (quest's 'aslx' is almost the same as 'xml', and thus choosing/using 'xml' works fine for notepad++'s purposes/functionality of color coding and etc stuff it does)

now, this may not be where the actual error is at, but it's a starting place. Also, usually you have a bunch of errors... once you fix one, another error message will popup of the next error that needs fixing.

finding/tracking down the errors in code is the hard part... fixing them is very easy


if you want some help, with working with code (pasting in code correctly and troubleshooting code), read these to understand quest's code structure:

http://textadventures.co.uk/forum/quest/topic/mu7itzjqv0yxrkdwgsbmzg/how-to-make-npc-confront-you-with-chioces#46cdb25b-4767-40a6-8bf4-3cd84e805781


as to your error...

Invalid XML: The 'object' start tag on line 39 position 4 does not match the end tag of 'asl'. Line 81, position 5."

assuming this is the only error in your entire game code, and, just guessing (we need to see your entire game code, to absolutely be able to help you with fixing it up):

since you're new to this stuff, it's likely you didn't paste in your/KV's/RH's code correctly into your entire game code...

which is supported by the error message 'does not match the end tag of asl'

as the 'asl' block (OBJECT: ELEMENT) is your GAME OBJECT:

<asl>

  <!-- your entire game (game's contents/code) goes here, inside of the 'asl' GAME OBJECT -->

</asl>

which is why KV/RH said to paste his code:

http://textadventures.co.uk/forum/quest/topic/ugqhsdkvpuebeob6dx03oq/pause-function-in-cyoa#12f371e8-d791-4ff3-8a05-bd8e389d28ef (KV/RH post)

  <function name="SetTimeout" parameters="interval, script">
    SetTimeoutID (interval, "", script)
  </function>
  <function name="SetTimeoutID" parameters="interval, name, script">
    timername = ""
    if (name = "") {
      timername = GetUniqueElementName("timeout")
    }
    else {
      if (GetTimer(name) = null and GetObject(name) = null) {
        timername = name
      }
      else {
        error ("Error creating timer: There is already an existing object named " + name)
      }
    }
    if (not timername = "") {
      create timer (timername)
      timer = GetTimer(timername)
      SetTimerInterval (timer, interval)
      timer.timeoutscript = script
      SetTimerScript (timer) {
        this.enabled = false
        invoke (this.timeoutscript)
        destroy (this.name)
      }
      EnableTimer (timer)
    }
  </function>
    <function name="SetTimerInterval" parameters="timer, interval">
    timer.interval = interval
  </function>
  <function name="SetTimerScript" parameters="timer, script">
    timer.script = script
  </function>
    <function name="EnableTimer" parameters="timer">
    timer.enabled = true
    timer.trigger = game.timeelapsed + timer.interval
  </function>

into your entire game code, just above the ending tag of the 'asl' GAME OBJECT:

(example game code below is the default new game code, minus any differences, as I'm still using an older version of quest)

<asl version="550">

  <include ref="English.aslx" />
  <include ref="Core.aslx" />

  <game name="NAME_OF_GAME">

    <gameid>SOME_RANDOMLY_GENERATED_HASH_STRING</gameid>

    <version>1.0</version>

    <firstpublished>2018</firstpublished>

  </game>

  <object name="room">

    <inherit name="editor_room" />

    <object name="player">

      <inherit name="editor_object" />
      <inherit name="editor_player" />

    </object>

  </object>

</asl>

and pasting in the code, as KV/RH suggested:

<asl version="550">

  <include ref="English.aslx" />
  <include ref="Core.aslx" />

  <game name="NAME_OF_GAME">

    <gameid>SOME_RANDOMLY_GENERATED_HASH_STRING</gameid>

    <version>1.0</version>

    <firstpublished>2018</firstpublished>

  </game>

  <object name="room">

    <inherit name="editor_room" />

    <object name="player">

      <inherit name="editor_object" />
      <inherit name="editor_player" />

    </object>

  </object>

  <function name="SetTimeout" parameters="interval, script">

    SetTimeoutID (interval, "", script)

  </function>

  <function name="SetTimeoutID" parameters="interval, name, script">

    timername = ""

    if (name = "") {
      timername = GetUniqueElementName("timeout")
    } else {
      if (GetTimer(name) = null and GetObject(name) = null) {
        timername = name
      } else {
        error ("Error creating timer: There is already an existing object named " + name)
      }
    }

    if (not timername = "") {

      create timer (timername)
      timer = GetTimer(timername)
      SetTimerInterval (timer, interval)
      timer.timeoutscript = script

      SetTimerScript (timer) {

        this.enabled = false
        invoke (this.timeoutscript)
        destroy (this.name)

      }

      EnableTimer (timer)

    }

  </function>

  <function name="SetTimerInterval" parameters="timer, interval">

    timer.interval = interval

  </function>

  <function name="SetTimerScript" parameters="timer, script">

    timer.script = script

  </function>

  <function name="EnableTimer" parameters="timer">

    timer.enabled = true
    timer.trigger = game.timeelapsed + timer.interval

  </function>

</asl>

CORRECT INDENTING (horizontal placement) MATTERS, as it determines containment, think of like of an outline (or folders):

I. europe
  A. france
    1. paris
  B. united kingdom
    1. london
II. north america
  A. united states
    1. washington d.c.

now, this is what happens if we do incorrect indenting:

I. europe
A. france
    1. paris
  B. united kingdom
1. london
  II. north america
  A. united states
1. washington d.c.

which would be this (which is totally incorrect):

I. europe
II. france
  A. united kingdom
    1. paris
III. london
  A. north america
  B. united states
IV. washington d.c.

now, for the most part, vertical placement doesn't matter, so long as you place it into the correct spot: OBJECT/ELEMENT (aka, the correct horizontal placement), after the 'game' special game settings and publishing info Object:

these are all error free placements:

<asl version="550">

  <include ref="English.aslx" />
  <include ref="Core.aslx" />

  <game name="EXAMPLE">

    <gameid>SOME_RANDOMLY_GENERATED_HASH_STRING</gameid>

    <version>1.0</version>

    <firstpublished>2018</firstpublished>

  </game>

  <object name="room">

    <inherit name="editor_room" />

    <object name="player">

      <inherit name="editor_object" />
      <inherit name="editor_player" />

    </object>

  </object>

  <function name="SetTimeout" parameters="interval, script">

    SetTimeoutID (interval, "", script)

  </function>

  <function name="SetTimeoutID" parameters="interval, name, script">

    timername = ""

    if (name = "") {
      timername = GetUniqueElementName("timeout")
    } else {
      if (GetTimer(name) = null and GetObject(name) = null) {
        timername = name
      } else {
        error ("Error creating timer: There is already an existing object named " + name)
      }
    }

    if (not timername = "") {

      create timer (timername)
      timer = GetTimer(timername)
      SetTimerInterval (timer, interval)
      timer.timeoutscript = script

      SetTimerScript (timer) {

        this.enabled = false
        invoke (this.timeoutscript)
        destroy (this.name)

      }

      EnableTimer (timer)

    }

  </function>

  <function name="SetTimerInterval" parameters="timer, interval">

    timer.interval = interval

  </function>

  <function name="SetTimerScript" parameters="timer, script">

    timer.script = script

  </function>

  <function name="EnableTimer" parameters="timer">

    timer.enabled = true
    timer.trigger = game.timeelapsed + timer.interval

  </function>

</asl>

....

<asl version="550">

  <include ref="English.aslx" />
  <include ref="Core.aslx" />

  <game name="EXAMPLE">

    <gameid>SOME_RANDOMLY_GENERATED_HASH_STRING</gameid>

    <version>1.0</version>

    <firstpublished>2018</firstpublished>

  </game>

  <function name="SetTimeout" parameters="interval, script">

    SetTimeoutID (interval, "", script)

  </function>

  <function name="SetTimeoutID" parameters="interval, name, script">

    timername = ""

    if (name = "") {
      timername = GetUniqueElementName("timeout")
    } else {
      if (GetTimer(name) = null and GetObject(name) = null) {
        timername = name
      } else {
        error ("Error creating timer: There is already an existing object named " + name)
      }
    }

    if (not timername = "") {

      create timer (timername)
      timer = GetTimer(timername)
      SetTimerInterval (timer, interval)
      timer.timeoutscript = script

      SetTimerScript (timer) {

        this.enabled = false
        invoke (this.timeoutscript)
        destroy (this.name)

      }

      EnableTimer (timer)

    }

  </function>

  <function name="SetTimerInterval" parameters="timer, interval">

    timer.interval = interval

  </function>

  <function name="SetTimerScript" parameters="timer, script">

    timer.script = script

  </function>

  <function name="EnableTimer" parameters="timer">

    timer.enabled = true
    timer.trigger = game.timeelapsed + timer.interval

  </function>

  <object name="room">

    <inherit name="editor_room" />

    <object name="player">

      <inherit name="editor_object" />
      <inherit name="editor_player" />

    </object>

  </object>

</asl>

here's incorrect placement examples:

<asl version="550">

  <include ref="English.aslx" />
  <include ref="Core.aslx" />

  <game name="EXAMPLE">

    <gameid>SOME_RANDOMLY_GENERATED_HASH_STRING</gameid>

    <version>1.0</version>

    <firstpublished>2018</firstpublished>

  </game>

  <object name="room">

    <inherit name="editor_room" />

    <object name="player">

      <inherit name="editor_object" />
      <inherit name="editor_player" />

    </object>

    <function name="SetTimeout" parameters="interval, script">

      SetTimeoutID (interval, "", script)

    </function>

    <function name="SetTimeoutID" parameters="interval, name, script">

      timername = ""

      if (name = "") {
        timername = GetUniqueElementName("timeout")
      } else {
        if (GetTimer(name) = null and GetObject(name) = null) {
          timername = name
        } else {
          error ("Error creating timer: There is already an existing object named " + name)
        }
      }

      if (not timername = "") {

        create timer (timername)
        timer = GetTimer(timername)
        SetTimerInterval (timer, interval)
        timer.timeoutscript = script

        SetTimerScript (timer) {

          this.enabled = false
          invoke (this.timeoutscript)
          destroy (this.name)

        }

        EnableTimer (timer)

      }

    </function>

    <function name="SetTimerInterval" parameters="timer, interval">

      timer.interval = interval

    </function>

    <function name="SetTimerScript" parameters="timer, script">

      timer.script = script

    </function>

    <function name="EnableTimer" parameters="timer">

      timer.enabled = true
      timer.trigger = game.timeelapsed + timer.interval

    </function>

  </object>

</asl>

here's IN-correct horizontal placement:

(notice how the 'functions' tag blocks are all at the same indentation as the 'asl' tag blocks)

(because the 'functions' are NOT indented more, they're not within the 'asl' tag block, and thus an error, and probably the error you're having/done too, lol. As everything MUST be within your GAME OBJECT, which is the 'asl' tag block)

<asl version="550">

  <include ref="English.aslx" />
  <include ref="Core.aslx" />

  <game name="EXAMPLE">

    <gameid>SOME_RANDOMLY_GENERATED_HASH_STRING</gameid>

    <version>1.0</version>

    <firstpublished>2018</firstpublished>

  </game>

  <object name="room">

    <inherit name="editor_room" />

    <object name="player">

      <inherit name="editor_object" />
      <inherit name="editor_player" />

    </object>

  </object>

<function name="SetTimeout" parameters="interval, script">

    SetTimeoutID (interval, "", script)

</function>

<function name="SetTimeoutID" parameters="interval, name, script">

    timername = ""

    if (name = "") {
      timername = GetUniqueElementName("timeout")
    } else {
      if (GetTimer(name) = null and GetObject(name) = null) {
        timername = name
      } else {
        error ("Error creating timer: There is already an existing object named " + name)
      }
    }

    if (not timername = "") {

      create timer (timername)
      timer = GetTimer(timername)
      SetTimerInterval (timer, interval)
      timer.timeoutscript = script

      SetTimerScript (timer) {

        this.enabled = false
        invoke (this.timeoutscript)
        destroy (this.name)

      }

      EnableTimer (timer)

    }

</function>

<function name="SetTimerInterval" parameters="timer, interval">

  timer.interval = interval

</function>

<function name="SetTimerScript" parameters="timer, script">

  timer.script = script

</function>

<function name="EnableTimer" parameters="timer">

  timer.enabled = true
  timer.trigger = game.timeelapsed + timer.interval

</function>

</asl>

I appreciate all the time and effort it took to do all that, but my eyes are glazing over... I am seeing bits of light, but it is still not clear... I am using Game Book. It has "pages". In your examples I am seeing a lot of "objects", but no "pages".

I want to make a game book where I can use the typewriter script. After each short sentence I want it to pause to let it sink in and them continue on and then another pause, so on and so forth at least at the very beginning. I am not seeing that code do anything of the sort.

I also do not want to stay in typewriter mode the entire game or at least not with all the pauses. I was hoping there was going to be simple functions in Game Book, but I am not seeing them readily available. As it is, I can change the typewriter speed, but can not pause it. I also can not make the words be typed out line by line.

So for instance I want-

abcdefg

hijklmop

qrstuvxxyz

But instead all it does is-

abcdefg hijzlmnop qrstuvwxyz

If I use two type writer scripts they type independently of each other, so they do it both at the same time, instead of waiting for the first to stop, before the next line is typed. I am sorry for any initial confusion or complete lack of understanding on my part.


Did you see this???

http://textadventures.co.uk/forum/quest/topic/ugqhsdkvpuebeob6dx03oq/pause-function-in-cyoa#fe467992-28e0-46b7-a595-a2088721c7da


EDIT

Never mind all that. I just read your other post, where you say you can't code your way out of a wet paper bag, so...

Here's my best offer:

1. Open your game file in a text editor.

2. Copy all the text.

3. Come back here.

4. Paste the code, with an opening ``` and a closing ```, like this:

```
THE ENTIRE GAME'S CODE GOES HERE
```

Once you've done that, I'll remove all the code you added that came from me, make sure your game opens, then post your revised code here. Then, you can just paste the revised code into your game file, and it will be fixed.


That game has already been rewritten. It only had two or three lines of sentences in it. No harm done. I did not notice the virtual demonstration you had posted, as when I have been looking at it mostly is from a phone and that does not show up on my end. And of course now every time I come to the forum I get shot to the bottom of the page. I shall look at it more in depth. ^_^

I am also probably just going to search through documentation one by one. I would of assumed this was as simple as putting tags for bold, italics, underline, quotes, etc. in most forums, or as with using Quest, just a few clicks and boxes checked. Regardless I do appreciate everyone's effort.


I would of assumed this was as simple as ...

It is if you make it in text adventure mode.

This is exactly why they advise against using Quest in Gamebook mode.

I reiterate, the creator and maintainer both advise against using Quest's Gamebook mode due to lack of features.


That game has already been rewritten. It only had two or three lines of sentences in it.

Since this is the case, I strongly advise starting the project over now using this method:

https://textadventures.co.uk/forum/samples/topic/4772/how-to-make-a-text-adventure-look-like-a-gamebook

So does the creator of that post, The Pixie, who is the guy who maintains the Quest.

See what I'm saying? We're well-versed in Quest, and this is our advice.

If you continue to try to do things a Gamebook doesn't do by default, you're destined to keep running into these issues, and you'll keep asking how to do it, and we'll keep trying to help, but we won't know EXACTLY what you're trying to do, nor will we know what code is currently in your game, and you won't know how it all works together, and things will go sideways, and you'll have to learn to code or start all over...

I have seen this happen dozens of times while I've been a forum member. I'm only saying these things because I'm trying to help.


whoops... sorry about doing it as a Text Adventure... totally forgot you using Game Book.... sorry about that...


Log in to post a reply.

Support

Forums