|
|
|
|
Just as a room is a special kind of object, the @dig command (used to build rooms, see the tutorial `Building a Home') is a special case of the @create command (used to build general objects). This tutorial will examine how this command can be used to build a variety of objects, not just rooms. The @create command is used as follows: Syntax: @create <parent-object> named <name,alias1,alias2,...> Examples: @create #5 named lift,elevator @create #5 named lift @create $thing named lift In the first example, a new object named `lift' is created with alias `elevator', and its parent in the object heirarchy is set to #5. In the second example, the object has no aliases other than `lift'. The meaning of `$thing' in the third example will be explained a few pages further on. What sorts of things can be used as the parent object in a @create command? Either * An object you own, or * An object which is *fertile*; that is, if the owner of the object has enabled the object to be freely used as a parent object. If you try to create a child of an object which is neither fertile nor owned by you, then the object will not be created. You can find out more about object permissions in the LambdaMOO Programmer's Manual. Some classes of objects are so common or so important that they have been given special names, beginning with a dollar sign ($). They include: $thing -- Object #5 at Hippo. $container -- Object #8 at Hippo. $note -- Object #9 at Hippo. $letter -- Object #53 at Hippo. You can get a list of other such `generic objects' using the @classes command. Type help @classes for more details. In exactly the same way as with players and with rooms, the name and description of any object can be set by its owner, using the commands @rename <object> to <name,alias1,alias2,...> @describe <object> as <description> @edit <object>.description For examples of how these commands were used for players and rooms, see the tutorials `First Things First' and `Building a Home'. Objects which have the generic object $thing as an ancestor can be taken or dropped by players. Whenever a thing is taken or dropped, messages are displayed to all the players in the room which describe the action from the point of view of the player. For instance, if Mindsurfer were to take the object `silver spoon', and then drop it again, he might see: You take silver spoon. You drop silver spoon. Other people in the same room might see: Mindsurfer takes silver spoon. Mindsurfer drops silver spoon. The messages which are displayed whenever an object is taken or dropped can be set by the owner of the object. Two of these commands are: @take_succeeded <object> is "<message>" @drop_succeeded <object> is "<message>" Examples: @take_succeeded silver spoon is "You pick up the silver spoon." @drop_succeeded silver spoon is "The spoon jangles on the floor." Programmers might be interested to know that these commands change the message strings stored in the properties `take_succeeded_msg' and `drop_succeeded_msg' on the object `silver spoon'. Generally speaking, a message `foo' on an object is stored as a string on property `foo_msg'. To see what messages are defined on a thing, you can use the @messages command: @messages <object> Try the following commands (right now!): @create $thing named silver spoon,ss and then @messages ss Please, though, do NOT try dropping objects here or in any similar tutorial rooms. You won't be able to see the object on the floor, and may never find it again! You should have gotten a response similar to the following: @drop_failed silver spoon is "You can't seem to drop %t here." @drop_succeeded silver spoon is "You drop %t." @odrop_failed silver spoon is "tries to drop %t but fails!" @odrop_succeeded silver spoon is "drops %t." @otake_succeeded silver spoon is "picks up %t." @otake_failed silver spoon isn't set. @take_succeeded silver spoon is "You take %t." @take_failed silver spoon is "You can't pick that up." These messages are fairly self-explanatory --- `take' is what you see when you take, `otake' is what others in the same room see when you take. The only mystery for some may be the symbol `%t' in some of these messages... When designing a message, you might want to write it in such a way that the such information as the name of the object, the name of the player, the appropriate pronouns (eg. her, him, its), are all automatically substituted into the expression when needed. In the example on the previous page, `%t' substitutes for the name of the object on which the message is defined. So "You take %t." would substitute for "You take silver spoon." whenever you take the silver spoon. Substitution is particularly useful when you want your messages to use pronouns correctly. For example, if the message "%n eats %p keyboard." is applied to Mike (a male character), the substitution gives "Mike eats his keyboard." But if it is applied to Hippo (a neuter character), the substitution gives "Hippo eats its keyboard." For a full listing of the substitutions, together with examples, type: help pronouns Containers are things that allow you to store other objects inside them. They can be created using the command @create $container named <name,alias1,alias2,...> Like other objects, you can take and drop containers. You can also: put <object> into <container-object> remove <object> from <container-object> open <container-object> close <container-object> Like other objects, you can change the default messages associated with containers. For a list of these messages, type help container-messages Another attribute which containers have is `opacity', which determines how its contents can be viewed. Syntax: @opacity <container-object> is <integer> If the integer value is 0: the container is transparent and you can always see into it. 1: the container is opaque, and you can only see into it when it is open. 2: the contents of the container can never be seen, even if the container is open. Only the owner of a container (or a wizard) can change the opacity of a container. A note is a thing which can have text written on them, to be read by other people later. They can be created using the command @create $note named <name,alias1,alias2,...> Like other objects, you can take and drop notes. You can also: read <note> Read the text of the note. write "<text>" on <note> Write text on the note. erase <note> Remove all text from the note. delete <line-number> from <note> Remove a line of text from the note. @notedit <note> Edit the text of the note. Like other objects, you can change the default messages associated with notes, and the description and name of the note. For more help regarding notes, type help notes Help is also available for the individual commands listed on the previous page. A letter is a note with the added feature that it can be recycled by anyone who can read it. They can be created using the command @create $letter named <name,alias1,alias2,...> To recycle the letter, the recipient uses the `burn' command burn <letter> One of the hazards of being a builder is that the objects you create can be taken or used by other people without your consent. Books can go missing, or notes and letters not intended for the public can be read by the wrong people. The next tutorial, `Protecting Yourself', will cover ways in which you can improve the security of you and yours. Typing help builder-index will give you a list of topics, most of which you should know about to become a master builder. You might want to start with the following: messages containers thing-messages container-messages rooms exits room-messages exit-messages notes letters |
|
This site is best viewed in 800 x 600, or 1024 x 768. If you find any faults in our page on certain browsers, please report them so we may fix the problem.Copyright © NJO
2001.
|