Some quick help before I break something....

Posted by Kelsid on Wed 10 Oct 2001 07:56 PM — 3 posts, 14,659 views.

USA #0
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
Australia Forum Administrator #1
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.
USA #2
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