[code] help with room exits

From: C^2 (wicked@MAIL1.I1.NET)
Date: 04/08/98


Hello all,

        I was hoping that someone could help me out with something.  I am
implementing fly on my mud.  I have the spell put in, and have all the
movement stuff in.  I decided the best option would be to make it so that
if a player doesn't have fly, he can't go up into a flying room.  In
addition, if he doesn't have fly, and the room he is trying to enter
doesn't have a down exit, he can't enter(He can obviously tell that he is
walking off a cliff).  Now if the char doesn't have fly, and the room he
is trying to enter does have a down exit, he will be able to enter, but
will then fall(this will allow builders to build fall traps into their
areas - I have removed deathtraps btw). I have everything implemented,
except I can't find the correct variable to imply whether the room the
character wishes to enter has a down exit or not.

        Here is the function from bpl11 in do_simple_move(in
act.movement.c) that I am having the problem in:

  if ( (SECT(EXIT(ch, dir)->to_room) == SECT_FLYING) &&
     (!can_fly(ch)) ) {
   if ( /* put check to see if there is a down exit in target room here */)
   {
      send_to_char("You need to be flying to go there.\r\n", ch);
      return 0;
   }
  }

        I know that the function works properly, but I just can't seem to
get right how to check to see if the target room(the room the player is
trying to enter) has a down exit.  Things that I have tried are:

world[(EXIT(ch, dir)->to_room)].dir_option[DOWN]->to_room != -1
world[(EXIT(ch, dir)->to_room).dir_option[DOWN]->to_room].number != -1
world[(world[ch->in_room].dir_option[dir]->to_room)].dir_option[DOWN]->to_room
== -1

        Every one of these crashes the mud as soon as a character(without
fly) enters the room.  Flying characters work fine.  If I replace the
check with a 1(for true), It won't let non-flying characters enter(as is
appropriate), and no problems.  Can anyone help me on what exactly I am
looking for here is?

        Going by other code in act.movement.c, I see;
  char_to_room(ch, world[was_in].dir_option[dir]->to_room);
implying that world[roomnumber].dir_option[dir]->to_room will
give you the room number in the dir direction from roomnumber.

        I also see that many examples of
  EXIT(ch, dir)->to_room
giving the room number in the dir direction from chararacter, so I just
don't understand why I can't combine the two to form the first option I
tried above.  Any help on this would be appreciated.

        I am also wondering how other coders have implemented fly into
their mud.  I see 4 possibilities:
1.  No-flyers can't enter fly rooms period - this is the easy way out.  It
doesn't allow for fall traps, but is player friendly.
2.  non-flyers can enter fly rooms, but will fall if not flying.  This is
very true to life, but forces coders to put a down exit in every fly room.
This could become very cumbersome.
3.  non-flyers can enter fly room with down exits, but will fall(causing
some damage).  non-flyers can't enter fly rooms without down exits.  This
allows the builder to choose what he/she wants.  It is a combination of
methods 1 and 2.
4.  implement a new sector type that is flying-fall.

RECAP:  How do I find if the room that a character is trying to enter has
a down exit?


Thanks in advance for any help,
Wicked


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



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