Page 1 of 1

"addSpecialExit" not creating exit line

Posted: Sun Nov 20, 2016 3:13 am
by CurryMUD
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.

Re: "addSpecialExit" not creating exit line

Posted: Sun Nov 20, 2016 4:39 am
by CurryMUD
(Also, if anyone would like to give me feedback on my mapping script, please do.)

Re: "addSpecialExit" not creating exit line

Posted: Sun Nov 20, 2016 5:28 am
by CurryMUD
So, I just discovered that I can draw a line for a special exit using "addCustomLine".
I think I'm good!

Re: "addSpecialExit" not creating exit line

Posted: Tue Feb 14, 2017 9:18 pm
by Vadi
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.

Re: "addSpecialExit" not creating exit line

Posted: Thu Feb 16, 2017 1:07 pm
by SlySven
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:

Re: "addSpecialExit" not creating exit line

Posted: Fri Feb 17, 2017 12:43 pm
by Jor'Mox
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.

Re: "addSpecialExit" not creating exit line

Posted: Fri Feb 17, 2017 7:47 pm
by SlySven
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: