Quest (Language): Difference between revisions

From IFWiki

m (Removed the wiki link. It was not official or maintained. Last wiki edit was 3+ years ago.)
(Updated to Quest 5)
Line 1: Line 1:
A kind of [[authoring system]] designed for non-programmers.
Quest 5 is an [[authoring system]] designed for non-programmers and non-programmers alike. It features a GUI interface that makes adding rooms and objects as easy as a few mouse clicks, but allows the use to swap into code mode at the click of a button to edit the under-lying XML code directly.


It's composed of a visual editor (QDK - the Quest Development Kit) for designing adventures, and the Quest interpreter to play them. The Quest Pro version also contains the CAS compiler and a packager to enable you to more easily distribute your game in a form without additional dependencies.  
[[Image:QuestExample.png]]


Games can be played in the original ASL (Adventure Scripting Language) format or compiled to a CAS format to prevent others from viewing or modifying your game's code. Games can written with the aid of the QDK visual editor or any text editor you prefer.
A very short game seen in the GUI above, and the XML code for it below:


The QuestNet server allows multi-player games., but has been discontinued and has not been distributed since Quest 4.0.5.
  <!--Saved by Quest 5.2.4515.34846-->
  <asl version="520">
    <include ref="English.aslx" />
    <include ref="Core.aslx" />
    <game name="example">
      <gameid>ed69c767-628f-4438-bc60-0ac11c8e54e4</gameid>
      <version>1.0</version>
    </game>
    <object name="room">
      <inherit name="editor_room" />
      <object name="player">
        <inherit name="defaultplayer" />
      </object>
      <object name="cup">
        <inherit name="editor_object" />
        <alias>Red Cup</alias>
      </object>
    </object>
  </asl>


All incarnations of Quest have been written in Visual Basic and have not been portable to systems running an OS other than Microsoft Windows. Quest 5 is still in development and is a completely new open-source system written in C# (for the back-end) and VB.NET (for the GUI).  
The basic unit of a Quest game is an XML element, which could be an object, room, exit or other entity. XML elements have attributes that identify them and allow them to interactive with each other. For example, objects and exits will have a ''parent'' attribute, signifying its current locationn, rooms and objects have ''name'' attributes to identify them.


Apart from that, Quest is a system with an easy and convenient syntax, and it can handle many situations for coding games, making it good for beginners. It can also include multimedia contents.
Quest has much functionality built-in, but this can be extended and overridden. Functions are standalone elements, scripts are attached to other elements. Quest supports types, and again these can be defined by the user. Types allow objects of a similar nature to be give the same properties (such as the ''container'' type). One type can inherit from another, so a ''lockedcontainer'' type inherits from a ''container'' type. Users can create new commands, or override old commands to do new things, while the related verbs are assocaiated with specific objects (or types of objects).


Quest Pro 4.14 has been released as freeware to the public and includes all features of the full program including the compiler and packager.
Any of these elements can be included in library files, which can also include instructs to update the editor GUI, allowing new attributes to be readily accessible.


{{stub|Almost any additional info would be welcome.}}
Below is an example of a type defined, "attackspell", which inherits from another type. The ''spelleffect'' attribute is a script, illustrating the somewhat C-like scripting language.


  <type name="attackspell">
    <inherit name="spell"/>
    <spelleffect type="script"><![CDATA[
      // Iterate through all objects in the room
      // Apply attack to those with the monster type that are not dead
      type = GetTarget (this)
      flag = False
      foreach (obj, ScopeVisibleNotHeld ()) {
        if (DoesInherit (obj, type) and not GetBoolean (obj, "dead")) {
          player.spelltarget = obj
          do (this, "spelltargeteffect")
          flag = True
        }
      }
      if (not flag) {
        Print (this.nothingaffected)
      }
    ]]></spelleffect>
  </type>
Here is a function defined to remove any instance of the character ''c'' from the string ''s''.
  <function name="LTrimAny" parameters="s, c" type="string">
    if (not LengthOf(c) = 1) { error ("Second parameter must be a single character in LTrimAny") }
    while (StartsWith(s, c)) {
      s = RemoveLeft(s)
    }
    return (s)
  </function>
