Hello all, I tried to put MI2 support into Aloft, but MI2 just wont allow it because of the way it accesses the current health information from the database. The workaround is simple, really, for those that don't mind having an extra addon.
-Open MobInfo2 options (/mi2)
-Click the Health/Mana tab at the top
-Uncheck all of the Health Display options on that page
-Exit the game
-Open My Computer, and navigate to F:\Program Files\World of Warcraft\WTF\Account\(youraccountname)\SavedVariables
-Find MobInfo2.lua, copy it and then paste it in the same folder. A new file will appear at the bottom called "Copy of MobInfo2.lua"
How did you try to add MI2 support. I was able to do it. I just got tired of doing it every time aloft got updated.
Using the documented interfaces on wowwiki.com MI2_GetMobData(name, level, [unitid])
The problem with that wrapper is that it only gets the current health, not mana, and that as the wowwiki page states, the author of MI2 plans to change the methods of accessing the database at some point, and that wrapper will not work anymore.. Then what do you do? You follow my instructions, and not ever have to worry about it.
When it doesn't work anymore I'll fix it. It's really that simple. Just like any other add on.
The problem you had is that api call returns a table. You will get a lot more data than just health and mana. It's really not necessary to use that api call for just health. You will create a lot of overhead in both memory and cpu cycles. You are dealing with a table not a variable. The MI2 api calls MobHealth_GetTargetMaxHP() and MobHealth_GetTargetCurHP() return just what is needed.
I read the MI2 wiki page. He's not planning on changing the way someone accesses MI2 data, just the way it's stored in the DB. If you use one of the MI2 api calls it'll work. If the api calls change, it'll break every mod that uses MI2, not just this wrapper.
BTW, mobhealth3 doesn't support mana. One of the calls in Aloft to get the mana for a unit is a Blizz WoW api call, UnitMana(). It returns the actual mana number. MI2 uses that same call. It just stores it in it's DB for future reference.