TinTin++ Mud Client The TinTin++ message board

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
TinTin++ Mud Client

Area on exits output from #map info

 
Post new topic   Reply to topic    The TinTin++ message board Forum Index -> Feature Requests
View previous topic :: View next topic  
Author Message
ixle



Joined: 15 Sep 2011
Posts: 158
Location: United States

PostPosted: Thu Mar 22, 2012 3:04 am    Post subject: Area on exits output from #map info Reply with quote

I would find it very convenient if the roomarea value of an exit is shown in #map info.

So instead of:
Code:
           Exit: n   (  n)   to room: 32478 (Whitewind Avenue)



You'd see something like
Code:
           Exit: n   (  n)   to room: 32478 (Whitewind Avenue)    [aylor]
Back to top
View user's profile Send private message
ixle



Joined: 15 Sep 2011
Posts: 158
Location: United States

PostPosted: Tue Sep 04, 2012 3:53 am    Post subject: Reply with quote

*bump*

Slysven is this something you could whip up? I'm already using your modified mapper.c for returning vnums in a variable displaying area on #map list.
Back to top
View user's profile Send private message
Slysven



Joined: 10 Apr 2011
Posts: 365
Location: As "Jomin al'Bara" in WoTMUD or Wiltshire, UK

PostPosted: Tue Sep 04, 2012 2:59 pm    Post subject: Reply with quote

Well I think the current code which is around line 850 of mapper.c is:
Code:
   for (exit = ses->map->room_list[ses->map->in_room]->f_exit ; exit ; exit = exit->next)
   {
      tintin_printf2(ses, "%+16s %-3s (%3s)   to room: %-5d (%5s)", "Exit:", exit->name, exit->cmd, exit->vnum, ses->map->room_list[exit->vnum]->name);
   }

   tintin_printf2(ses, "");

   for (room = 0 ; room < ses->map->size ; room++)
   {
      if (ses->map->room_list[room])
      {
         for (exit = ses->map->room_list[room]->f_exit ; exit ; exit = exit->next)
         {
            if (exit->vnum == ses->map->in_room)
            {
               tintin_printf2(ses, "%+16s %-3s (%3s) from room: %-5d (%5s)", "Entrance:", exit->name, exit->cmd, room, ses->map->room_list[room]->name);
            }
         }
      }
   }
And you want to add something to the tintin_printf2()'s {first one for exits, second for entrances to the specific room} so I'd suggest:
Code:
   for (exit = ses->map->room_list[ses->map->in_room]->f_exit ; exit ; exit = exit->next)
   {
      tintin_printf2(ses, "%+16s %-3s (%3s)   to room: %-5d (%5s) [%5s]", "Exit:", exit->name, exit->cmd, exit->vnum, ses->map->room_list[exit->vnum]->name, ses->map->room_list[exit->vnum]->area);
   }

   tintin_printf2(ses, "");

   for (room = 0 ; room < ses->map->size ; room++)
   {
      if (ses->map->room_list[room])
      {
         for (exit = ses->map->room_list[room]->f_exit ; exit ; exit = exit->next)
         {
            if (exit->vnum == ses->map->in_room)
            {
               tintin_printf2(ses, "%+16s %-3s (%3s) from room: %-5d (%5s) [%5s]", "Entrance:", exit->name, exit->cmd, room, ses->map->room_list[room]->name, ses->map->room_list[room]->area);
            }
         }
      }
   }
Note that the room (name) and [area] are bracketed/braced as you wish and are allocated a minimum of 5 spaces on screen but will grow to accommodate longer strings but to get the area name to line up on all the lines requires more complex coding than I can give you here... Coffee
Back to top
View user's profile Send private message
ixle



Joined: 15 Sep 2011
Posts: 158
Location: United States

PostPosted: Mon Sep 10, 2012 12:12 am    Post subject: Reply with quote

Works like a dream, thanks.
Back to top
View user's profile Send private message
ixle



Joined: 15 Sep 2011
Posts: 158
Location: United States

PostPosted: Mon Nov 26, 2012 5:32 am    Post subject: Reply with quote

First off, thanks for the new features and bug fixes in 2.00.9. I particularly am happy about the addition of the variable option for #map list.

Can I put in another request for the area to be listed beside the room name on entrances/exits in #map info output? I'm using the above modification from Slysven to do this currently but I think it would be a nice addition to the standard mapper.c
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3770

PostPosted: Mon Nov 26, 2012 7:27 am    Post subject: Reply with quote

You can script this. Let me know if you need help with that.
Back to top
View user's profile Send private message Send e-mail
ixle



Joined: 15 Sep 2011
Posts: 158
Location: United States

PostPosted: Mon Jan 28, 2013 1:44 am    Post subject: Reply with quote

Guess I could use some help with scripting this. I can't think of an easy way and am still applying the above patch to mapper.c
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3770

PostPosted: Mon Jan 28, 2013 8:11 am    Post subject: Reply with quote

Code:

#alias {exits}
{
  #map get roomexits exits;

  #foreach {exits} {exit[dir]}
  {
    #map exit {$exit[dir]} {save} {exit};
    #map at $exit[destination] #map get roomarea exit[area];

    #echo {Exit: %+2s (%+5s) to room: %+5s (%s)} {$exit[dir]} {$exit[command]} {$exit[destination]} {$exit[area]}
  }
}
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    The TinTin++ message board Forum Index -> Feature Requests All times are GMT - 5 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
Get TinTin++ Mud Client at SourceForge.net. Fast, secure and Free Open Source software downloads Get TinTin++ Mud Client at SourceForge.net. Fast, secure and Free Open Source software downloads
TinTin++ Homepage

Powered by phpBB © 2001, 2002 phpBB Group