The Dialog Manual

This is Revision 31 of the Dialog Manual. It describes version 0m of the Dialog language, and version 0.46 of its standard library. Dialog is currently in its beta stage, which means that the language may still undergo significant changes.

Preface

Overview • Structure of the manual • Acknowledgements
The compiler • The interactive debugger • Building from source code

Part I: The Programming Language

Predicates and rules • Printing text • Parameters, objects, and wildcards • Success and failure
Local variables • Values • Unification • Partial lists and recursion
Disjunctions • Backtracking • Multi-queries • Visiting all solutions • Collecting values • Collecting words • Accumulating numbers • Just • Infinite loops
If-statements • Negation • Selecting among variations • Closures • Stoppable environments
Divs, spans, and style classes • Case conversion and inline styles • Status areas • Visualizing progress • Clearing the screen • Input • Hyperlinks • Resources • Debugging • Determining objects from words
Global flags • Per-object flags • Global variables • Per-object variables • Has parent
Access predicates • The current topic • Nested queries in rule heads • Alternatives in rule heads • Automated object generation
Checking the type of a value • Numbers and arithmetic • List-related predicates • Manipulating dictionary words • System control
Story metadata • Interfaces • Runtime errors • Some notes on performance • Limitations and the future of Dialog

Part II: The Standard Library

Architecture of the library • Running the code examples • A minimal story
Populating the game world • Descriptions, appearances, and synonyms • Defining new predicates • Object locations • Dynamic predicates • Hidden objects
Custom traits • Linguistic predicates and traits • Full names • Standard traits for categorizing objects
Pristine and handled objects • Plural forms • All about appearances • Pristineness of nested objects • Clothing
Rooms and map connections • Floating objects • Regions • Light and darkness • Reachability, visibility, and scope • Doors and locks • Moving the player character • Path finding
Introduction to actions • How actions are processed • Stopping and ticking • Instead of: Prevent, perform, after • Narration predicates • Diversion • Refuse and before • Group actions
Core actions • Actions that reveal information • Actions that print a message • Diverting actions • Communication • Navigation • Miscellaneous actions • Debugging actions
Timed code • Cutscenes • The intro • Keeping score • The status bar • Game over • Choice mode
Movement • Other NPC actions • Taking orders • Ask and tell • Choice-based conversation
Grammar definitions • Adding actions • Adjusting the likelihood of actions • Links and default actions • Example: Defining a new action • How the parser works • Custom grammar tokens
Pronouns • List manipulation • Object tree manipulation • Directions and numbers • Predicates for debugging • Common checks and complaints • Asking simple questions • Identical objects