[Home] [Downloads] [Search] [Help/forum]

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  SMAUG
. -> [Folder]  SMAUG coding
. . -> [Subject]  room sector conflict for automapper
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

room sector conflict for automapper

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


Posted by 6dragons   (3 posts)  [Biography] bio
Date Sat 23 Feb 2008 05:43 AM (UTC)

Amended on Sat 23 Feb 2008 05:49 AM (UTC) by 6dragons

Message
I have a problem with my mapping function. We used an automapper like style to do our wilderness code. Thus my wilderness is one big hairy 5000 vnum area. Automapper generates the maps, and another function generates the room names and brief descriptions.

My problem is when I connect an area to my wilderness unless I connect it on the edge of the wilderness the automapper tries to map the sector types of the area that is connecting to the wilderness. Thus I end up with some crazy look maps where areas connect to wilderness.

I thought of 2 ways that may solve that one I know would, the other I'm not sure.

1) Make an enter exit command for wilderness and keep zones seperate from wilderness. Thus no sector type conflicts. I know that would work, but I think it doesn't look the greatest. Also, with my limited coding ability would be an ugly function like player uses enter command if in this room then send char to this room.

2) Not sure if this would solve it, but was thinking if I make my sectors extended bits, I could keep sector flags different from the wilderness sector flags, maybe putting a W in front of the names of my wilderness sector flags, and some how only having function look_map or draw_map only check wilderness sectors and ignore others? Or will the automapper end up putting blank spaces where it knows a room from another zone is there?

I tried doing this...

In draw_map...

with my define from mud.h
#define IN_WILDERNESS(ch) ((ch)->in_room->vnum >= WILDERNESS_MIN_VNUM && (ch)->in_room->vnum <= WILDERNESS_MAX_VNUM)

I placed this at top of draw_map function
if (!IN_WILDERNESS(ch))
{
return;
}

It didn't work still sector overlapping.

Vladaar

[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio
Date Reply #1 on Sat 23 Feb 2008 06:54 AM (UTC)
Message
I don't really understand the details of what you're doing, so please bear with me, but why isn't it enough to simply stop the automapper when you leave the wilderness area?

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
[Go to top] top

Posted by Robert Powell   Australia  (367 posts)  [Biography] bio
Date Reply #2 on Sat 23 Feb 2008 07:58 AM (UTC)
Message
The way i would fix this Vladaar is to, have a sector_exit, when a PC enters a sector_exit, you look up a table to find the room that that exit links to then move the PC into that room.

Then there are no real exits from the overland and your mapper function will just display the correct rooms. To make it slightly more realistic, you might need some sector_no_enter for the overland, so PC's cannot move say north onto a sector_exit which links to an area with the first room going south.

So on your map you see this,

^^^
^@^
^.^

where ^ is sector_no_enter, @ is sector_exit and . is sector_road.

A zone then can exit to the vnum of room_exit and the PC can then move south.

Just a guy having a bit of fun. Nothing more, nothing less, I do not need I WIN to feel validated.
[Go to top] top

Posted by 6dragons   (3 posts)  [Biography] bio
Date Reply #3 on Sat 23 Feb 2008 09:11 AM (UTC)

Amended on Sat 23 Feb 2008 07:35 PM (UTC) by Nick Gammon

Message
I do not get what you mean Robert. You think you have to stand in the room for mapper to show the area connected to a nearby area?

Look how far away I am from the Area Entrance Sector Room, and it starts showing the other area sectors. I am the * 3 down and 1 west of the area Entrance Room. The above is suppose to be all trees cept for a road that goes horizontally. Below the trees is supposed to be all ocean, but you see road from the connecting area going into the ocean.


  TTTTTTTTTTTT@TTTT
  TTTTTTTTT_TTTTTTT
  TTTTTTTTT_TTTTTTT
  @--------___-----
  TTTTTTTT@___TTTTT
  TTTTTTTT____TTTTT
  TTTTTTT*T_______T
  ~~~~~~~~____~~__~
  ~~~~~~~~~____~~_~
  ~~~~~~~~~~__~~~~~
  ~~~~~~~~~~~~~~~~~
  ~~~~~~~~~~~~~~~~~
  ~~~~~~~~~~~~~~~~~
  ~~~~~~~~~~~~~~~~~
  ~~~~~~~~~~~~~~~~~
  ~~~~~~~~~~~~~~~~~



This what the function looks like itself. I need to figure out a way to get it to ignore sectors from areas not in the wilderness zone. I did remove quite of the sector cases from draw map function just so the function is smaller and easier to view.



void draw_map(CHAR_DATA *ch, unsigned short int map[50][50])
 {
         int x,y;
         char *sect;


         for (y=1;y<= MapDiameter;++y)
         {
                 for (x=1;x<=MapDiameter;++x)
                 {
                         switch(map[x][y])
                         {
                                 default:
                                         sect = ".";
                                         break;
                                 case SECT_INSIDE:
                                         sect = "&w_";
                                         break;
                                 case SECT_ROAD:
                                         sect = "&O_";
                                         break;
                                 case SECT_JUNGLE:
                                         sect = "&g&&";
                                         break;
                                 case SECT_VROAD:
                                         sect = "&O|";
                                         break;
                                 case SECT_HROAD:
                                         sect = "&O-";
                                         break;
                                 case SECT_CAMPSITE:
                                         sect = "&Rx";
                                         break;
                               case SECT_DOCK:
                                         sect = "&w0";
                                         break;
                                       case (SECT_MAX+1):
                                         sect = " ";
                                         break;
                         }

                         if(x==center && y==center)
                                 sect = "&R*";

                         send_to_char_color(sect, ch);
                 }
                 send_to_char("\n\r",ch);
         }
         return;
 }
[Go to top] top

Posted by Robert Powell   Australia  (367 posts)  [Biography] bio
Date Reply #4 on Sat 23 Feb 2008 10:15 AM (UTC)
Message
What i am saying is to not have actual exits from the wilderness into the areas. The map function then has nothing to follow.

Just a guy having a bit of fun. Nothing more, nothing less, I do not need I WIN to feel validated.
[Go to top] top

Posted by 6dragons   (3 posts)  [Biography] bio
Date Reply #5 on Sat 23 Feb 2008 12:03 PM (UTC)
Message
Well that did the trick, but my command is very very nasty looking checking the room each player is in, and sending them to a different room.

Thanks for suggesting it, works for now.

Vladaar
[Go to top] 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.


6,079 views.

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

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

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

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]