The Dream Maker Designer’S Guide to Worlds BYOND
Total Page:16
File Type:pdf, Size:1020Kb
The Dream Maker Designer’s Guide to Worlds BYOND Dantom Cover illustration by Dan and layout by Pamela Ohsan ISBN 1-890661-17-1 Copyright c 2000 by Dantom All rights reserved Inquiries regarding this book may be directed via email to [email protected]. Comments and corrections are welcome! Printed in the United States of America http://www.dantom.com Contents Foreword xi Preface xiii 1 Meet the Dream Maker 1 2 Navigating the Code Tree 9 2.1 Formatting Code . 10 2.2 Compilation Errors . 10 2.3 Paths in the Tree . 11 2.4 Code Comments . 11 3 Objects in the Tree 13 3.1 Object Properties . 14 3.1.1 Location . 15 3.1.2 Additional Mob Properties . 15 3.2 Assigning Variables . 16 3.2.1 Constant Values . 16 3.2.2 Constant Macros . 17 3.3 Putting It All Together . 18 4 Verbs 19 4.1 Defining a Verb . 19 4.2 Setting Verb Properties . 20 4.3 Verb Accessibility . 20 4.3.1 Explicit versus Implicit Source . 22 4.3.2 Default Accessibility . 22 4.3.3 Possible Access Settings . 23 4.4 Overriding Verbs . 24 4.5 Friendly Arguments . 25 4.5.1 Parameter Input Types . 25 4.6 Generating Output . 27 4.6.1 Variables in Text . 28 iii iv CONTENTS 4.7 Flexibility in Choice of the Source . 28 4.8 A Choice of Arguments . 30 4.9 Default Arguments . 31 4.10 anything inputtype.................................. 31 5 Variables 33 5.1 Global Variables . 33 5.2 Object Variables . 34 5.2.1 Defining An Object Variable . 34 5.2.2 Accessing An Object Variable . 34 5.2.3 The usr and src Variables . 35 5.3 Procedure Variables . 36 5.4 The Life of a Variable . 36 5.5 Constants . 37 5.6 Memory and Variables . 38 6 Procs 39 6.1 Creating a Proc . 39 6.2 Executing a Proc . 40 6.3 Proc Inheritance . 40 6.4 Flexibility of Arguments . 41 6.5 Global Procs . 41 6.5.1 Defining A Global Proc . 42 6.5.2 Calling A Global Proc . 42 6.6 The Procedure Language . 43 6.6.1 Statements . 43 6.7 Return Values . 43 6.7.1 The return statement . 43 6.7.2 The . (dot) variable . 44 6.8 The if statement . 44 6.8.1 The else clause . 45 6.9 Boolean Expressions . 45 6.9.1 Boolean Operators . 45 6.10 Mathematical Operators . 48 6.10.1 Arithmetical Operators . 48 6.10.2 ** the power operator . 49 6.10.3 % the modulus operator . 49 6.10.4 Increment and Decrement . 49 6.10.5 Order of Mathematical Operations . 50 6.11 Bitwise Operations . 50 6.11.1 ˜ the bitwise NOT . 51 6.11.2 & the bitwise AND . 51 6.11.3 | the bitwise OR . 52 6.11.4 ˆ the bitwise XOR . 52 CONTENTS v 6.11.5 Bit Shifting . 52 6.11.6 Order of Bitwise Operations . 52 6.12 Assignment Operators . 52 6.12.1 Combining Other Operations with Assignment . 53 6.13 ? the Conditional Operator . 53 6.14 Dereference Operators . 54 6.14.1 . the “strict” dereference . 54 6.14.2 : the “lax” dereference . 55 6.15 Path Operators . 56 6.15.1 / the parent-child separator . 56 6.15.2 . the look-up path operator . 56 6.15.3 : the look-down path operator . 57 6.16 Order of All Operations . 58 6.17 Loop Statements . 59 6.17.1 for list loop . 59 6.17.2 for conditional loop . 60 6.17.3 while loop ................................... 61 6.17.4 do while loop . 61 6.18 Jumping Around . 62 6.18.1 break and continue statements . 62 6.18.2 goto statement . 62 6.18.3 Block Labels . 63 6.19 switch statement . 64 7 Predefined Object Procs 67 7.1 Movement Procs . 67 7.1.1 Enter ...................................... 68 7.1.2 Exit ....................................... 68 7.1.3 Bump ...................................... 68 7.1.4 Move ...................................... 69 7.2 Object Creation and Destruction . 70 7.2.1 New proc.................................... 70 7.2.2 Del proc .................................... 71 7.2.3 Areas and Rooms . 72 7.3 Stat proc........................................ 73 7.4 Click and DblClick .................................. 74 7.5 Login and Logout ................................... 75 7.6 Topic .......................................... 76 8 The world Data Object 77 8.1 world variables . 78 8.2 world procs....................................... 79 8.2.1 New and Del ................................. 79 8.2.2 Repop proc .................................. 80 vi CONTENTS 8.2.3 Reboot proc.................................. 80 8.2.4 Inter-world Communication . 80 9 The Client Data Object 83 9.1 Client Variables . 83 9.2 Client Procs . 85 9.2.1 Direction Procs . 85 9.2.2 Click proc ................................... 85 9.2.3 Stat proc.................................... 86 9.2.4 Topic proc................................... 86 9.2.5 Import and Export procs . 87 9.2.6 New and Del procs . ..