external next up previous contents index
Next: 4.3 Construction with @create Up: 4.2 Rooms and exits Previous: Customizing your room

Advanced building


Advanced building basically means 2 things, you can:

  1. Customize messages on rooms and exits, to make actions more lively
  2. Change the ``parent'' of your room (which is $room on most rooms into a more fancy kind of room. If you are inside the room you want to change, type: @chparent here to #xxx. See chapter 6 for details on some fancy available rooms at TECFAMOO. We suggest that beginner should start using Ken's Generic Classroom (not just for building virtual classrooms). It is available in most ``serious'' MOOs and relatively easy to customize (see section 6.2).

Customizing messages

(ok this section needs some better writing, I know!!)

By customizing messages (not just on rooms and exits) you can create your scenery much more ``lively''. Here is an example:

 You stumble over some open boxes into Daniel Schneider's Office

Other persons in the room would have seen:

 MooBoy makes a shrieking sound when he enters office #17

To learn more about messages, consult the internal MOO help, e.g. type:

help @messages
help messages

          the messages on objects that can contain other objects
          the messages on exit objects
          the messages on objects that can be taken and dropped

Pronouns and other substitutions

Since help about using pronouns is quite long, we include the in-MOO help about that topic here. Pronouns are useful for referring in more natural way to people in messages. You can use pronouns in a lot of situations, e.g. to customize messages on yourself, on your rooms and on exits.    

>help pronouns

Some kinds of messages are not printed directly to players; they are
allowed to contain special characters marking places to include the
appropriate pronoun for some player.  For example, a builder might
have a doorway that's very short, so that people have to crawl to get
through it.  When they do so, the builder wants a little message like
this to be printed:

        Balthazar crawls through the little doorway, bruising his knee.

The problem is the use of 'his' in the message; what if the player in
question is female?  The correct setting of the 'oleave' message on
that doorway is as follows:

        "crawls through the little doorway, bruising %p knee."

The '%p' in the message will be replaced by either 'his', 'her', or 'its',
depending upon the gender of the player.  

As it happens, you can also refer to elements of the command line
(e.g., direct and indirect objects) the object issuing the message,
and the location where this is all happening.  In addition one can
refer to arbitrary string properties on these objects, or get the
object numbers themselves.

The complete set of substitutions is as follows:

        %% => `%'  (just in case you actually want to talk about percentages).
        %n => the player
        %t => this object (i.e., the object issuing the message,... usually)
        %d => the direct object from the command line
        %i => the indirect object from the command line
        %l => the location of the player
        %s => subject pronoun:          either `he',  `she', or `it'
        %o => object pronoun:           either `him', `her', or `it'
        %p => posessive pronoun (adj):  either `his', `her', or `its'  
        %q => posessive pronoun (noun): either `his', `hers', or `its'
        %r => reflexive pronoun:  either `himself', `herself', or `itself'
    General properties:
        %(foo) => player.foo 
        %[tfoo], %[dfoo], %[ifoo], %[lfoo]
               => this.foo, dobj.foo, iobj.foo, and player.location.foo
    Object numbers:
        %#  => player's object number
        %[#t], %[#d], %[#i], %[#l]
           => object numbers for this, direct obj, indirect obj, and location.

In addition there is a set of capitalized substitutions for use at the 
beginning of sentences.  These are, respectively, 

   %N, %T, %D, %I, %L for object names, 
   %S, %O, %P, %Q, %R for pronouns, and
   %(Foo), %[dFoo] (== %[Dfoo] == %[DFoo]),... for general properties

Note: there is a special exception for player .name's which are assumed to
already be capitalized as desired.

There may be situations where the standard algorithm, i.e., upcasing
the first letter, yields something incorrect, in which case a
"capitalization" for a particular string property can be specified
explicitly.  If your object has a ".foo" property that is like this,
you need merely add a ".fooc" (in general .(propertyname+"c"))
specifying the correct capitalization.  This will also work for player
.name's if you want to specify a capitalization that is different from
your usual .name

Rog makes a hand-grenade with a customizable explode message.
Suppose someone sets grenade.explode_msg to:

  "%N(%#) drops %t on %p foot.  %T explodes.  
   %L is engulfed in flames."

If the current location happens to be #3443 ("yduJ's Hairdressing Salon"),
the resulting substitution may produce, eg.,

  "Rog(#4292) drops grenade on his foot.  Grenade explodes.  
   YduJ's Hairdressing Salon is engulfed in flames."

which contains an incorrect capitalization.  
yduJ may remedy this by setting #3443.namec="yduJ's Hairdressing Salon".

Note for programmers:  
 In programs, use $string_utils:pronoun_sub().
 %n actually calls player:title() while %(name) refers to player.name directly.

Daniel K. Schneider
Thu Apr 17 12:43:52 MET DST 1997