"addSpecialExit" not creating exit line

All and any discussion and development of the Mudlet Mapper.
Post Reply
CurryMUD
Posts: 19
Joined: Sat Mar 26, 2016 3:53 am

"addSpecialExit" not creating exit line

Post by CurryMUD » Sun Nov 20, 2016 3:13 am

Hi, I have a simple mapper script working to my satisfaction, except for one thing: the "addSpecialExit" function doesn't seem to draw an exit line between rooms. Is this by design, or am I missing something?
Thanks.

You can find my mapper script here.

CurryMUD
Posts: 19
Joined: Sat Mar 26, 2016 3:53 am

Re: "addSpecialExit" not creating exit line

Post by CurryMUD » Sun Nov 20, 2016 4:39 am

(Also, if anyone would like to give me feedback on my mapping script, please do.)

CurryMUD
Posts: 19
Joined: Sat Mar 26, 2016 3:53 am

Re: "addSpecialExit" not creating exit line

Post by CurryMUD » Sun Nov 20, 2016 5:28 am

So, I just discovered that I can draw a line for a special exit using "addCustomLine".
I think I'm good!

User avatar
Vadi
Posts: 4591
Joined: Sat Mar 14, 2009 3:13 pm

Re: "addSpecialExit" not creating exit line

Post by Vadi » Tue Feb 14, 2017 9:18 pm

It is by design, yes. A special exit is like a portal and etc - so it's not possible to always tell what side of the room should the line be on.

User avatar
SlySven
Posts: 885
Joined: Mon Mar 04, 2013 3:40 pm
Location: Deepest Wiltshire, UK
Discord: SlySven#2703

Re: "addSpecialExit" not creating exit line

Post by SlySven » Thu Feb 16, 2017 1:07 pm

Note that for the current 2 (and 3)D map system the direction an XY-Plane exit (not a stub) makes when leaving a room symbol is entirely dependent on the position of the room the exit is going to if it within the same area (and is on the same Z coordinate IIRC) - this can be confusing when you have say an exit that goes south (down the screen) but the room it goes to is due north (up the screen). I have experimented with enhanced code that draws a "stub" in the "correct" direction and then draws the exit from the end of that protruding stub; this shows promise but only if the rooms are not drawn to fill the enter space available for them (room size >= 10; 7 or 8 is the best compromise IMHO) AND the rooms are not in adjacent positions {e.g. room 1 at (0,0,0) room 2 at (1,0,0)} but it is far from production ready and there are several other things to fix first... *sigh*

You can also draw the line interactively in recent development/release 3.0 preview versions: right click on a room and select "custom exit lines" to choose the options you want for the line and then click on the appropriate normal or special exit to start drawing the (2D map only) line interactively - each click on the map adds a point the line and you can then undo each point drawn/change the overall line properties/finish the line then or subsequently click on the exit line on the map to modify it in the future. The user interface was significantly improve in a release 3.0 preview a few Greek letters back and it is a lot more user friendly/functional (IMVHO - I did it though so I might be a bit biased) than it was... :ugeek:

Jor'Mox
Posts: 1068
Joined: Wed Apr 03, 2013 2:19 am

Re: "addSpecialExit" not creating exit line

Post by Jor'Mox » Fri Feb 17, 2017 12:43 pm

Hey, so I was looking at your mapping script (which takes awesome advantage of all the back channel data you are feeding it), and I noticed that your method for finding the areaID is unusually inefficient. Currently, you have the following:
Code: [show] | [select all] lua
  local area_id = find_area_id(info.area_name)
  if not area_id then area_id = addAreaName(info.area_name) end

function find_area_id(name)
  for area, id in pairs(getAreaTable()) do
    if area:find(name, 1, true) then return id end
  end
end
But, the table returned by getAreaTable uses the area names as keys, so you should be able to find the correct area like this:
Code: [show] | [select all] lua
local area_tbl = getAreaTable()
local area_id = area_tbl[info.area_name] or addAreaName(info.area_name)
That way, you aren't doing a search through the entire table, and are instead taking advantage of the dictionary-like setup of the area table, which Lua is able to access very efficiently.

User avatar
SlySven
Posts: 885
Joined: Mon Mar 04, 2013 3:40 pm
Location: Deepest Wiltshire, UK
Discord: SlySven#2703

Re: "addSpecialExit" not creating exit line

Post by SlySven » Fri Feb 17, 2017 7:47 pm

Don't forget that the current (development and release 3.0 previews) version now ENFORCE unique area names - but the 2.1 release was not so strict... :geek:

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest