Re: [devel] exits

From: Xual (xual@danathara.dhs.org)
Date: 08/02/99


On Mon, 2 Aug 1999, Alfredo Kengi Kojima wrote:

> Hi
>
> Is it possible to create doors, so that they can only be
> entered with the "enter" command? For example, if I want
> a room that can only be entered through a "hole" (like "enter hole"),
> how do I do that? If thats not possible with stock circle 3.0bpl15,
> can you tell me whether there is some patch that does that?

You need a room special procedure to do this, an extremely simple example
follows.  Make sure you assign it in spec_assign.c where all the others are
assigned.  I deliberately left out arguments for simplicity, but they should
be easy enough to add if you feel the need for more than one entryway per
room.

/*
  change/add room vnums to to this array.  The first number is the room the
  spec_proc is assigned to.  The second is the destination room.  The last
  entries should be left as -1.
*/

int enter_room_vnums[][2] = {
  { 1001, 1000 },
  { -1, -1 }
};


SPECIAL(enter_room)
{
  int i;

  if (!CMD_IS("enter"))
    return FALSE;

  for (i = 0; enter_room_vnums[0][i] != -1; i++) {
    if (GET_ROOM_VNUM(IN_ROOM(ch)) == enter_room_vnums[0][i]) {
      char_from_room(ch);
      char_to_room(ch, real_room(enter_room_vnums[i][1]));
      look_at_room(ch, 0);
      act("$n has arrived", TRUE, ch, 0, 0, TO_ROOM);
      sprintf(buf, "You enter %s.\r\n", world[ch->in_room].name);
      send_to_char(buf, ch);
      return TRUE;
    }
  }
  mudlog("Invalid room to enter_room()", BRF, LVL_IMPL, TRUE);
  return FALSE;
}

This is of course MailerCode(tm), so use at your own risk.

--

"Misery is boundless"
        -Xual the Torturer, on the Eve of the Sundering.

Danathara Online RPG
telnet://danathara.dhs.org:4000


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html  |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/15/00 PST