LPMuds.net
July 30, 2010, 05:52:48 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: This is the forum page. For the main LPMuds page, visit http://lpmuds.net
 
   Home   SITE FAQ INTERMUD DOWNLOADS LINKS Help Search Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: LPC Tutorial?  (Read 2002 times)
parham
Acquaintance
*
Offline Offline

Posts: 30


View Profile
« on: July 26, 2008, 11:10:49 AM »

Hello,
I was wondering if an LPC tutorial exists. The thing is, the manual is nice, but it is not much practical. It tends to discuss the programming concept of LPC, rather than how-to's. For example, a tutorial that I've seen for another code-base would take you, step by step, with explaination of each step, on a tutorial to create an interactive object, and keep adding new things to the object just for demenstration purposes.
Oh and before I get replies like, (No, the LPC manual has a lot of examples)... yes, it does, but not enough. I mean, it's all good to have all this information about the programming, but I'd rather have a tutorial and referense to this manual when I get to programming issues.
So, is there a tutorial somewhere, or does anyone care about mentoring someone like me throughout the first stages of learning?
Thank you very much.
Logged
Raudhrskal
BFF
***
Offline Offline

Posts: 199


The MUD community needs YOUR help!


View Profile
« Reply #1 on: July 26, 2008, 11:34:38 AM »

"LPC tutorial" and "How to Code in <My Favourite Lib> tutorial" are two separate concepts.
Arguably documents of the first type exists. after all, what more than syntax and basic coding can be in a tutorial for a programming language? Rest is related to "standard" functionality, which is provided by standard library.
It doesn't matter if by "standard library" we mean ANSI libc for C, libstdc++ for c++, or the "standard library" coming with your favourite scripting language. In case of LPC, there is more than one lib, and each one have it's own way of doing things. Many of them come with varying-quiality documentation in /doc (For DS, look in /doc/build first). Others are documented only by their source code. And, because there is no way to write a "portable" creation tutorial, and most of the muds modify the lib to fit their requirements, most often the only way to learn is to try, and keep trying. Read some lib source, find the function you need.  Try to use it. Repeat until you complete your goal. Of course, you always can (and should) ask. If you're coding on your own MUD, get on intermud and ask. If you're coding for someone else, ask him.
Logged

I think, therefore i may be wrong.
Please note that if you met a Raudhrskal in a place that's not related to muds, it wasn't me. *sigh*... back when I started there was zero hits on google for that name...
daelaskai
BFF
***
Offline Offline

Posts: 168


View Profile
« Reply #2 on: July 27, 2008, 03:03:34 AM »

I agree.  I think it's easier to just "dig in and get your hands dirty".  I started learning LPC by reading through
every bit of code from Dead Souls.  I didn't stop there, however.  I looked through other mudlibs such as
Discworld, OSBlib, Merentha, TMI-2, Lpuni/Sapidlib, etc....  All have their own way to do things and most
require a little porting to work on another mudlib.

Dead Souls has a good help file that Raudhrskal mentioned in /doc/build, however there is also the example
domain that has, in my opinion, well-commented examples of creating rooms and doing simple things to
start learning.  I recommend that you read through it.

Of course, always remember to ask for help when you need it, like Raudhrskal stated.  There is a wealth of
knowledge on Intermud and you'll find that each person has their "preferred" method to do the same thing.
Try each idea that you are presented and see how YOU like it.  Keep in mind that if you are coding for
someone else's MUD, it is better that you ask them ultimately since it is THEIR MUD and they may have
set standards that you need to follow.

Daelas
Logged
parham
Acquaintance
*
Offline Offline

Posts: 30


View Profile
« Reply #3 on: July 27, 2008, 04:27:10 PM »

Oh, thank you. What I was not thinking at the time was that how much I was used to having a codebase that doesn't have libs like LPC. Although it is as confusing as Linux distros for Windows users, if you get a lib and find out how to do things in it, it would be just as good as finding a Linux distro to suit your needs and use it instead of Windows. At any rate, thank you for making me realize that.
Logged
saquivor
BFF
***
Offline Offline

Posts: 109



View Profile
« Reply #4 on: July 28, 2008, 12:10:05 PM »

Hi,

Your post has got me thinking that I will add some elements to the GUI building tool that I am working on that could act as an LPC style tutorial.

ie I could have a premade template for an object like a Statue, that can be then be extended by adding a lock/container to the statue etc. The advantage of the GUI tool, would be that you could start with an empty room, and then add objects to it, and it would clearly show what code has been added your empty room etc. Even the room itself would be a template that would be added to an empty file Smiley

The other element I am working on is looking at ways to show the properties of various objects/ lib items so that it would make it easier to see what properties can be used against various objects on the lib.

All I need now is time Smiley

Saq
Logged
parham
Acquaintance
*
Offline Offline

Posts: 30


View Profile
« Reply #5 on: September 02, 2008, 11:09:49 AM »

The fact is, most of these are actually teaching one more about building rather than coding. I can build a room and I can make an object, but I can't make it respond to a certain command, for example. Or worse than that, I can't add a command the player could use. These are the main things... *cough*
Logged
Xzystance
Acquaintance
*
Offline Offline

Posts: 29


View Profile
« Reply #6 on: September 02, 2008, 10:20:50 PM »

I dunno. I've found that adding commands and what not, the easiest way to do it is to look at the files for already existing commands and pay some attention to how they are written. I found that i've learned more about the code by looking at what is already written. Reverse engineering is fun Smiley.

