/
lib/banish/
lib/d/coronos/
lib/d/coronos/w/alena/
lib/d/coronos/w/angel/
lib/d/coronos/w/angel/caves/
lib/d/coronos/w/angel/caves/monst/
lib/d/coronos/w/angel/city/chambers/
lib/d/coronos/w/angel/city/monst/
lib/d/coronos/w/angel/city/obj/
lib/d/coronos/w/angel/city/streets/
lib/d/coronos/w/angel/farms/plains/
lib/d/coronos/w/angel/monst/
lib/d/tempus/
lib/d/tempus/w/angel/
lib/d/tempus/w/kingbill/
lib/d/tempus/w/mirak/
lib/d/tempus/w/mirak/monst/
lib/d/tempus/w/mirak/obj/
lib/d/tempus/w/relgar/planes/baat/
lib/d/tempus/w/sarak/
lib/d/tempus/w/serepion/mon/
lib/d/tempus/w/valrejn/
lib/doc/
lib/doc/domains/
lib/doc/efun/
lib/include/fn_specs/
lib/info/
lib/inherit/base/
lib/log/
lib/log/mailbox/
lib/log/main/
lib/news/
lib/obj/party/
lib/objects/componen/
lib/open/
lib/open/party/
lib/open/paste/
lib/open/spells/
lib/open/valrejn/
lib/players/
lib/players/alena/
lib/players/alena/obj/
lib/players/alena/open/
lib/players/alena/private/
lib/players/angel/
lib/players/angel/obj/
lib/players/ash/
lib/players/biggs/
lib/players/biggs/food/
lib/players/biggs/gobkeep/
lib/players/biggs/mnstr/
lib/players/biggs/town/caves/
lib/players/biggs/town/tower/
lib/players/biggs/wpns/
lib/players/calris/
lib/players/deathurg/
lib/players/deathurg/open/
lib/players/deathurg/private/thief/
lib/players/dogberry/
lib/players/dogberry/library/
lib/players/dogberry/open/
lib/players/epsilon/
lib/players/epsilon/private/
lib/players/farewell/
lib/players/hippo/
lib/players/hippo/open/
lib/players/hippo/tools/
lib/players/jimpa/
lib/players/josh/
lib/players/josh/room/
lib/players/josh/room/mage/dungeon/
lib/players/josh/room/mage/dungeon/obj/
lib/players/josh/wep/
lib/players/kingbill/
lib/players/metatron/
lib/players/miette/
lib/players/mirak/
lib/players/mirak/open/
lib/players/parsilan/
lib/players/relgar/
lib/players/relgar/private/
lib/players/sarak/
lib/players/sarak/bugs/
lib/players/sarak/feelings/
lib/players/sarak/magical/
lib/players/sarak/minotaur/island/
lib/players/sarak/open/
lib/players/sarak/private/
lib/players/serepion/
lib/players/serepion/open/
lib/players/serepion/private/
lib/players/spike/
lib/players/spike/open/
lib/players/spike/private/
lib/players/spike/seaworld/
lib/players/valrejn/
lib/players/valrejn/open/
lib/players/valrejn/private/
lib/players/virus/
lib/players/wrath/
lib/players/wrath/arm/
lib/players/wrath/mon/
lib/players/wrath/room/
lib/players/wrath/room/entry/
lib/players/wrath/room/zolgath/
lib/players/wrath/weap/
lib/players/zil/
lib/room/
lib/room/city/arena/
lib/room/city/creator/
lib/room/city/garden/monst/
lib/room/city/library/
lib/room/city/library/open/books/
lib/room/city/shop/
lib/room/death/
lib/room/death/open/
lib/room/island/
lib/room/keeps/
lib/room/registry/
lib/room/ships/crew/
lib/room/ships/open/
lib/room/ships/open/types/bounty/
lib/room/ships/open/types/nebula/
lib/room/ships/open/types/phoenix/
lib/secure/udp_cmd_/
lib/skills/
lib/skills/fighter/
lib/skills/psionici/
lib/skills/thief/
lib/usr/
lib/usr/creators/
lib/usr/no_banis/
lib/usr/players/
                 -=[ LPC Basics ]=-

Introduction:

The purpose of this document is to introduce to the new wizard
the basic concepts of LPC coding. My experience has shown that
there is a large number of wizards who are able to use
configurable object files (room, armour, weapon, etc), but
have little idea on why, or what they are coding.

The examples shown are in my coding style, which is one of a
number I have seen. I will also be coding using strict types,
as this is more correct. I hope I don't make too many typo's
in the lpc examples.



LPC mud structure:

LPC is object orientated. A sword is a complete "object",
entirely separate from all other code. Actions are an
interaction between one object and another. A player is
interactive action between the object player and other
objects. A room is an object, A player is an object placed in
the room object, A sword is an object in the player object in
the room object. You might already summise that you need
particular functions that allow you to find the position of an
object, and interaction between objects.

Though not strictly true I will I will call the source file,
the object. This is more convenience then anything else.



Objects:

The most basic object is created from a source file which is
empty (0 bytes). This of course would do nothing. There are a
number of "standard" functions, if placed in an object will
allow it to interact with the "player" object. But before we
can look at this you must understand some basic LPC language.
I am going to work on the assumption that you have only very
basic concepts of programming, programming algorithims, and 
the language C.



Language:

LPC is a 'block-structured' language, and like
Kernighan/Ritchie C, was developed for the UNIX. The game
parser is usually compiled on FSF's GNU g++. That is why
LPCMuds use a unix style file, and directory system. Though
there are those trying to port it to other platforms with a
minimum of success. 



Debugging at home:

For those with micros at home, there is an amiga port
available by anonymous ftp at "ftp.cd.chalmers.de"; I have
never used it. There is a Msdos port that needs a minimum of a
386-sx. It is found at "ftp.ccs.neu.edu" (ok312exe.exe,
ok312lib.exe). I have used this, it is good for debugging (and
it won't run via a net...so forget about tryiny to start your
own mud on an msdos platform - Why bother ;) ). Though I have
found it tends to scramble files occasionally. 



Editor:

LPCMud has an on-line line editor. Unless the administrator of
your mud has a large and fast machine, you will not see a VI
editor on a mud. If you want this, then code it at home or on
the PC. I personally use wordperfect (text-out), and use the
file insert mode of the telnet application, or ftp if the mud
has such a facility.



Basic editor usage:
  
ed file.c  open a file for writing in your current directory 
:          prompt symbol.
i          start writing to file line above current line
.          return to prompt
Q          quit without saving
x          quit and save file
d          delete current line
2,4d       delete from line 2 to 4
2,4m10     move lines 2 to 4, to line 10
h          help
z          page through next 20 lines
4          goto line 4, etc
-2         go back 2, etc lines
/example   search for the text "example"



Loading source files:


update <object>   

if object loaded in memory, remove it. You should update an
object if you make any changes to a source file. Then try to
load it.


load <file>       

load object into memory. Failure to do so will produce an
error that is logged into /log/lower_case_your_name. I
personally make an alias on my quicktyper, "error". (alias
error tail /log/your_lower_case_name).


clone <filename>    make a clone of an object

dest <object>       destruct a clone object