The Dawn Of Time
The Official Forums for the Dawn Of Time Mud Codebase
 
Log in Register FAQ Memberlist Search The Dawn Of Time Forum Index Goto the Official Dawn Website

[Solved] Closed doors and Exit format

 
Post new topic   Reply to topic    The Dawn Of Time Forum Index » Coding
View previous topic :: View next topic  
Author Message
Pixie



Joined: 16 Jan 2016
Posts: 56
Location: Pacific Northwest

PostPosted: Fri Jan 22, 2016 12:17 pm    Post subject: [Solved] Closed doors and Exit format Reply with quote

Is there a way to change it so closing a door doesn't make the exit invisible?

So, say this is a room with a closed door to the south, instead of:

Code:
[Exits: none]


It would show:

Code:
[Exits: (south)]




Last edited by Pixie on Sat Jan 23, 2016 5:39 pm; edited 1 time in total
Back to top
View user's profile Send private message AIM Address
Pixie



Joined: 16 Jan 2016
Posts: 56
Location: Pacific Northwest

PostPosted: Fri Jan 22, 2016 12:38 pm    Post subject: Reply with quote

Looks like this might be changed in act_info.cpp, and Holylight on does it already:

Code:
    if (fAuto){
        sprintf(buf,"[Exits:");
    }else{
        if (IS_IMMORTAL(ch)){
            sprintf(buf,"Obvious exits from room %d:\r\n",ch->in_room->vnum);
        }else{
            sprintf(buf,"Obvious exits:\r\n");
      }
   }

   if(!str_cmp( argument, "fullexits" )){
      strcat(buf, "`=\xac");
   }

    found = false;
    for ( door = 0; door<MAX_DIR; door++ )
    {
        if ( ( pexit = ch->in_room->exit[door] ) != NULL
            &&   pexit->u1.to_room != NULL
            &&   can_see_room(ch,pexit->u1.to_room)
            &&   !IS_SET(pexit->exit_info, EX_CLOSED) )
        {
            found = true;
            if ( fAuto ){
                strcat( buf, mxp_create_tagf(ch, "Ex", " %s",dir_name[door]));
            }
            else
            {
                sprintf( buf + str_len(buf), "%-5s - %s",
                    capitalize( dir_name[door] ),
                    (!HAS_HOLYLIGHT(ch)
                     && room_is_dark( pexit->u1.to_room) )
                    ?  "Too dark to tell"
                    : pexit->u1.to_room->name
                    );
            if (IS_IMMORTAL(ch))
                sprintf(buf + str_len(buf),
                " (room %d)\r\n",pexit->u1.to_room->vnum);
            else
                sprintf(buf + str_len(buf), "\r\n");
            }
        }
    }

    // hidden exits for those with holylight
    if (HAS_HOLYLIGHT(ch))
    {
        for ( door = 0; door < MAX_DIR; door++ )
        {
   
            if ( ( pexit = ch->in_room->exit[door] ) != NULL
                &&   pexit->u1.to_room != NULL
                &&   can_see_room(ch,pexit->u1.to_room)
                &&   IS_SET(pexit->exit_info, EX_CLOSED) )
            {
                found = true;
                if ( fAuto )
                {
                    strcat( buf, " (" );
                    strcat( buf, dir_name[door] );
                    strcat( buf, ")" );
                }
                else
                {
                    sprintf( buf + str_len(buf), "(%s) - %s",
                        capitalize( dir_name[door] ),
                        pexit->u1.to_room->name);
                    if (IS_IMMORTAL(ch))
                        sprintf(buf + str_len(buf),
                            " (room %d)\r\n",pexit->u1.to_room->vnum);
                    else
                        sprintf(buf + str_len(buf), "\r\n");
                }
            }
        }
    }


Almost everything I try makes all the exist vanish period. One time, I managed to make ALL exits appear as (exit), but the closed door still vanished. So confused.




Last edited by Pixie on Fri Jan 22, 2016 1:04 pm; edited 1 time in total
Back to top
View user's profile Send private message AIM Address
Kerishai



Joined: 06 Nov 2013
Posts: 9

PostPosted: Fri Jan 22, 2016 1:04 pm    Post subject: Reply with quote

Check the helpfile OLC-EXIT. I use it a ton to remind myself too. Basically you want to set the exit to 'obvious' so, for example: east door obvious


Back to top
View user's profile Send private message
Pixie



Joined: 16 Jan 2016
Posts: 56
Location: Pacific Northwest

PostPosted: Fri Jan 22, 2016 1:05 pm    Post subject: Reply with quote

Oh my god Kerishai. You are amazing. I spent so long fiddling with this and it turns out it's an OLC option.

Thank you!


Back to top
View user's profile Send private message AIM Address
Pixie



Joined: 16 Jan 2016
Posts: 56
Location: Pacific Northwest

PostPosted: Fri Jan 22, 2016 1:07 pm    Post subject: Reply with quote

Oddly, it seems like the obvious exits still vanish when the door is closed.

Code:
-West  to [ 1015] Key: [    0]  Exit flags: [door obvious]


