LPC
The LPmud programming language
Edition pre-3.08
July 2001
by Ronny Wikh (
rw@cd.chalmers.se
)
Copying Conditions
Introduction
i - Acknowledgments
ii - Tutorial Setup
iii - History of LPC
iv - Gamedriver/Mudlib
v - Administrative Setup
vi - Writing code
LPC basics
Basic programming concepts
What is programming?
Compiled/Interpreted code
Programs
Objects
Object makeup
Basic LPC
Comments
Data types
Variable declarations
Function declarations
Statements and Expressions
Statements
Expressions
The block statement
The ; statement
Scope and prototypes
Operator expressions
Miscellaneous operators
Arithmetic operators
Boolean operators
Conditional (logical) operators
Comparative operators
Prefix allocation
Conditionals
The if/else statement
The switch statement
The ?: expression
Precedence and Order of evalutaion
Loop statements
The for statement
The while statement
The break and continue statement
Arrays and Mappings
How to declare and use arrays
How to declare and use Mappings
The preprocessor
The #include statement
The #define statement
The #if, #ifdef, #ifndef, #else and #elseif statements
Essential LPC and Mudlib
Peeking at things to come
LPC revisited
Function calls
Making object-internal function calls
Making single object-external function calls
Making multiple object-external function calls
Inheriting object classes
Masking functions in runtime, part 1
Type identification
Type qualifiers
The static variable qualifier
The static function qualifier
The private function/variable qualifier
The nomask function/variable qualifier
The public function/variable qualifier
The varargs function qualifier
The function data type, part 2
switch/case part 2
catch/throw: Error handling in runtime
Array & Mapping references
LPC/Mudlib interafce
Definition of standard and library objects
The base object class, /std/object.c
Standard object classes
Standard library objects
How to obtain object references
Object references relative to the current object
Creating objects
Finding references relative to another object
Object references to interactive objects
Destroying objects
Object-inherent command handling
Alarms: Asynchronous function execution
The inventory and the environment
String functions
Bit functions
Time functions
Array/string conversion
Array functions
Mapping functions
Type conversion
Math functions
File handling
Directory handling
Screen input/output
Some mud commands
Compile and load an object into gamedriver memory
Compile, load and clone an object to the game
Destroy a cloned object
Update a loaded object
The Tracer tool
Perform a command in the environment of a player
Call a function in an object
Cat the file associated with an object
Destroy all non-interactive objects in an object
Destruct a specific object
Print information about an object
Ed the file associated with an object
Enter the inventory of an object
Perform a command in another object
More the file associated with an object
Move an object to a destination
Set a tracer variable
Update, load, clone and replace an object
Tail the file associated with an object
Advanced LPC and Mudlib
Function data type, part 3
The basics of the function type
Partial argument lists
Complex function applications
How to parse player commands
Masking functions in runtime, part 2
Writing efficient code
Efficient loops
Abusing defines
Traps and pitfalls
Mapping/Array security
Alarm loops
Internal documentation
LPC Index
Efun/Sfun Index
Lfun/Macro Index
Type Index
Command Index
This document was generated using a modified
texi2html
translator version 1.42.