[[ Editor - I took the liberty of editing this document to read as third person singular to match the others. I also cleaned up spurious characters in a few places. I read the document through so there is no chance meaning changed. I will leave things alone rather than risk changing the meaning. These policies will apply to the complete set. ]] Descartes says: first off... for those who have read the previous texts or for those who were at previous classes, do you have any questions which have come up since then? Frog sighs Kahless says: Not I.. Frog shakes his head Grumpy shakes his head Dagger shakes his head Descartes says: naturally questions with respect to topics covered in those classes? Descartes says: well... for those who have not been involved with the classes to date... here is how the work... Bess appears from the shadows. Bess has rejoined our reality. Bess sighs Descartes says: 1) go over any questions from previous classes... of which there seem to be none Descartes smiles at Bess Descartes says: you missed nothing :) Bess says: thanks :) Frog looks over Bess Descartes says: 2) I will speak on a topic... today is detailed room building Descartes says: 3) we will discuss anything on that topic... questions, ideas, etc Dagger looks at his surroundings. Descartes says: 4) unreleated questions... stuff about what you are currently doing with your areas Descartes says: any questions before we start? Frog shakes his head Bess says: no, not yet Descartes looks at his surroundings. Grumpy says: nope Dagger says: how long till new monster code comes out? Descartes says: monster code will be done with the new combat... it will not affect the way current monsters are coded... more on that later though Dagger nods Frog says: one quick question... Frog says: can wandering monsters use add_action exits in new system? Descartes says: yes? Frog bows to Forlock Dagger bows to Forlock Descartes says: there will be a whole new idea behind the concept of monster Kahless sighs Grumpy smiles at Forlock Descartes says: the short answer to your question is yes Grumpy comforts Kahless sincerly Descartes says: the long answer is that there are no such things as monsters, blah blah blah Frog says: oops. i use add-actions to lock monsters within an area. Descartes says: ok that is for the last section of class though :) Frog nods Descartes says: from the first class, we discussed ewhat made up any sort of LPC object Descartes says: we discussed how a room is not just room.c Descartes says: a room is a container, so it has the properties of container.c Descartes says: a container is an object, and tus inherits Object.c Descartes says: and an Object needs cleaning up, so a room has the functionality of clean_up.c Descartes says: if you have not read the previous class transcript and you were not at the previous classes, this may seem a bit nonsensical to ya Descartes says: to do a quick review, for that reason, I will discuss inheritance again a bit Descartes says: and perhaps others may pick up something I did not discuss before Descartes says: and hopefully everyone can get a chance to read the transcripts in detail and bring some questions to the next class Descartes says: if the idle Nialson will post the transcripts :) Descartes says: at any rate... Descartes says: one of the central things about programming in LPC is the ability to "inherit" the "functionality" of other objects Descartes says: by functionality, I mean do the things that object is capable of doing Descartes says: by inherit, I mean that an object may have its own functionality as well as that of the other object Descartes says: hmm... let me step back a second... Descartes says: who here does not fully 100% understand exactly what a function is? Descartes says: we should discuss that before anything else Bess thinks she does... Descartes says: thinks is not good enough then :) I would like you all to REALLY understand before we go on :) Bess smiles Dagger only thinks too. :( Forlock says: yeah it's the most important thing to grasp in all of LPC Bess nods Descartes says: LPC works by somethithing called a function call Descartes says: a function is simply a set of things for the computer to do which have been grouped together Descartes says: generally the are grouped together to perform a single "function" Descartes says: for example, understand it or not, you have all seen the function create() Bess nods Frog nods Dagger nods Descartes says: the purpose of create is to get an object created in the memory of the computer Descartes says: when you write that function create(), you are writing the part of the function known as the definition Descartes says: in other words, you are writing what create() does Descartes says: create() basically is used in your objects to call other functions Descartes says: calling a function means starting the execution of the definition of it Descartes says: for example, if my create() looks like this: Descartes says: void create() { SetLong("What a thoughtful long!"); } Descartes says: create() is defined to do one and only one thing Descartes says: it simply starts the execution of another function called SetLong() Descartes says: when SetLong() is done, it reaches the end of create() and terminates execution of create() Descartes says: the order in which functions are defined in a file does not matter Descartes says: since a function is executed based on when it is called, not on where it is Descartes says: anyone have any questions so far? Descartes says: by the way, I know a lot fo you are afraid to ask me questions in general... but here ask ANYTHING, even if you think it is stupid Frog shakes his head Descartes says: I am here to help make this clear to you, and if it is not, then I have not done this right and I need to know :) Bess says: what would that command look like to a player? Descartes says: well... the player does not really notice the creation of an object Descartes says: what happens behind the scenes is this.... Descartes says: I will use a room as an example Descartes says: I am going to force you all to more a room really quick Bess says: know, so that would simply begin the process before description..you would have to set attributes to the object next right? Descartes says: cause the mortal here cannot ddo ith without help Frog nods --==** /d/Examples/room/simple.c **==-- #include <std.h> inherit STD_ROOM; void create() { ::create(); SetProperties( ([ "light" : 2, "indoors" : 1 ]) ); SetShort("a plain shack"); SetLong( "Floorboards and walls made of long rotting wood are the " "only features of an otherwise barren shack. The only " "entrance is an opening to the south where a door once " "used to be. Time and the environment must have taken " "it away." ); SetSmell("default", "Mildew fills your lungs, nearly making you sick."); SetListen("default", "The floorboards creak under you as you walk."); SetSmell("mildew", "That really makes you sick!"); SetListen(({ "floorboards", "floorboard" }), "Old and unhappy with your presence, they are crying out."); SetItems( ([ ({ "floorboard", "floorboards" }) : "Be careful where you walk, they are rotting through in places.", ({ "entrance", "opening" }) : "A doorway with no door that leads out into the woods.", "woods" : "The great woods which surround the shack.", "door" : "What door?", "shack" : "An old, abandoned shack." ]) ); SetExits( ([ "south" : "/domains/Examples/room/search" ]) ); } Dagger looks at his surroundings. Descartes says: sorry about the pause there.. trying to alias that last thing to mmake you all more files :) Descartes says: at any rate, if I understood your question right Bess, you were right :) Bess smiles Descartes says: say that the room you see has not been touched by the driver yet Bess sees the light! Descartes says: so the first play to enounter it is about to enter it Bess looks at her surroundings. Descartes says: the driver sees that the room as not yet been loaded into memory Descartes says: 1) it commits the program to memory Descartes says: 2) then calls the function create() in that object to set it up with initital valies Descartes says: 3) then it resumes execution of the command (say "east") the player typed that referenced the room Descartes says: 4) that of course moves the player into the room Descartes says: then the function init() in the room is executed by the driver Descartes says: then the driver moves on to the command of another player Descartes says: in the create of the room I just showed you... Descartes says: does anyone need to see it again? Descartes says: I seem to have ra,mbled on a bit :) Dagger says: I do please --==** /d/Examples/room/simple.c **==-- #include <std.h> inherit STD_ROOM; void create() { ::create(); SetProperties( ([ "light" : 2, "indoors" : 1 ]) ); SetShort("a plain shack"); SetLong( "Floorboards and walls made of long rotting wood are the " "only features of an otherwise barren shack. The only " "entrance is an opening to the south where a door once " "used to be. Time and the environment must have taken " "it away." ); SetSmell("default", "Mildew fills your lungs, nearly making you sick."); SetListen("default", "The floorboards creak under you as you walk."); SetSmell("mildew", "That really makes you sick!"); SetListen(({ "floorboards", "floorboard" }), "Old and unhappy with your presence, they are crying out."); SetItems( ([ ({ "floorboard", "floorboards" }) : "Be careful where you walk, they are rotting through in places.", ({ "entrance", "opening" }) : "A doorway with no door that leads out into the woods.", "woods" : "The great woods which surround the shack.", "door" : "What door?", "shack" : "An old, abandoned shack." ]) ); SetExits( ([ "south" : "/domains/Examples/room/search" ]) ); } Descartes says: create() begins to execute when the room is first loaded Descartes says: the first thing that happens is ::create() is called and executed... more on that one another time :) Descartes says: then the function SetProperties() is called Descartes says: this is a function that is defined inside your inheritance chain Descartes says: that one little line "inherit STD_ROOM" Descartes says: has all the functions defined in the file room.c defined for the object Descartes says: one of the definitions you inherit is SetProperties() Descartes says: SetProperties() does the following: Descartes says: void SetProperties(mapping borg) { __Properties += borg; } Descartes says: that means that whatever properties you defined are added on to whatever properties might laready exist Descartes says: and they are stored in the variable __Properties