Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ SMAUG ➜ SMAUG coding ➜ doors not showing on look

doors not showing on look

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Ithildin   USA  (262 posts)  Bio
Date Wed 26 Feb 2003 06:38 PM (UTC)

Amended on Wed 26 Feb 2003 06:39 PM (UTC) by Ithildin

Message
ok, i've been tryin to mess with the doors on my smaug to show up. i've tried a messin with the code, but i'm still messin it up somewhere. here is the code.

void do_exits( CHAR_DATA *ch, char *argument )
{
    char buf[MAX_STRING_LENGTH];
    EXIT_DATA *pexit;
    bool found;
    bool fAuto;

    set_char_color( AT_EXITS, ch );
    buf[0] = '\0';
    fAuto  = !str_cmp( argument, "auto" );

    if ( !check_blind(ch) )
	return;

    strcpy( buf, fAuto ? "Exits:" : "Obvious exits:\n\r" );

    found = FALSE;
    for ( pexit = ch->in_room->first_exit; pexit; pexit = pexit->next )
    {
	if ( pexit->to_room
	&&  !IS_SET(pexit->exit_info, EX_CLOSED)
	&& (!IS_SET(pexit->exit_info, EX_WINDOW)
	||   IS_SET(pexit->exit_info, EX_ISDOOR))
	&&  !IS_SET(pexit->exit_info, EX_HIDDEN) )
	{
	    found = TRUE;
	    if ( fAuto )
	    {
		strcat( buf, " " );
		strcat( buf, dir_name[pexit->vdir] );
/*	        if ( fAuto )
			{(pexit->exit_info, EX_CLOSED);
			  strcat( buf, " #" );
		      strcat(buf, dir_name[pexit->vdir]);
			}
			else 
			{   strcat( buf, " " );
		        strcat( buf, dir_name[pexit->vdir] );
			}*/
		}
	    else
	    {
		sprintf( buf + strlen(buf), "%-5s - %s\n\r",
		    capitalize( dir_name[pexit->vdir] ),
		    room_is_dark( pexit->to_room )
			?  "Too dark to tell"
			: pexit->to_room->name
		    );
	    }
	}
    }

    if ( !found )
	strcat( buf, fAuto ? " none.\n\r" : "None.\n\r" );
    else
      if ( fAuto )
	strcat( buf, ".\n\r" );
    send_to_char( buf, ch );
    return;
}


the commented out part is what i tried. i also had the

&& !IS_SET(pexit->exit_info, EX_CLOSED) and
|| IS_SET(pexit->exit_info, EX_ISDOOR))

commented out. when it came up on the mud, it would show:

North #North South #South so i have the idea of what i need, just not know how to do it. any helps would be great.

Thanks,
Ithildin
Top

Posted by Ithildin   USA  (262 posts)  Bio
Date Reply #1 on Sat 01 Mar 2003 09:10 PM (UTC)

Amended on Sat 01 Mar 2003 09:12 PM (UTC) by Ithildin

Message
ok, i've messed with it some more. i've come up with this.

if ( pexit->to_room	
	||  IS_SET(pexit->exit_info, EX_CLOSED) 
	&&   (!IS_SET(pexit->exit_info, EX_WINDOW)
	||   IS_SET(pexit->exit_info, EX_ISDOOR))
	&&  !IS_SET(pexit->exit_info, EX_HIDDEN) )
	{
	    found = TRUE;
	    if ( fAuto )
		{  //IS_SET(pexit->exit_info, EX_CLOSED);
			  strcat( buf, " -" );
		      strcat(buf, dir_name[pexit->vdir]);
		    
		}
			  else
			{
                IS_SET(pexit->exit_info, EX_CLOSED);  
				strcat( buf, " -#" );
				strcat( buf, dir_name[pexit->vdir]);
		/*	}
		
		if ( fAuto )
	    {
		strcat( buf, " -" );
		strcat( buf, dir_name[pexit->vdir] );
	        if ( fAuto )
			{(pexit->exit_info, EX_CLOSED);
			  strcat( buf, "-#" );
		      strcat(buf, dir_name[pexit->vdir]);
			}		
		}

		
	    else
	    {*/
		sprintf( buf + strlen(buf), "%-5s - %s\n\r",
		    capitalize( dir_name[pexit->vdir] ),
		    room_is_dark( pexit->to_room )
			?  "Too dark to tell"
			: pexit->to_room->name
		    );
	    }
	}
    }


it shows all the exits now, but when i make an exit a door, it still stays the same, here's what it shows:

Exits: -north -east -south.

when south is made a door and closed, i want it to show:

Exits: -north -east -#south.

any suggestions?
anything stupid i missed?


Top

Posted by Ithildin   USA  (262 posts)  Bio
Date Reply #2 on Sun 02 Mar 2003 07:23 AM (UTC)
Message
found out what i was looking for. so here's to anyone who's wanting to try this.

this is is do_exits, act_info.c

if ( pexit->to_room
	  ||   IS_SET(pexit->exit_info, EX_CLOSED)
	  && (!IS_SET(pexit->exit_info, EX_WINDOW)
	  ||   IS_SET(pexit->exit_info, EX_ISDOOR))
	  &&  !IS_SET(pexit->exit_info, EX_HIDDEN) )
	{
	    found = TRUE;
	    if ( fAuto )
	    {
		//strcat( buf, " " );
		//strcat( buf, dir_name[pexit->vdir] );
	        if ( pexit->to_room
			
			  && IS_SET(pexit->exit_info, EX_CLOSED))
			{  strcat( buf, " &W&g-#&Y&c" );
		      strcat(buf, dir_name[pexit->vdir]);
			}
			else 
			{   strcat( buf, " &W&g-&Y&c" );
		        strcat( buf, dir_name[pexit->vdir] );
			}
		}
	    else
	    {
		sprintf( buf + strlen(buf), "%-5s - %s\n\r",
		    capitalize( dir_name[pexit->vdir] ),
		    room_is_dark( pexit->to_room )
			?  "Too dark to tell"
			: pexit->to_room->name
		    );
	    }
	}
    }


whoo hoo.
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


12,237 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.