Quest 5 has multilingual support built-in, through the use of templates. The appropriate language library file is required at the head of the file (as English.aslx is above). As of Octover 2012, Quest 5 has library files to support German, Spanish, Esperanto, French and Dutch.
There is a [http://quest5.net/wiki/Main_Page Quest 5 Wiki] that documents the system, and has a tutorial and several "How to" guides.
Quest 5 supercedes, and is quite different to, [[Quest 4]]


== Links ==
== Links ==
* [http://www.axeuk.com/quest/ Quest Home Page]
* [http://www.textadventures.co.uk textadventures.co.uk - Play text adventure games online] - The home of the Quest. Players can also post reviews of Quest games here.
* [http://www.textadventures.co.uk textadventures.co.uk - Play text adventure games online] - The new home (as of Feburary 2007) of the Quest Archive. Players can also post reviews of Quest games here.
* [http://quest5.net/wiki/Main_Page Quest 5 Wiki]
* [http://www.firthworks.com/roger/cloak/quest/source.html Source sample of a Quest game]


[[Category:Authoring system]] [[Category:Quest]]
[[Category:Authoring system]] [[Category:Quest]]

Revision as of 15:55, 30 October 2012

Quest 5 is an authoring system designed for non-programmers and non-programmers alike. It features a GUI interface that makes adding rooms and objects as easy as a few mouse clicks, but allows the use to swap into code mode at the click of a button to edit the under-lying XML code directly.

QuestExample.png

A very short game seen in the GUI above, and the XML code for it below:

 <asl version="520">
   <include ref="English.aslx" />
   <include ref="Core.aslx" />
   <game name="example">
     <gameid>ed69c767-628f-4438-bc60-0ac11c8e54e4</gameid>
     <version>1.0</version>
   </game>
   <object name="room">
     <inherit name="editor_room" />
     <object name="player">
       <inherit name="defaultplayer" />
     </object>
     <object name="cup">
       <inherit name="editor_object" />
       <alias>Red Cup</alias>
     </object>
   </object>
 </asl>

The basic unit of a Quest game is an XML element, which could be an object, room, exit or other entity. XML elements have attributes that identify them and allow them to interactive with each other. For example, objects and exits will have a parent attribute, signifying its current locationn, rooms and objects have name attributes to identify them.

Quest has much functionality built-in, but this can be extended and overridden. Functions are standalone elements, scripts are attached to other elements. Quest supports types, and again these can be defined by the user. Types allow objects of a similar nature to be give the same properties (such as the container type). One type can inherit from another, so a lockedcontainer type inherits from a container type. Users can create new commands, or override old commands to do new things, while the related verbs are assocaiated with specific objects (or types of objects).

Any of these elements can be included in library files, which can also include instructs to update the editor GUI, allowing new attributes to be readily accessible.

Below is an example of a type defined, "attackspell", which inherits from another type. The spelleffect attribute is a script, illustrating the somewhat C-like scripting language.

 <type name="attackspell">
   <inherit name="spell"/>
   <spelleffect type="script"><![CDATA[
     // Iterate through all objects in the room
     // Apply attack to those with the monster type that are not dead
     type = GetTarget (this)
     flag = False
     foreach (obj, ScopeVisibleNotHeld ()) {
       if (DoesInherit (obj, type) and not GetBoolean (obj, "dead")) {
         player.spelltarget = obj
         do (this, "spelltargeteffect")
         flag = True
       }
     }
     if (not flag) {
       Print (this.nothingaffected)
     }
   ]]></spelleffect>
 </type>

Here is a function defined to remove any instance of the character c from the string s.

 <function name="LTrimAny" parameters="s, c" type="string">
   if (not LengthOf(c) = 1) { error ("Second parameter must be a single character in LTrimAny") }
   while (StartsWith(s, c)) {
     s = RemoveLeft(s)
   }
   return (s)
 </function>

Quest 5 has multilingual support built-in, through the use of templates. The appropriate language library file is required at the head of the file (as English.aslx is above). As of Octover 2012, Quest 5 has library files to support German, Spanish, Esperanto, French and Dutch.

There is a Quest 5 Wiki that documents the system, and has a tutorial and several "How to" guides.

Quest 5 supercedes, and is quite different to, Quest 4

Links