PDA

View Full Version : Who here knows LPC?


Tharrick
06-01-2006, 19:18
I don't! But I can manipulate the existing stuff!

LPC is the code used to make many MUD games, mostly text-based, and it looks a little like this:


inherit "/std/room/inside";

void setup() {

set_short("a laboratory");
set_long("A fairly well-lit laboratory, and well-stocked too, with benches covered in complicated-looking glassware

and assorted tools and instruments.\n");

add_item("light", "The lights in this part of the lab are all on, and very few of them are flickering - clearly well

maintained.");
add_item("walls", "This was once clean, sterile white plaster. Now, it's more of a shabby grey, with spots of mould

and the occasional stain.");
add_item("glassware", "Complicated chemical and biological glassware, some of which still have fluid in.");
add_item(({"instruments", "tools"}), "All kinds of instruments adorn the benches here, including spectrophotometers,

and a few microscopes.");
add_item("spectrophotometer", "A large box with a flap on it and a readout - the flap is opened to insert a sample,

while the digital readout provides an accurate reading of the absorbance of the sample.");
add_item(({"microscope", "microscopes"}), "A fairly simple light microscope, for viewing cell samples. One or two

have a sticky reddish liquid on the eyepieces - they could do with a bit of a clean.");
add_item("towel", "This green-and-blue striped towel is hanging on the door and obscuring the view through the

windows.");
add_item(({"windows", "window"}), "There are small windows set in the doors. By twitching aside the towel, it's

possible to look down the corridor. It's too dark out there to actually see anything, but at least you made the effort.");
set_light(70);
add_exit("north", "/d/lab/lab2", "path", ({
"description", "further into the laboratory"}));
add_exit("northeast", "/d/lab/lab3", "hidden");
add_exit("east", "/d/lab/lab4", "path", ({
"description", "further into the laboratory"}));
add_exit("south", "/d/lab/corridor5", "door", ({
"description", "lab exit",
"door short", "laboratory exit door",
"door long", "These large double-doors have windows set in the middle. The view would be better, if it

wasn't for the towel hanging on a hook on one of the doors."}));
}


This is part of a practice area for a game I'm working on. While the practice area is full of zombies, the actual game isn't - zombies are just a good theme for practice :P
set_long is what the player sees when they first enter the room, while add_item is what they can see if they look at those specific items.
It's a great language.

Grae
06-01-2006, 19:27
looks fairly simple to me :P I mean compared to o ther programming languages there's really not that much to it is there?

Tharrick
06-01-2006, 21:27
*shrugs* I don't do the actual code part, myself, but it's a lot more complicated than that. There's essentially a library of commands, such as set_long (which sets the 'long' description for any object when it's looked at in detail) and others, but it's also the code on which the game itself actually runs.
I'm just a builder for this game, which means I use the pre-made commands, rather than a coder, who's responsible for coding in the actual commands - basically, I write the set_long for each room or item, while the coder makes the system know what set_long is supposed to do.

Hideto
06-01-2006, 22:05
hah can't be any worse than C++ man, that gave me a headache. I got it in the end though. pity i haven't done any in a while so i've forgotten a lot =P

Dr. Aeyze
06-01-2006, 22:37
Damnit, reading over that really makes me want to start playing my old favourite MUD again ;__;

Tharrick
06-01-2006, 23:06
Well, if you can wait for a bit (like a year :P)
our MUD will be up and running

Mattlab
10-03-2006, 00:02
Interesting I have never heard of this programming language.