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 ➜ Compiling the server ➜ Some quick help before I break something....

Some quick help before I break something....

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


Posted by Kelsid   USA  (35 posts)  Bio
Date Wed 10 Oct 2001 07:56 PM (UTC)
Message
Ok,

heres my situation, Im trying to make changes to the way rooms are described by the do_look command. What I basically want to do is alter the do_look, to display the mobs with a comma after each one (on the same line) instead of listing them.

Ex.

a wizard
a rabbit
---------------------------------------
I would like it to be changed to:

You also see: a wizard, a rabbit

----------------------------------------


ok.... I figured out in act_info.c where it draws the mob list from.



This is the relavant code:



	if ( arg1[0] == '\0'
	|| ( !IS_NPC(ch) && !xIS_SET(ch->act, PLR_BRIEF) ) )
    {
      send_to_char( MXPTAG ("rdesc"), ch);
	    send_to_char( ch->in_room->description, ch );
      send_to_char( MXPTAG ("/rdesc"), ch);
    }

	if ( !IS_NPC(ch) && xIS_SET(ch->act, PLR_AUTOMAP) )   /* maps */
	{
	    if(ch->in_room->map != NULL)
	    {
	       do_lookmap(ch, NULL);
	    }
	}

	if ( !IS_NPC(ch) && xIS_SET(ch->act, PLR_AUTOEXIT) )
	    do_exits( ch, "auto" );


	show_list_to_char( ch->in_room->first_content, ch, FALSE, FALSE, eItemGet );
	show_char_to_char( ch->in_room->first_person,  ch );
	return;
    }





Ok... I see that its drawing the "show_char_to_char" function. So... I look around for that.





void show_char_to_char( CHAR_DATA *list, CHAR_DATA *ch )
{
    CHAR_DATA *rch;

    for ( rch = list; rch; rch = rch->next_in_room )
    {
	if ( rch == ch )
	    continue;

	if ( can_see( ch, rch ) )
	{
	    show_char_to_char_0( rch, ch );
	}

**REST OMITTED****
  



Ok.... now... the only important thing to change is the list. Im looking at it.... I see what its doing.... but I have no idea where to start to get it to do what I want. I am trying to avoid a ten hour struggle just to come up with something simple that I was overthinking. Any suggestions on where to start would be greatly appreciated.


Kelsid

-Kelsid
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #1 on Thu 11 Oct 2001 10:53 PM (UTC)
Message
Sorry about the slow reply, but my Internet connection has been a bit intermittent over the last few days.

Looking at function show_char_to_char_0 it seems that you could dispense with most of that and just send the contents of:

victim->pcdata->title

for each character in the room, separated by commas.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Kelsid   USA  (35 posts)  Bio
Date Reply #2 on Sat 13 Oct 2001 01:37 PM (UTC)
Message
Thanks Nick,


I was a little leary about messing with the do_look function, and Im glad I held off.... Actually.... all I really had to do was to edit the send_to_char, and change "\n\r" to ", ".


This raises some new questions, and I will address them in your new Coding forum.

Thanks again,

Kelsid

-Kelsid
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.


11,623 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.