• 0

    posted a message on Visor/VisorGUI
    Skycatcher, that error is occurring because a lot of libraries have been upgraded to the 2.0 version. From now until wednesday (= EU patch day), expect lots of confused people having that error.
    Posted in: Addon Ideas
  • 0

    posted a message on Library Management Solutions (Lets end DLL hell)
    Quote from MentalPower »

    The problem here is that it becomes trivially easy to make an AddOn whose only purpose is to feed data into WoW. Create an AddOn, have a gazillion empty files in it and have an outside program write to these files sequentially, and then have the AddOn load the files according to a schedule, or even settings in the files themselves. And before you mention it, yes it is currently possible to do this with AddOns instead of files, but its a lot harder to do.


    And what would be the point of this? i can't really think of something off the top of my head, so what use are you seeing?
    Posted in: Libraries
  • 0

    posted a message on Library Management Solutions (Lets end DLL hell)
    Except that Standalones creates a rather unsightly list of addons...

    I know, I know. Performance gets priority over usability. But you can't tell me you really don't care.

    There is a solution, but it's out of our hands: Load-on-demand files instead of entire addons.

    I do, however, feel that this is something that we could ask Blizzard. I cannot imagine it to be hard to implement, which improves our chance of seeing it happen, if we make a good case for it.

    Imagine... One 'Libraries' folder instead of two dozen, with the same functionality. No more addons splitting into multiple addons just because some functionality is simply too demanding to be loaded all the time.
    Posted in: Libraries
  • 0

    posted a message on Library Management Solutions (Lets end DLL hell)
    If only apt or rpm or any of the other linux package managers had Windows clients... The only thing I've ever seen on Windows that came close is the cygwin installer, no clue if that's open source though.
    Posted in: Libraries
  • 0

    posted a message on Library Management Solutions (Lets end DLL hell)
    Quote from sylvanaar »

    Quote from Splinter271 »

    I think the current system is fine, as long as library authors stop breaking older addons (API changes) without updating the major version number.


    API changes are not the most common case, though. More common is a mod will work with embedded librariex or !!!Libs, but not both, or installing it breaks another mod.


    *blink* Whu?

    The thing about either working with embedded or !!!Libs is more than likely a matter of paths and includes that don't take into account both possibilities. This falls under the issue where people develop an addon in one environment and then fail to properly take into account all other possible environments the user has.

    But I cannot for the life of me imagine how installing one mod can break another one if there was no API change in one of the libraries. Unless there's a name collision somewhere...
    Posted in: Libraries
  • 0

    posted a message on KC_Items db compiliation possible?
    Edit your saved variables file. I don't have the addon you mention so I can't give you specifics, but it's certainly possible that way.
    Posted in: Addon Ideas
  • 0

    posted a message on Library Management Solutions (Lets end DLL hell)
    I do think you raise an interesting point there, beesknees, in that the authors are quite likely to not test their own addons in a typical user environment. If you have a !!!Libs setup and build your addon like that, there's a chance you'll screw up your .toc or your embedded libs.

    I know that there's a project somewhere for a WoW emulator/development environment. It just emulates events and such, aimed squarely at add-on development. It might be interesting to run an addon through this pre-commit if it's not too hard on the server.
    Posted in: Libraries
  • 0

    posted a message on Library Management Solutions (Lets end DLL hell)
    The only time a new lib can break backwards compatibility is when it changes its API, which is very much a bad practice from developpers.

    Especially in LUA, I guess. I haven't done much programming in it but I skimmed the 'Programming in LUA' book online and the simple fact that you can make a given function return more values than before WITHOUT breaking backwards compatibility seems heaven sent for developpers.
    Posted in: Libraries
  • 0

    posted a message on Cartographer
    Right...

    My jaw just dropped to the floor. Gatherer localizes its data. In a totally wrong way.

    If you have an english client, continent 2, zone 10 is Elwynn.
    In German, it's Rotkammgebirge (Redridge).
    In French, it's Arathi.

    So, erm... Do not use my code on anything but English Gatherer data. Seriously. Unless you wish to go looking for Rich Thorium Veins in Silverpine...

    What a bunch of crap. Doesn't explain my data loss yet, though.
    Posted in: Map/Minimap AddOns
  • 0

    posted a message on Cartographer
    It's entirely possible that I botched up that GatherRegionLookup thing.

    The problem is that Gatherer uses a list of zones that is rather... cruddy. Typos, no spaces, missing 'the'. I corrected the errors in my own Gatherer files, but you need that list present somewhere and I thought this was easier than instructing you to go fix the errors yourself. Plus, Gatherer localizes the zones.

    Hmmm, wait a minute. Try changing the last entry in the first line to GatherRegionLookup instead of gatherRegionLookup.

    As for turning this into an addon: all it'd need is a .toc file and a place to be downloaded from. But I'd like to check what happened to the Plaguelands bit first.
    Posted in: Map/Minimap AddOns
  • 0

    posted a message on ClosetGnome - Wear it or lose it.
    Don't know if it's been asked before, but the ClosetGnome_Gatherer could use support for Fishing.
    Posted in: General AddOns
  • 0

    posted a message on Cartographer
    Okay, it took me less effort all things considered to just rip some code from Gatherer and Cartographer to create the function as lua, rather than code a separate app.

    The following is a totally stand-alone function that will import all your Gatherer mining data into Cartographer_Mining. It's not as clean as I'd liked it to be, but that's because of some odd ways in which Gatherer stores data. Either copy it into LuaSlinger or something like it, or copy the code and manually add it to an existing addon. Doesn't even matter which one. Since you'll only need to run this once anyway, you can delete it afterwards.

    function ConvertFromGatherer()
    	local gatherCont, gatherZone, gatherName, contData, zoneData, nameData, gatherPos, gatherItem, gatherRegionLookup
    	
    	GatherRegionLookup[1][1] = {name = "Ashenvale"}
    	GatherRegionLookup[1][2] = {name = "Azshara"}
    	GatherRegionLookup[1][3] = {name = "Darkshore"}
    	GatherRegionLookup[1][4] = {name = "Darnassus"}
    	GatherRegionLookup[1][5] = {name = "Desolace"}
    	GatherRegionLookup[1][6] = {name = "Durotar"}
    	GatherRegionLookup[1][7] = {name = "Dustwallow Marsh"}
    	GatherRegionLookup[1][8] = {name = "Felwood"}
    	GatherRegionLookup[1][9] = {name = "Feralas"}
    	GatherRegionLookup[1][10] = {name = "Moonglade"}
    	GatherRegionLookup[1][11] = {name = "Mulgore"}
    	GatherRegionLookup[1][12] = {name = "Orgrimmar"}
    	GatherRegionLookup[1][13] = {name = "Silithus"}
    	GatherRegionLookup[1][14] = {name = "Stonetalon Mountains"}
    	GatherRegionLookup[1][15] = {name = "Tanaris"}
    	GatherRegionLookup[1][16] = {name = "Teldrassil"}
    	GatherRegionLookup[1][17] = {name = "The Barrens"}
    	GatherRegionLookup[1][18] = {name = "Thousand Needles"}
    	GatherRegionLookup[1][19] = {name = "Thunder Bluff"}
    	GatherRegionLookup[1][20] = {name = "Un'Goro Crater"}
    	GatherRegionLookup[1][21] = {name = "Winterspring"}
    	GatherRegionLookup[2][1] = {name = "Alterac Mountains"}
    	GatherRegionLookup[2][2] = {name = "Arathi Highlands"}
    	GatherRegionLookup[2][3] = {name = "Badlands"}
    	GatherRegionLookup[2][4] = {name = "Blasted Lands"}
    	GatherRegionLookup[2][5] = {name = "Burning Steppes"}
    	GatherRegionLookup[2][6] = {name = "Deadwind Pass"}
    	GatherRegionLookup[2][7] = {name = "Dun Morogh"}
    	GatherRegionLookup[2][8] = {name = "Duskwood"}
    	GatherRegionLookup[2][9] = {name = "Eastern Plaguelands"}
    	GatherRegionLookup[2][10] = {name = "Elwynn Forest"}
    	GatherRegionLookup[2][11] = {name = "Hillsbrad Foothills"}
    	GatherRegionLookup[2][12] = {name = "Ironforge"}
    	GatherRegionLookup[2][13] = {name = "Loch Modan"}
    	GatherRegionLookup[2][14] = {name = "Redridge Mountains"}
    	GatherRegionLookup[2][15] = {name = "Searing Gorge"}
    	GatherRegionLookup[2][16] = {name = "Silverpine Forest"}
    	GatherRegionLookup[2][17] = {name = "Stormwind City"}
    	GatherRegionLookup[2][18] = {name = "Stranglethorn Vale"}
    	GatherRegionLookup[2][19] = {name = "Swamp of Sorrows"}
    	GatherRegionLookup[2][20] = {name = "The Hinterlands"}
    	GatherRegionLookup[2][21] = {name = "Tirisfal Glades"}
    	GatherRegionLookup[2][22] = {name = "Undercity"}
    	GatherRegionLookup[2][23] = {name = "Western Plaguelands"}
    	GatherRegionLookup[2][24] = {name = "Westfall"}
    	GatherRegionLookup[2][25] = {name = "Wetlands"}
    	
    	for gatherCont, contData in GatherItems do
    		for gatherZone, zoneData in contData do
    			for gatherName, nameData in zoneData do
    				for gatherPos, gatherItem in nameData do
    					local what
    					if string.find(gatherName, "dark") then
    						what = L["Dark Iron"]
    					elseif gatherItem.gtype == "Ore" then
    						if gatherItem.icon == "thorium" then
    							if string.find(gatherName, "rich") then
    								what = L["Rich Thorium"]
    							else
    								what = L["Small Thorium"]
    							end
    						else
    							what = string.upper(string.sub(gatherItem.icon, 1, 1))..string.sub(gatherItem.icon, 2)
    						end
    					end
    					if L:HasReverseTranslation(what) then
    						Cartographer_Notes:SetCustomNote(GatherRegionLookup[gatherCont][gatherZone].name, gatherItem.x/100, gatherItem.y/100, L:GetReverseTranslation(what) , "Mining")
    					end
    				end
    			end
    		end
    	end
    end


    EDIT: Okay, seems it did cost me some of my Eastern Plaguelands data... Odd. Use at your own risk, or in other words, just don't delete your Gatherer saved vars. As long as you keep those, you can always reimport. Enough coding for today, more playing!
    Posted in: Map/Minimap AddOns
  • 0

    posted a message on Visor?
    VisorActionButtons was split off from Visor not all that long ago. The real problem with using other button addons with Visor is that they tend to provide their own (sometimes rather limited) way of placing and hiding/showing their buttons. VisorActionButtons doesn't have that because it relies on Visor to provide those functions.

    I've stopped using it though due to the fact that the cooldowns weren't being shown properly on some buttons (but not all...). I'm now using Flexbar but I'm pretty sure that with the way that works, I'd have a hard time using Visor to accurately place my buttons.
    Posted in: General AddOns
  • 0

    posted a message on Cartographer
    And now for the big part: converting Gatherer data to Cartographer_Mining data. Keep in mind my question about rare ores in my last post, though, before doing this. Also, this is just the explanation on how to do it, perhaps I'll find time to code this but I don't even know in what language I'd do it. PHP, probably...

    Anyway, here's what I found.

    GATHERER DATA FORMAT

    Stored in Gatherer.lua in your saved variables folder.
    GatherItems = {
    	[1] = {
    		[1] = {
    			["briarthorn"] = {
    				[1] = {
    					["absx"] = 0.4442,
    					["y"] = 48.2,
    					["x"] = 16.98,
    					["absy"] = 0.4068,
    					["gtype"] = "Herb",
    					["icon"] = "briarthorn",
    					["count"] = 1,
    				},
    				[2] = {
    					["absx"] = 0.4463,
    					["y"] = 28.29,
    					["x"] = 18.38,
    					["absy"] = 0.3756,
    					["gtype"] = "Herb",
    					["icon"] = "briarthorn",
    					["count"] = 1,
    				},


    These are my first two entries, it doesn't matter that they're herbs, it's all the same format.

    GatherItems is of course the name of the database. The array has two entries at the first level, called [1] and [2], indicating the continent. The second level is the zone, again only indicated by a number. The mappings of these numbers to names is listed in the GatherRegionData.lua file in the Gatherer addon folder. Continent [1] is Kalimdor, zone [1] there is Ashenvale.

    The next level of the array is the name of the node, we find the entry proper, with a simple numerical index. x and y are the coordinates of the node, calculated as follows (taken from various functions in Gatherer.lua in the addon folder):
    local px, py = GetPlayerMapPosition("player");
    ...
    local gatherX = px * 100;
    local gatherY = py * 100;
    ...
    gatherX = math.floor(gatherX * 100)/100;
    gatherY = math.floor(gatherY * 100)/100;


    These values are then stored in the DB. The other entries for the node are not needed for the conversion.

    CARTOGRAPER DATA FORMAT

    Cartographer_MiningDB = {
    	["Darkshore"] = {
    		[331719] = "Copper",
    		[330718] = "Copper",
    		[370874] = "Copper",
    		[452883] = "Copper",
    		[493871] = "Copper",
    		[584004] = "Copper",
    		[471897] = "Copper",
    		[470896] = "Copper",
    		[453883] = "Copper",
    	},
    }


    My very empty mining database, found in Cartographer_Mining in the saved variables folder. As you can tell, there's less info stored. First level of the array is the zone name, followed by entries for each node consisting of encoded coordinates and the type of the node.

    As should be clear now, the only tricky bit is converting the coordinates. The rest is trivial. Here's how Cartographer encodes (and decodes) coordinates, functions found in addon.lua in the Cartographer_Mining addon folder and Modules\Notes.lua in the Cartographer addon folder :
    local x, y = GetPlayerMapPosition("player")
    ...
    local id = getID(x, y)
    ...
    local function getID(x, y)
    	return math.floor(x*1000+0.5) + math.floor(y*1000+0.5)*1001
    end
    ...
    local function getXY(id)
    	return math_mod(id, 1001)/1000, math.floor(id / 1001)/1000
    end


    So we have all we need:
    local function convert(x, y)
    	return math.floor(x*10+0.5) + math.floor(y*10+0.5)*1001
    end


    The Gatherer coordinates were already multiplied by 100 and then rounded down to 2 numbers after the comma. Cartographer multiplies by 1000 and then rounds down to integers. So we just need to multiply by 10, round down again in Cartographer style and then do Cartographer's math trick.

    Proof in case: here's a Gatherer entry from Darkshore:
    [19] = {
    	["absx"] = 0.4529,
    	["y"] = 33.04,
    	["x"] = 38.83,
    	["absy"] = 0.2408,
    	["gtype"] = "Ore",
    	["icon"] = "copper",
    	["count"] = 4,
    },

    x 38.83 and y 33.04 become 388 + (330*1001) = 330718, and as you can tell from my little Cartographer DB, I have indeed found a Copper Vein at 330718.
    Posted in: Map/Minimap AddOns
  • 0

    posted a message on Cartographer
    Not sure if this is the right place to put this, but well...

    I was looking at the code, trying to see how tricky it would be to write a converter from Gatherer to Cartographer_Mining when I found this in the Cartographer_Mining code on line 124:

    function mod:OnInitialize()
      self.db = Cartographer:AcquireDBNamespace("Herbalism")
      Cartographer:RegisterDefaults("Herbalism", "profile", {
        filter = {
          ['*'] = true,
        }
      })


    Herbalism needs to be mining, no?

    Also, I've managed to figure out the data format to convert to, but how would Cartographer_Mining handle rare ore nodes? Can I have the same ID twice in the database, once with normal ore and once with the rare one? The way it's set up I doubt it...
    Posted in: Map/Minimap AddOns
  • To post a comment, please or register a new account.