external next up previous contents index
Next: Creating a property "holding" Up: 8.4 MOO tutorialLevel Previous: 8.4 MOO tutorialLevel

Creating an object

Let's assume that you don't want to modify the behavior of an existing object but work on a new one. The first thing you need to do is to create an object and give it a name. We we call this object ``holder'' because it holds information. Choose any other name if you don't like it. However, for ease of use go for a simple name, not something like ``My favorite ToDo List tool''.

You can create an object from any fertile generic object. Generic objects are some kind prototypes containing a set of properties (some having default values) and a set of verbs. If you don't want to profit from the already existing features of a more sophisticated object you make a child of $thing (aka #5): Now type:

    @create $thing named holder

The MOO will reply with something like:

   You now have holder with object number #2108
   and parent generic thing (#5).

By typeing 'inv' you can see that you carry this new object. Keep it on you or drop it to the floor (but don't forget to pick it up when you walk away). If you loose track of this object '@audit' will always show you what you own and you can retrieve it by typing '@move <object> to me'. If the object is not with you or in the same room you have to refer to it by its number (e.g. #2108). Each object has a unique number.

Now as we said, this object has already a few inherited properties and verbs. Some of those properties you bf own and you can modify their values. You don't own the inherited verbs, but you may bf use them. If you are curious about details you may inspect your object from several angles (see section 16.2 on how to do that. For now let's just describe your object (something you should know how to do), i.e. type:

   @describe holder as Information Holder
Now you can look at your object as the following transcript shows:
   >look holder
   Information Holder

Not a very good description and you may want to change that sometimes!


next up previous contents index external
Next: Creating a property "holding" Up: 8.4 MOO tutorialLevel Previous: 8.4 MOO tutorialLevel

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