But on look, with the door closed:

Code:
[Exits: north east south]


Scratching head a little. What would obvious mean if not visible?


Back to top
View user's profile Send private message AIM Address
Oreant



Joined: 16 Jul 2010
Posts: 47

PostPosted: Fri Jan 22, 2016 4:14 pm    Post subject: Reply with quote

I only see obvious used in below:

macro.h
Code:
#define CAN_SEE_EXIT(ch, exit) (!IS_SET(exit->exit_info, EX_HIDDEN) \
                        || HAS_HOLYLIGHT(ch) \
                        || IS_SET(TRUE_CH(ch)->act, PLR_HOLYWALK) \
                        || IS_SET(exit->exit_info, EX_OBVIOUS))


I only see this function used places in map.cpp for automap, scanning, etc (assuming I haven't accidentally removed it).


Back to top
View user's profile Send private message
Oreant



Joined: 16 Jul 2010
Posts: 47

PostPosted: Fri Jan 22, 2016 4:55 pm    Post subject: Reply with quote

Forgot to post this part after getting curious about Obvious. At some point I fiddled with the code to display closed exits.

Code:
void do_exits( char_data *ch, char *argument )
{
   EXIT_DATA *pexit;
    char buf[MSL];
    bool found;
    bool fAuto;
    int door;

    fAuto  = !str_cmp( argument, "auto" );

    if ( !check_blind( ch ) )
   return;

    if (fAuto){
        sprintf(buf,"[Exits:");
    }else{
        if (IS_IMMORTAL(ch)){
            sprintf(buf,"Obvious exits from room %d:\r\n",ch->in_room->vnum);
        }else{
            sprintf(buf,"Obvious exits:\r\n");
      }
   }

   if(!str_cmp( argument, "fullexits" )){
      strcat(buf, "`=\xac");
   }

    found = false;
    for ( door = 0; door<MAX_DIR; door++ )
    {
        if ( ( pexit = ch->in_room->exit[door] ) != NULL
            &&   pexit->u1.to_room != NULL
            &&   can_see_room(ch,pexit->u1.to_room)
            &&   !IS_SET(pexit->exit_info, EX_HIDDEN) )
        {
            found = true;
            if ( fAuto ){
               if (IS_SET(pexit->exit_info, EX_CLOSED)){
                    strcat( buf, " (" );
                    strcat( buf, dir_name[door] );
                    strcat( buf, ")" );
               }else{
                  strcat( buf, mxp_create_tagf(ch, "Ex", " %s",dir_name[door]));
               }
            }
            else
            {
                sprintf( buf + str_len(buf), "%-5s - %s",
                    capitalize( dir_name[door] ),
                    (!HAS_HOLYLIGHT(ch)
                     && room_is_dark( pexit->u1.to_room) )
                    ?  "Too dark to tell"
                    : pexit->u1.to_room->name
                    );
            if (IS_IMMORTAL(ch))
                sprintf(buf + str_len(buf),
                " (room %d)\r\n",pexit->u1.to_room->vnum);
            else
                sprintf(buf + str_len(buf), "\r\n");
            }
        }
    }

    // hidden exits for those with holylight
   if (HAS_HOLYLIGHT(ch))
   {
     for ( door = 0; door < MAX_DIR; door++ )
     {

         if ( ( pexit = ch->in_room->exit[door] ) != NULL
             &&   pexit->u1.to_room != NULL
             &&   can_see_room(ch,pexit->u1.to_room)
             &&   IS_SET(pexit->exit_info, EX_HIDDEN) )
         {
            found = true;
            if ( fAuto )
            {
               if (IS_SET(pexit->exit_info, EX_CLOSED)){
                    strcat( buf, " (" );
                    strcat( buf, dir_name[door] );
                    strcat( buf, ")" );
               }else{
                  strcat( buf, mxp_create_tagf(ch, "Ex", " %s",dir_name[door]));
               }
            }
            else
            {
              sprintf( buf + str_len(buf), "(%s) - %s",
                  capitalize( dir_name[door] ),
                  pexit->u1.to_room->name);
              if (IS_IMMORTAL(ch))
                  sprintf(buf + str_len(buf),
                      " (room %d)\r\n",pexit->u1.to_room->vnum);
              else
                  sprintf(buf + str_len(buf), "\r\n");
            }
         }
     }
   }

   if ( !found )
     strcat( buf, fAuto ? " none" : "None." );

   if ( fAuto ){
     strcat( buf, "]");
   strcpy( buf, mxp_create_tag(ch, "RExits", buf ));
   }
   ch->printlnf( "`=a%s`x", buf);
               
   return;
}


Back to top
View user's profile Send private message
Pixie



Joined: 16 Jan 2016
Posts: 56
Location: Pacific Northwest

PostPosted: Fri Jan 22, 2016 6:22 pm    Post subject: Reply with quote

Hey thanks a lot! Put it in, working like a charm. Much, much appreciated, Oreant.


Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    The Dawn Of Time Forum Index » Coding All times are GMT + 13 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001-2005 phpBB Group
Theme created by Vjacheslav Trushkin