 |
The TinTin++ message board
|
 |
| View previous topic :: View next topic |
| Author |
Message |
Slysven
Joined: 10 Apr 2011 Posts: 254 Location: As "Jomin al'Bara" in WoTMUD or Wiltshire, UK
|
Posted: Thu Jul 07, 2011 9:02 pm Post subject: Wanting more #MAP INFO |
|
|
With 2.00.6 the #MAP INFO shows the exits from the current room but sometimes it is useful to know how one got there.
Can I suggest the following addition to the mapper.c code:
| Code: | DO_MAP(map_info)
{
int room, cnt, exits;
struct exit_data *exit;
------------------------------ [snip] ----------------------------------
for (exit = ses->map->room_list[ses->map->in_room]->f_exit ; exit ; exit = exit->next)
{
tintin_printf2(ses, "%-20s %03d %-3s (%s) to room: %-5d (%s)", "Exit:", exit->dir, exit->name, exit->cmd, exit->vnum, ses->map->room_list[exit->vnum]->name);
}
/* Start addition */
for (room=1; room<ses->map->size; room++)
/* EDIT: ^ oops - did have "<=" which overan end of data!!! - 13/07/2011 */
{
if (ses->map->room_list[room]==NULL)
continue;
if (ses->map->room_list[room]->f_exit==NULL)
continue;
for (exit=ses->map->room_list[room]->f_exit; exit!=NULL; exit=exit->next)
{
if (exit->vnum==ses->map->in_room)
tintin_printf2(ses, "%-20s %03d %-3s (%s) from room: %-5d (%s)", "Entrance:", exit->dir, exit->name, exit->cmd, room, ses->map->room_list[room]->name);
}
}
/* End addition */
}
} |
I find the extra entrance data useful especially when I've got into a room with no exits or where I've accidently created links between rooms and not correctly unlinked them (or unlinked in only one direction). A sample of the output is:
| Code: | #map info
Total rooms: 4134/10000
Total exits: 9655
Vtmap: on
Static: off
Room vnum: 1196
Room name: Reception of the Queen's Blessing
Room size: 0
Avoid: off
Hide: off
Leave: off
Void: off
Exit: 032 d (d) to room: 1192 (The Queen's Blessing)
Exit: 004 s (s) to room: 1197 (The Library)
Entrance: 016 u (u) from room: 1192 (The Queen's Blessing)
Entrance: 001 n (n) from room: 1197 (The Library)
|
Last edited by Slysven on Wed Jul 13, 2011 12:11 pm; edited 1 time in total |
|
| Back to top |
|
 |
Scandum Site Admin
Joined: 03 Dec 2004 Posts: 3274
|
Posted: Wed Jul 13, 2011 10:08 am Post subject: |
|
|
| Incorrect linking is shown in the map display with ASCIIGRAPHICS enabled. |
|
| Back to top |
|
 |
Slysven
Joined: 10 Apr 2011 Posts: 254 Location: As "Jomin al'Bara" in WoTMUD or Wiltshire, UK
|
Posted: Wed Jul 13, 2011 12:19 pm Post subject: |
|
|
Not special exits or say if two rooms in the same direction both enter the same room - not a normal situation admittedly but it IS possible to do all sorts of weird things! I just find it useful to be able to check a suspect room with a #MAP INFO command... Anyway I'll post an update to match the new {2.00.7} formatting shortly if anyone want it!  |
|
| Back to top |
|
 |
Scandum Site Admin
Joined: 03 Dec 2004 Posts: 3274
|
Posted: Wed Jul 13, 2011 1:18 pm Post subject: |
|
|
| Alright, still planning to mess with #map info some more, but I'll add this to my todo list for the mapper. |
|
| Back to top |
|
 |
Slysven
Joined: 10 Apr 2011 Posts: 254 Location: As "Jomin al'Bara" in WoTMUD or Wiltshire, UK
|
Posted: Wed Jul 13, 2011 4:20 pm Post subject: |
|
|
Um, please don't feel offended but the new #MAP INFO is, um, not the most asthetically pleasing thing I've ever seen. And changing all the Exits to Entrances for the extra data I want to show takes up too much space on the screen. Below is a drop-in replacement which will also take an optional numeric argument for the room to display (otherwise the display of the room vnum and the current room of the original function is just duplication!) The data for the exits (and entrances) is put into a table as this seems the best option for showing several entries. Although there is only one flag currently defined for an exit, more may come along ("locked" possibly?). Putting the data field on the end of the Links' table is to allow as most space as possible for whatever data the user puts there.
| Code: | DO_MAP(map_info)
{
int room, checkroom, cnt, exits, done_one_exit, done_one_entrance;
struct exit_data *exit;
done_one_exit=0;
done_one_entrance=0;
arg = sub_arg_in_braces(ses, arg, arg1, GET_ALL, SUB_VAR|SUB_FUN);
for (room = cnt = exits = 0 ; room < ses->map->size ; room++)
{
if (ses->map->room_list[room])
{
cnt++;
exits += get_map_exits(ses, room);
}
}
if (is_number(arg1))
{
room = find_room(ses, arg1);
if (room == -1)
{
tintin_printf2(ses, "#MAP: No room with that vnum found");
return;
}
}
else
{
room = ses->map->in_room;
}
tintin_printf2(ses, "World information:");
tintin_printf2(ses, "%s%-7d %s%-7d %s%-7d %s%-7d", "World size: ", ses->map->size,
"Room count: ", cnt, "Exit count: ", exits, "Current room: ", ses->map->in_room);
tintin_printf2(ses, "%s%5s %s%5s %s%5s", "Room color: ", ses->map->room_color,
"Exit color: ", ses->map->exit_color, "Path color: ", ses->map->path_color);
tintin_printf2(ses, "%s%s%s%s%s%s%s\n", "Flags: ",
HAS_BIT(ses->map->flags, MAP_FLAG_VTMAP) ? "VTMap " : "",
HAS_BIT(ses->map->flags, MAP_FLAG_STATIC) ? "Static " : "",
HAS_BIT(ses->map->flags, MAP_FLAG_VTGRAPHICS) ? "VTGraphics " : "",
HAS_BIT(ses->map->flags, MAP_FLAG_ASCIIGRAPHICS) ? "ASCIIGraphics " : "",
HAS_BIT(ses->map->flags, MAP_FLAG_ASCIIVNUMS) ? "ASCIIvnums" : "",
HAS_BIT(ses->map->flags, MAP_FLAG_NOFOLLOW) ? "NoFollow" : "");
if (room)
{
tintin_printf2(ses, "Room information:");
tintin_printf2(ses, "%9s%d", "Vnum: ", room);
tintin_printf2(ses, "%9s%s", "Name: ", ses->map->room_list[room]->name);
tintin_printf2(ses, "%9s%s", "Area: ", ses->map->room_list[room]->area);
tintin_printf2(ses, "%9s%s", "Color: ", ses->map->room_list[room]->color);
tintin_printf2(ses, "%9s%s", "Symbol: ", ses->map->room_list[room]->symbol);
tintin_printf2(ses, "%9s%s", "Desc: ", ses->map->room_list[room]->desc);
tintin_printf2(ses, "%9s%s", "Note: ", ses->map->room_list[room]->note);
tintin_printf2(ses, "%9s%s", "Terrain: ", ses->map->room_list[room]->terrain);
tintin_printf2(ses, "%9s%s%s%s%s%s%s", "Flags: ",
HAS_BIT(ses->map->room_list[room]->flags, ROOM_FLAG_AVOID) ? "Avoid " : "",
HAS_BIT(ses->map->room_list[room]->flags, ROOM_FLAG_HIDE) ? "Hide " : "",
HAS_BIT(ses->map->room_list[room]->flags, ROOM_FLAG_LEAVE) ? "Leave " : "",
HAS_BIT(ses->map->room_list[room]->flags, ROOM_FLAG_STATIC) ? "Static " : "",
HAS_BIT(ses->map->room_list[room]->flags, ROOM_FLAG_VOID) ? "Void " : "",
HAS_BIT(ses->map->room_list[room]->flags, ROOM_FLAG_RIVER) ? "River " : ""
);
tintin_printf2(ses, "%9s%s\n", "Data: ", ses->map->room_list[room]->data);
for (exit = ses->map->room_list[room]->f_exit; exit; exit=exit->next)
{
if (!done_one_exit)
{
tintin_printf2(ses, "Link information - Exits:");
tintin_printf2(ses, "%-18s %9s %-10s %-30s %s", "Name", "To Vnum", "Flags" , "Command", "Data");
done_one_exit=-1;
}
tintin_printf2(ses, "%-18s %9d %-10s %-30s %s", exit->name, exit->vnum,
HAS_BIT(exit->flags, EXIT_FLAG_HIDE) ? "Hide " : "", exit->cmd, exit->data);
}
for (checkroom=1; checkroom<ses->map->size; checkroom++)
{
if (ses->map->room_list[checkroom]==NULL)
continue;
if (ses->map->room_list[checkroom]->f_exit==NULL)
continue;
for (exit=ses->map->room_list[checkroom]->f_exit; exit!=NULL; exit=exit->next)
{
if (exit->vnum==room)
{
if (!done_one_entrance)
{
tintin_printf2(ses, "Link information - Entrance:");
tintin_printf2(ses, "%-18s %9s %-10s %-30s %s", "Name", "From Vnum", "Flags" , "Command", "Data");
done_one_entrance=-1;
}
tintin_printf2(ses, "%-18s %9d %-10s %-30s %s", exit->name, checkroom,
HAS_BIT(exit->flags, EXIT_FLAG_HIDE) ? "Hide " : " ", exit->cmd, exit->data);
}
}
}
}
}
| Sample output: | Code: | #map info 9998
World information:
World size: 10000 Room count: 4367 Exit count: 10238 Current room: 9000
Room color: <178> Exit color: <070> Path color: <720>
Flags: VTMap ASCIIGraphics
Room information:
Vnum: 9998
Name: Entering the Weave...
Area: Special
Color:
Symbol:
Desc: You tingle as the wheel weaves itself around you once again. You prepare to\nenter the woven thread and current age.\n\nA guidepost stands here offering instruction to the respun. You should LOOK\nPOST.\n\nThe Eye of the World, city of legend and myth lies down below the mists,\nready to receive those who are new to this weave of the Wheel.\n
Note:
Terrain:
Flags:
Data: {createdby}{Jath}{createdon}{1309566083}{version}{0.0.3}
Link information - Exits:
Name To Vnum Flags Command Data
d 9000 d
Tear 7000 enter weave Tear; d
Mayene 5800 enter weave Mayene; d
Caemlyn 3800 enter weave Caemlyn; d
Emond's Field 4500 enter weave Emond's Field; d
Link information - Entrance:
Name From Vnum Flags Command Data
d 9999 d | Anyone is free to use this as per original licence (are we talking latest GPL for TinTin by the way?) - if it breaks, you, the user, get to keep BOTH halves.  |
|
| Back to top |
|
 |
Scandum Site Admin
Joined: 03 Dec 2004 Posts: 3274
|
Posted: Sun Oct 02, 2011 3:39 pm Post subject: |
|
|
I typically only use snippets that are placed in the public domain. This because under copyright law person A and person B have equal say, even if person B only wrote 1% of the software.
I rewrote #map info and it now looks like this:
| Code: |
#map info
Total rooms: 258 Total exits: 570 World size: 15000
Vtmap: on Static: off Vtgraphics: off
Asciigraphics: on Asciivnums: off Nofollow: off
Room area:
Room data:
Room desc:
Room name: 10
Room note:
Room symbol:
Room terrain:
Room vnum: 10
Avoid: off Hide: off Leave: off
Void: off Static: off
Exit: e ( e) to room: 11 ( 11)
Exit: w ( w) to room: 9 ( 9)
Entrance: e ( e) from room: 9 ( 9)
Entrance: w ( w) from room: 11 ( 11)
|
More specific exit data can be retrieved with the #map exit <dir> command. |
|
| Back to top |
|
 |
|
|
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
|
TinTin++ Homepage
Powered by phpBB © 2001, 2002 phpBB Group
|