X

P.S. Saq, I'm looking forward to seeing that tool of yours that your building Smiley Lemme know if you want a guinnea pig Smiley
Logged
Krebsy
Acquaintance
*
Offline Offline

Posts: 5


View Profile
« Reply #7 on: November 23, 2008, 03:21:21 PM »

I'm looking for something similar whilst I help get a test mud set up.  I've been an infrequent visitor to Deeper Trouble MUD since 1993 (and used to play intensively) but when it comes to LPC coding (and using things like the QCS) then it's all gone out of my head.  That, and I need to get a good editor as ed is a bit pants....
 
I could really do with a shortlist/chat sheet of object types, classes and variables/parameters.

so for instance, for an NPC, that parameters can I set I.e. Melee, level, hitponts and what the parameter names are.  (using QCS at the moment before I can delve into the code further).

Also, any thoughts on comaprative levels?  I.e setting up 2 npc's at level 10 and setting them off against each other doesn't appear that they do much damage to each other so I guess it's all releative.  However, if I boost one up to melee 20 & level 20 then it doesn't appear to make a difference with both NPC's still being terrible at hitting each other.

Any thoughts on item masses?  how can I calculate the max. carrying capacity of something so I can set the item weights relatively? 

the only thing I need on top (for the moment) is how to get NPC's to emote and move around every now and again (wandering monsters Smiley ).

Ta,

K.
Logged
cratylus
Your favorite and best
Administrator
***
Offline Offline

Posts: 904


Cratylus@Dead Souls <ds> np


View Profile WWW
« Reply #8 on: November 23, 2008, 04:55:37 PM »

Quote
so for instance, for an NPC, that parameters can I set I.e. Melee, level, hitponts and what the parameter names are.

The most common directives along these lines are
shown in the output of: help modify

For step by step instructions on typical building
concepts, the Creator's Manual is helpful. It's
available in-game and also online at: http://dead-souls.net/doc/manual/


Quote
Also, any thoughts on comaprative levels?  I.e setting up 2 npc's at level 10 and setting them off against each other doesn't appear that they do much damage to each other so I guess it's all releative.  However, if I boost one up to melee 20 & level 20 then it doesn't appear to make a difference with both NPC's still being terrible at hitting each other.

DS combat is affected by level only indirectly. Combat
effectiveness is dictated by *skill*. If unarmed and
non-melee, characters won't hurt each other much. But
if they wield swords and have high "blade attack" skill
levels, it'll be a bloodbath.

Player levels tend to increase skill levels. But without
the skill levels in the first place, the combat will
be as you saw: a lot of swing and miss. If you want them
to be tough fighters, make their class "fighter".

As to comparative levels, that's entirely up to you. You
have to experiment and decide what suits you for your mud.
Other people's guesses won't be a lot of use, I think.

Quote
Any thoughts on item masses?  how can I calculate the max. carrying capacity of something so I can set the item weights relatively?

Roughly speaking, I think of mass units being one tenth
of a pound, so an object with a mass of 100 weighs ten
pounds. This is a rough idea, and many objects violate
this in one way or another, but it's a general rule of
thumb I've found useful.

Quote
the only thing I need on top (for the moment) is how to get NPC's to emote and move around every now and again (wandering monsters Smiley ).

Make sure it inherits LIB_SENTIENT rather than LIB_NPC.
For wandering, the directive:

SetWanderSpeed(1);

Will make it move around very quickly. For slower movement,
increase the number. For details on this, and how to
make them respond to things, refer to the Sentients chapter in the manual:

http://dead-souls.net/doc/manual/chapter26

To make them occasionally do random sets of things, see
the NPC's chapter in the manual:

http://dead-souls.net/doc/manual/chapter22

-Crat
Logged
Yarp
Acquaintance
*
Offline Offline

Posts: 8


View Profile
« Reply #9 on: November 23, 2008, 06:02:40 PM »

The problem, as far as I can see, is that the general driver-specific efun documentation hasn't been updated since ... well, forever.  If you even look at the fluffos changelogs, lots of stuff has changed, including arguments to various functions, none of which is documented outside of posts in the driver forum.

An updated LPC manual would be nice, but what would be nicer is something that bridges the gap between the docs directory included in the latest MudOS tarball (that are what, nearly a decade old?) and whatever has changed since FluffOS branched.  I mean hell, I don't even think the new heartbeat changes are documented anywhere, and that's one that that really, really should be spelled out in gigantic letters somewhere.

I looked into doing it myself, but I don't really have the time to dig through MudOS and figure out how everything works when it should have all just been documented from the get go and included in the tarball (no offense to wodan and the other contributors, as I'm glad at least someone is keeping MudOS alive).
Logged
Krebsy
Acquaintance
*
Offline Offline

Posts: 5


View Profile
« Reply #10 on: November 23, 2008, 08:30:13 PM »

Cheers for the pointers Crat,  I'll pour through the texts Smiley

K.
Logged
Krebsy
Acquaintance
*
Offline Offline

Posts: 5


View Profile
« Reply #11 on: November 26, 2008, 02:58:27 PM »

I don't suppose there's a zip file somewhere with all the manual in it?  Something I could grab so I could work on code off-line and upload it later (with Creweb)?

K.
Logged
agrippa
Acquaintance
*
Offline Offline

Posts: 21


View Profile
« Reply #12 on: November 26, 2008, 03:33:40 PM »

Go to www.dead-souls.net and download one of the releases there.  That should include all the documentation.
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!