262x Filetype PDF File size 0.75 MB Source: discworld.atuin.net
LPC For Dummies
Book One
Michael Heron
(drakkos@discworld.atuin.net)
Beta Draft
LPC For Dummies 1, Second Edition
Table of Contents
Mojo The Monkey Says.......................................................................................................................5
Willkommen! Bien Venue! Welcome! ...............................................................................................6
Introduction .....................................................................................................................................6
The Learning Scenario.....................................................................................................................6
The Structure of the Game ..............................................................................................................7
Programming as a Concept .............................................................................................................8
It's All Down To You....................................................................................................................11
Conclusion.....................................................................................................................................12
My First Room...................................................................................................................................13
Introduction ...................................................................................................................................13
Your Own Learnville.....................................................................................................................13
The Basic Template.......................................................................................................................14
Now, what does all of that mean? .................................................................................................15
My Room Sucks.............................................................................................................................16
It's a little too quiet........................................................................................................................17
A Second Room ............................................................................................................................18
Our Overall Plan ...........................................................................................................................19
Property Ladder ............................................................................................................................20
Conclusion ....................................................................................................................................21
My First Area.....................................................................................................................................22
Introduction ...................................................................................................................................22
The Structure .................................................................................................................................22
Exits and Maintainability ..............................................................................................................24
Our Exitses ....................................................................................................................................26
Chain, chain, chain... .....................................................................................................................29
Conclusion ....................................................................................................................................31
Building The Perfect Beast.................................................................................................................32
Introduction ...................................................................................................................................32
A First NPC ..................................................................................................................................32
Breathing Life Into The Lifeless ...................................................................................................34
Cover Yourself Up, You'll Catch A Cold .....................................................................................37
Request Item..................................................................................................................................40
Chatting Away ..............................................................................................................................41
Conclusion ....................................................................................................................................42
Hooking Up........................................................................................................................................43
Introduction ...................................................................................................................................43
The Path.h Problem .......................................................................................................................43
Sorted!............................................................................................................................................45
If At First You Don't Succeed ......................................................................................................47
Compound Interest ........................................................................................................................50
Moving ..........................................................................................................................................51
One Final Touch ...........................................................................................................................53
Conclusion ....................................................................................................................................53
Back To The Beginning......................................................................................................................55
Introduction ...................................................................................................................................55
Captain Beefy's Return .................................................................................................................55
Michael Heron Page 2
LPC For Dummies 1, Second Edition
The Road Less Travelled ..............................................................................................................56
Bigger, Better, Faster ....................................................................................................................58
Probing Dark Depths ....................................................................................................................59
The Taskmaster .............................................................................................................................60
Switching Things Around .............................................................................................................62
Scoping Things Out ......................................................................................................................63
Conclusion ....................................................................................................................................65
Now That We're An Item...................................................................................................................66
Introduction ...................................................................................................................................66
Virtually Self-Explanatory ............................................................................................................66
But what does it all mean? ............................................................................................................69
Beefy's Boots ................................................................................................................................70
Bling ..............................................................................................................................................71
A Word Of Warning About Items ................................................................................................73
Conclusion ....................................................................................................................................73
An Inside Job......................................................................................................................................74
Introduction ...................................................................................................................................74
The Mysterious Room ..................................................................................................................74
Modifying Exits ............................................................................................................................75
Shop 'Till You Drop ......................................................................................................................78
Stabby Joe .....................................................................................................................................80
Conclusion ....................................................................................................................................81
Dysfunctional Behaviour....................................................................................................................82
Introduction ...................................................................................................................................82
Our Task .......................................................................................................................................82
The Science Bit... Concentrate! ....................................................................................................82
The Structure of a Function ..........................................................................................................84
A Little Bit More... .......................................................................................................................86
Function Scope .............................................................................................................................87
Onwards and Upwards!.................................................................................................................88
Violence Begets Violence .............................................................................................................91
A Local Shop For Local People ....................................................................................................94
Conclusion ....................................................................................................................................95
Going Loopy.......................................................................................................................................96
Introduction ...................................................................................................................................96
A Basic Pub ..................................................................................................................................96
Grumpy Al ....................................................................................................................................97
Grumpy Al Goes Ballistic ...........................................................................................................100
Components ................................................................................................................................101
Loops ..........................................................................................................................................104
Doing While... .............................................................................................................................105
For Loops.....................................................................................................................................106
Fire in the Hole! ..........................................................................................................................108
Conclusion ..................................................................................................................................109
Arrays, You say?..............................................................................................................................110
Introduction .................................................................................................................................110
Slicey Pete ...................................................................................................................................110
The Array ....................................................................................................................................113
Array Indexing ............................................................................................................................115
Michael Heron Page 3
LPC For Dummies 1, Second Edition
Array management.......................................................................................................................116
Setting Up Stock, LPC Style .......................................................................................................117
The Foreach Structure .................................................................................................................119
Conclusion ..................................................................................................................................119
Hooray for Arrays.............................................................................................................................121
Introduction .................................................................................................................................121
A Secret To Be Discovered ........................................................................................................121
Item Matching .............................................................................................................................123
A Grue Some Fate! .....................................................................................................................126
Getting To Our Shop Of Horror .................................................................................................130
Conclusion ..................................................................................................................................131
Mapping It Out.................................................................................................................................133
Introduction .................................................................................................................................133
The Mapping ...............................................................................................................................133
The Magic Hate Ball ...................................................................................................................136
More Mapping Manipulation, Matey ..........................................................................................140
Conclusion ..................................................................................................................................142
So Long............................................................................................................................................143
Introduction .................................................................................................................................143
The Past .......................................................................................................................................143
The Present .................................................................................................................................145
The Future ...................................................................................................................................146
Conclusion ..................................................................................................................................146
Reader Exercises..............................................................................................................................147
Introduction..................................................................................................................................147
Exercises......................................................................................................................................147
Send Suggestions.........................................................................................................................149
Michael Heron Page 4
no reviews yet
Please Login to review.