Quest (Language): Difference between revisions
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: | ||
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. | |||
[[Image:QuestExample.png]] | |||
A very short game seen in the GUI above, and the XML code for it below: | |||
<!--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> | |||
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 [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.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 | * [http://quest5.net/wiki/Main_Page Quest 5 Wiki] | ||
* [http:// | |||
[[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.
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
- textadventures.co.uk - Play text adventure games online - The home of the Quest. Players can also post reviews of Quest games here.
- Quest 5 Wiki