Housekeeping
Tutorial by Chris Hunt – nospam@cwhunt.com
in collaboration with Ron Broglio – ron.broglio@lcc.gatech.edu
1. Purpose
This patch gives each MOO object a ‘home’, a place to which they can be recalled with a simple command.
2. Background
This is a core-level patch. It does not overwrite existing functionality but it does expand the generic player and thing objects. Naturally, wizard privileges are required.
Installation is remarkably easy. We used the @dump command to create a text that will create all the methods and objects when it is pasted into the MOO space.
3. Implementation
We will create four new methods and one new property. Two methods will be in the generic thing class; the rest will be in generic player. Simply paste the following code into your MOO text input:
@prop $thing."default_location" #-1 r
@verb $thing:"set_default_location" this none none rxd
@program $thing:set_default_location
here = this.location;
if (here == #-1)
return E_TYPE;
elseif (!$object_utils:has_callable_verb(here, "accept_for_abode"))
player:notify(("You should set the default location of '" + this.name) + "' to an actual room.");
else
this.default_location = here;
player:tell((((("'" + here.name) + "' is the new default location ") + "of '") + this.name) + "'.");
return 1;
endif
"Tutorial by Chris Hunt -- nospam@cwhunt.com";
"Maintained and published by Dr. Ron Broglio, Georgia Tech";
" ron.broglio@lcc.gatech.edu";
.
@verb $thing:"goto_default_location" this none none rxd
@program $thing:goto_default_location
target = this.default_location;
oldLoc = this.location;
if (target == oldLoc)
player:notify(("Already at default-location: '" + this.name) + "'.");
elseif (target != #-1)
move(this, target);
oldLoc:announce((((("'" + this.name) + "' has been summoned to its ") + " default-location: '") + target.name) + "'.");
target:announce(("'" + this.name) + "' returns to its default-location.");
player:notify(((("'" + this.name) + "' moves to '") + target.name) + "'.");
endif
"Tutorial by Chris Hunt -- nospam@cwhunt.com";
"Maintained and published by Dr. Ron Broglio, Georgia Tech";
" ron.broglio@lcc.gatech.edu";
.
@verb $player:"@freeze_objects" this none none rxd
@program $player:@freeze_objects
if (caller != this && !$perm_utils:controls(caller_perms(), this))
return E_PERM;
else
objList = this.owned_objects;
for currObj in (objList)
currObj:set_default_location();
endfor
player:notify("");
player:notify("Every owned object's default location is now set to" + " its current location.");
endif
"Tutorial by Chris Hunt -- nospam@cwhunt.com";
"Maintained and published by Dr. Ron Broglio, Georgia Tech";
" ron.broglio@lcc.gatech.edu";
.
@verb $player:"@fetch_objects" this none none rxd
@program $player:@fetch_objects
if (caller != this && !$perm_utils:controls(caller_perms(), this))
return E_PERM;
else
objList = this.owned_objects;
for currObj in (objList)
currObj:goto_default_location();
endfor
player:notify("");
player:notify("Every object has returned to its default " + "location.");
endif
"Tutorial by Chris Hunt -- nospam@cwhunt.com";
"Maintained and published by Dr. Ron Broglio, Georgia Tech";
" ron.broglio@lcc.gatech.edu";
.
Your screen should look something like this:

Figure 3.1
That’s it!
4. Usage
First, put all of your objects in their new homes (in rooms, desks, etc.). (If you are not sure where an object is, look-up the object number from ‘Your Objects’ in the object editor.) You can manually move your objects by typing
@move #OBJECT_NUMBER to here
…where #OBJECT_NUMBER is replaced by the number you see in the list.
Now you can formally set these places as the objects’ homes by entering
@freeze_objects YOUR_NAME
And you can send them all back home with
@fetch_objects YOUR_NAME
However, if you want to individually set an object’s home, use
set_default_location #OBJECT_NUMBER
And if you want to recall just one object, type
goto_default_location #OBJECT_NUMBER