MOO-cows Mailing List Archive


Re: Portable source form of MOO database

Please excuse the repost.  Somehow about half of this message got
truncated the first time, at least that's how it arrived here.  I had
several long strings of `-'s to separate the code from the text and I
think some piece of software in the mail handling chain interpreted this
as the end of the message.

Shouting to be heard above the roaring chainsaw of dismemberment on Thu,
30 Nov 1995 07:14:20 -0500 (EST), Kipp the Kidd bellowed:

  Kipp> There is, though, a verb that is called every time the server
  Kipp> wants to match an object; <player>:my_match_object(<objname>);
  Kipp> The verb normally calls :match and then
  Kipp> $string_utils:match_object.

I managed to get the job done with match.  Still not sure where
my_match_object fits in.

In the example that follows, sdig works like the case in @dig that digs
to an existing room, except it uses the room's Name string rather than
it's object number.  Experienced MOOers will notice that I have only cut
and pasted most of this out of the source of the regular @dig.

The line


is where the place name string gets converted into an object.


@create $feature named building
@verb building:sdig
@args building:sdig any any any
@chmod building:sdig rxd
@program building:sdig
nargs = length(args);
if (( nargs != 3 )||( args[2] != "to" ))
  player:notify(tostr("Usage: ", verb, " <exit-description> to <old-room-name>"));
exit_spec = args[1];
to_str = args[3];
if (!valid(to_o) || !($room in $object_utils:ancestors(to_o)))
  player:notify(tostr(to_o, " doesn't look like a room to me..."));
exit_kind = player:build_option("dig_exit");
if (exit_kind == 0)
  exit_kind = $exit;
exits = $string_utils:explode(exit_spec, "|");
if (length(exits) < 1 || length(exits) > 2)
  player:notify("The exit-description must have the form");
  player:notify("     [name:]alias,...,alias");
  player:notify("or   [name:]alias,...,alias|[name:]alias,...,alias");
do_recreate = !player:build_option("bi_create");
to_ok = $building_utils:make_exit(exits[1], player.location, to_o, exit_kind);
if (to_ok && length(exits) == 2)
  $building_utils:make_exit(exits[2], to_o, player.location, exit_kind);

Home | Subject Index | Thread Index