-
Notifications
You must be signed in to change notification settings - Fork 17
Glossary
This is a work in progress, and undoubtedly the word you want is missing. Get in contact, if you have suggestions.
An array (a list in Quest 5) is an ordered list. Each item in the array has a number, or index, and these run sequentially from 0. JavaScript allows you to easily add and remove elements from either end of an array.
An array can store anything; numbers, strings, functions, arrays, dictionaries. One array can be used for multiple types.
More on how they can be used here.
Array attributes of objects will only be saved if they are arrays of strings only or arrays of numbers only. Note that Quest will only check the first item; if it find a string there, it will assume this is a string dictionary and will throw an error if that is not the case.
An attribute is some data or function that is associated with an object, and can be accessed via key. For example, all objects need a name, an attribute that is a string, accessed via the key "name".
This entry is an attribute of the glossary. It has data, the text you are reading, which is accessed through a key, the word "Attribute".
Attributes for items can be found here and for locations here.
A dictionary is a collection of values, where each value is accessed through a key; together they are an attribute. This document is a great example of a real-world dictionary - the values are all the definitions and the words are the keys. To find a value, say you want to know what a dictionary is, you use the key, i.e., the word "dictionary". The key is easy to find as they are listed alphabetically.
In computing a dictionary is a whole bunch of key-value pairs. And really, that is all an object is in both Quest 5 and Quest 6 (and indeed any interactive fiction system, I would guess).
In QuestJS, a dictionary can store anything; numbers, strings, functions, arrays, dictionaries. One dictionary can be used for multiple types, but note that dictionary attributes of objects will not be saved.
Technically, there are no dictionaries in JavaScript, they are actually objects, but you can treat them as dictionaries, and it is useful to distinguish them from objects in the sense of items and locations.
More on how they can be used here.
Sometimes the user will type something that is ambiguous. Suppose she types GET BOO, is she trying to get the book or the boots? Disambiguation is the process of picking one or the other.
QuestJS will first look at which item is at the right location and has the appropriate attribute to make an educated guess, but if all else fails, it will ask the user to clarify, selecting from a list of options.
Disambiguation is the second biggest pain in the neck in parser software (after scoping).
An exit is an attribute that defines a link from one location to another. It is more convenient to consider the routes out of a location than the routes into the room - there is no corresponding entrance attribute.
Exit attributes are named for the direction, so an exit to the north will be the attribute named "north". The tutorial page gives a good introduction.
You may come across mention of F12 in this documentation or if you get an error while playing a game. F12 is simply one of the function keys, and pressing it on most browsers will bring up the developer console, which is very useful for debugging.
That is not the case for Safari. You will need to first enable the "Developer Menu", by going to Safari Menu - Preferences and selecting the "Advanced Tab", then ticking "Show develop menu in menu bar". Then you can do Option-Command-C to open the console.
A free action is a command that relates to the game world, but the user can do it without time passing. For example, the LOOK command gives the user information about the game world, but is (presumably) just reminding the user about the text she has already seen; it is not having the player take a minute to survey the location.
LOOK, EXITS, INVENTORY, MAP and TOPICS are all free actions.
In QuestJS, authors can set settings.lookCountsAsTurn
to true to make all free actions become normal commands.
See also Meta-command.
From Wiki: Interactive fiction, often abbreviated IF, is software simulating environments in which players use text commands to control characters and influence the environment. Works in this form can be understood as literary narratives, either in the form of interactive narratives or interactive narrations. These works can also be understood as a form of video game, either in the form of an adventure game or role-playing game. In common usage, the term refers to text adventures, a type of adventure game where the entire interface can be "text-only", however, graphical text adventures still fall under the text adventure category if the main way to interact with the game is by typing text. Some users of the term distinguish between interactive fiction, known as "Puzzle-free", that focuses on narrative, and "text adventures" that focus on puzzles.
An item is a type of object; an entity in the game world. Items are things the player can manipulate; everything that is not a location is considered an item in QuestJS. It is possibly for an object to be both, but this is not supported and probably a bad idea.
In JavaScript, a key is a way to access data belonging to an object; it is the name of the attribute.
I recommend using whole words (i.e., using only letters, numbers and underscore) for keys so you can use the dot operator and omit the quotes, but spaces are allowed (you can also use numbers rather than strings).
What Quest 5 calls a list, JavaScript, and hence QuestJS, calls an array.
A location is a type of object; an entity in the game world. Locations define the geography of the world, where the player is as she navigates around.
The term "room" is used interchangeably with "location". It has the advantage of being faster to type, but is less accurate as a room could be an outside location.
A meta-command is a command about the game system rather than the game world. Commands like HELP, ABOUT, SAVE, LOAD, DARK and SCORE are all meta-commands.
When a meta-command is executed, no time passes in the game world; by default the output will be in a different style. See also free action.
Normalisation is the process of taking something and converting into something else that fits what you expect. In statistics, a set of data is normalised if it is adjusted to give a mean of 100, for example.
QuestJS normalises the users input by breaking it up into individual commands, reducing it to lower case, replacing tabs with spaces and removing any extraneous spaces.
A non-player character, or NPC, is a character in your game world other than the player. Creating good NPCs is quite an art, but there is a starting point here.
An object is an entity in the game world; either a location or an item or the game object. All objects belong to the dictionary "w".
An object is a set of data, together with functions that operate, modify or access that data. Most modern programming languages are object-orientated, include JavaScript. However, QuestJS does not use objects in that way, so that is all that will be said on the subject!
The parser is the part of the software that tries to understand what the player typed. If all goes well, it will identify the right command, and, if appropriate, the items to apply it to.
Interactive fiction can be broadly divided between parser-based and choice-based. In a choice-based game, at each turn the user is presented with a limited set of options to choose from. In a parser-based game, the user is presented with a text field where a command can be typed and a parser will attempt to understand it.
There are variants, cross-overs and alternatives to these two approaches, but as far as I know, all interactive fiction systems target one or the other - Quest in all its versions targets parser-based games.
The player can refer to the person playing the game or to the persona in the game world that is being controlled. The latter is a specific item.
These help files are moving towards using "user" for the person sat at the computer playing the game, in the hope that this will be less confusing, but it may not always be so.
The player can also mean the software used for playing a game, rather than editing a game, though this is not applicable to Quest JS.
Quest is a system for writing and playing interactive fiction, originally written by Alex Warren, and first released in 1998. Quest 5 was released in 2011. A timeline for Quest 1 to 5 can be found here.
QuestJS or Quest 6 is the latest version.
A regular expression, or regex for short, is a pattern that can be matched against a string. It allows for various types of wildcards, quantifiers, groups and anchors, allowing for the construction of very complex patterns. They are an important part of the parser as commands are found by matching against regexes, but a superficial knowledge of them will suffice for QuestJS.
More here.
See location.
In a role-playing game, or RPG, the user is generally given the opportunity to customise the player to some degree, and that customisation will then impact how successfully the player can perform tasks in the game, most notably in combat. There will often be opportunities to further upgrade the player as the game continues.
This is not restricted to interactive fiction. Dungeons & Dragons is probably the most well-known example, but computer games like Skyrim and Mass Effect are other examples.
RPGs are complex, but there is a good basis to be found here.
A template is a set of default attributes for a certain type of item. Add a template to an item when creating it to quickly give it some pre-defined behavior. More here.
The text processor is a part of Quest that converts a string from one thing to another, depending on codes embedded in the original string. Codes are surrounded by curly braces, and consist of a directive followed by parameters, all separated by colons. The example below cause the text "red balloon" to appear in red.
You can see a {colour:red:red balloon} floating through the sky.
The text processor can be used for all sorts of things; for example, it in used in the responses to most commands to allow Quest to give responses that are natural English, adapting to whether an item is singular or plural.
See more here.
The variable this
is special; it refers to the object to which the function is attached.
Note that if you have an object with a dictionary attribute, and a function inside the dictionary, this
will refer to the dictionary, not the object.
The user interface, or UI, is the bit of your game between the game and the real world - that is to say, what appears on the screen and how the player interacts with it.
As QuestJS runs in a browser, and is entirely written in JavaScript, there is a huge amount you can do. If you have every seen it on a web site, you can do it in QuestJS - but not necessarily easily...
It is a huge topic, and there are a lot of pages on your various options. Here is the introduction.
This is a special directive at the start of each Quest JS file, and it tells the browser to use strict mode when running JavaScript. Strict mode disallows certain things, which means it will catch certain bugs immediately. It is also more secure and potentially faster.
More here.
In JavaScript the global world includes every built-in function, elements of the web page, etc. It is therefore necessary to have a sealed off section that is the game world. This is called w
. To access an object called "table", you have to go via w
, so must use w.table
or w["table"]
to get it.
Only objects in w
get saved when the player saves a game.
Tutorial
- First steps
- Rooms and Exits
- Items
- Templates
- Items and rooms again
- More items
- Locks
- Commands
- Complex mechanisms
- Uploading
QuestJS Basics
- General
- Settings
- Attributes for items
- Attributes for rooms
- Attributes for exits
- Naming Items and Rooms
- Restrictions, Messages and Reactions
- Creating objects on the fly
- String Functions
- Random Functions
- Array/List Functions
- The
respond
function - Other Functions
The Text Processor
Commands
- Introduction
- Basic commands (from the tutorial)
- Complex commands
- Example of creating a command (implementing SHOOT GUN AT HENRY)
- More on commands
- Shortcut for commands
- Modifying existing commands
- Custom parser types
- Note on command results
- Meta-Commands
- Neutral language (including alternatives to "you")
- The parser
- Command matching
- Vari-verbs (for verbs that are almost synonyms)
Templates for Items
- Introduction
- Takeable
- Openable
- Container and surface
- Locks and keys
- Wearable
- Furniture
- Button and Switch
- Readable
- Edible
- Vessel (handling liquids)
- Components
- Countable
- Consultable
- Rope
- Construction
- Backscene (walls, etc.)
- Merchandise (including how to create a shop)
- Shiftable (can be pushed from one room to another)
See also:
- Custom templates (and alternatives)
Handing NPCs
- Introduction
- Attributes
- Allowing the player to give commands
- Conversations
- Simple TALK TO
- SAY
- ASK and TELL
- Dynamic conversations with TALK TO
- TALK and DISCUSS
- Following an agenda
- Reactions
- Giving
- Followers
- Visibility
- Changing the player point-of-view
The User Experience (UI)
The main screen
- Basics
- Printing Text Functions
- Special Text Effects
- Output effects (including pausing)
- Hyperlinks
- User Input
The Side Panes
Multi-media (sounds, images, maps, etc.)
- Images
- Sounds
- Youtube Video (Contribution by KV)
- Adding a map
- Node-based maps
- Image-based maps
- Hex maps
- Adding a playing board
- Roulette!... in a grid
Dialogue boxes
- Character Creation
- Other example dialogs [See also "User Input"]
Other Elements
- Toolbar (status bar across the top)
- Custom UI Elements
Role-playing Games
- Introduction
- Getting started
- Items
- Characters (and Monsters!)
- Spawning Monsters and Items)
- Systema Naturae
- Who, When and How NPCs Attack
- Attributes for characters
- Attacking and guarding
- Communicating monsters
- Skills and Spells
- Limiting Magic
- Effects
- The Attack Object
- [Extra utility functions](https://github.com/ThePix/QuestJS/wiki/RPG-Library-%E2%80%90-Extra Functions)
- Randomly Generated Dungeon
- Quests for Quest
- User Interface
Web Basics
- HTML (the basic elements of a web page)
- CSS (how to style web pages)
- SVG (scalable vector graphics)
- Colours
- JavaScript
- Regular Expressions
How-to
Time
- Events (and Turnscripts)
- Date and Time (including custom calendars)
- Timed Events (i.e., real time, not game time)
Items
- Phone a Friend
- Using the USE verb
- Display Verbs
- Change Listeners
- Ensembles (grouping items)
- How to spit
Locations
- Large, open areas
- Region,s with sky, walls, etc.
- Dynamic Room Descriptions
- Transit system (lifts/elevators, buses, trains, simple vehicles)
- Rooms split into multiple locations
- Create rooms on the fly
- Handling weather
Exits
- Alternative Directions (eg, port and starboard)
- Destinations, Not Directions
Meta
- Customise Help
- Provide hints
- Include Achievements
- Add comments to your code
-
End The Game (
io.finish
)
Meta: About The Whole Game
- Translate from Quest 5
- Authoring Several Games at Once
- Chaining Several Games Together
- Competition Entry
- Walk-throughs
- Unit testing
- Debugging (trouble-shooting)
Releasing Your Game
Reference
- The Language File
- List of settings
- Scope
- The Output Queue
- Security
- Implementation notes (initialisation order, data structures)
- Files
- Code guidelines
- Save/load
- UNDO
- The editor
- The Cloak of Darkness
- Versions
- Quest 6 or QuestJS
- The other Folders
- Choose your own adventure