Alan Adventure System V3.0
Total Page:16
File Type:pdf, Size:1020Kb
The ALAN Adventure Language Reference Manual Version 3.0beta2 Alan Adventure System - Reference Manual This version of the manual was printed on September 26, 2011 - ii - Alan Adventure System - Reference Manual Table of Contents 1 INTRODUCTION.........................................................................11 1.1 Programmer’s Pitch........................................................................................................12 1.2 To the Reader.................................................................................................................12 2 CONCEPTS......................................................................................13 2.1 What Is An Adventure?................................................................................................13 2.2 Elements Of Adventures.................................................................................................15 2.3 Alan Fundamentals.......................................................................................................16 What Is A Language?....................................................................................................................................16 The Alan Idea..................................................................................................................................................18 What’s Happening?........................................................................................................................................18 The Map..........................................................................................................................................................19 The Things.......................................................................................................................................................19 Other People and Monsters.............................................................................................................................20 Acting..............................................................................................................................................................20 The Input........................................................................................................................................................20 2.4 Introduction to the Language.........................................................................................21 Notation...........................................................................................................................................................21 The Locations...................................................................................................................................................22 The Objects......................................................................................................................................................24 The Actors.......................................................................................................................................................27 Inheritance and Object Orientation..................................................................................................................27 Inheritance and Instances...............................................................................................................27 Polymorphism.................................................................................................................................28 Every and The................................................................................................................................28 The Pre-defined Classes...................................................................................................................29 Creating Classes and Instances........................................................................................................29 Specialising and Overriding.............................................................................................................30 The Verb Construct..........................................................................................................................................31 - iii - Alan Adventure System - Reference Manual Checking Things..............................................................................................................................32 The Syntax......................................................................................................................................................33 Text Output Formatting..................................................................................................................................35 3 LANGUAGE REFERENCE.........................................................37 General Rules..................................................................................................................................37 3.1 An Adventure.................................................................................................................38 3.2 Options..........................................................................................................................39 3.3 Types.............................................................................................................................40 Basic, Simple and Compound Types................................................................................................................41 Instance Type...................................................................................................................................................41 Event Type......................................................................................................................................................42 Set Type..........................................................................................................................................................42 Type Compatibility..........................................................................................................................................43 Type Requirements..........................................................................................................................................43 3.4 Import..........................................................................................................................44 3.5 Classes............................................................................................................................45 Inheritance......................................................................................................................................................45 3.6 Instances.......................................................................................................................46 Entities.............................................................................................................................................................47 Things.............................................................................................................................................................48 Objects.............................................................................................................................................................48 Actors..............................................................................................................................................................48 The Hero.........................................................................................................................................49 Locations..........................................................................................................................................................50 Literals..............................................................................................................................................................51 3.7 Properties........................................................................................................................51 Inheriting Properties........................................................................................................................................52 Initial Location................................................................................................................................................54 Names.............................................................................................................................................................54 Inheriting Names............................................................................................................................56 Displaying Instances.......................................................................................................................56 Pronouns.........................................................................................................................................................57 - iv - Alan Adventure System - Reference Manual Attributes.........................................................................................................................................................58 Boolean Attributes..........................................................................................................................59 Numeric and String Attributes.......................................................................................................59