08-16-16, 04:24 PM | #1 |
caelNameplates
Hey guys, so since pre-patch as you know nameplates have changed a huge amount so I've decided to finally take on updating it and take over the addon. I'm still learning lua but I can mostly find my way around and I would appreciate some guidance in updating this addon.
Here is the code for the addon: Lua Code:
|
|
08-16-16, 04:44 PM | #2 |
I'm not sure your debugger is working, this is the error I got:
Code:
1x caelNamePlate\caelNamePlate.lua:7: Couldn't find CVar named 'bloattest' [C]: in function `SetCVar' caelNamePlate\caelNamePlate.lua:7: in main chunk Locals: (*temporary) = "bloattest" (*temporary) = 0
__________________
Fizzlemizz Maintainer of Discord Unit Frames and Discord Art. Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus. |
|
08-16-16, 05:55 PM | #3 |
Yea funny enough I just got that error but wasn't showing before...strange. How can I fix it?
|
|
08-17-16, 04:31 AM | #4 |
You can't "fix" it -- that CVar just doesn't exist anymore. Your only option is to remove the line that tries to set its value. I'm pretty sure all 3 of those CVars have been removed, not just the first one.
__________________
Retired author of too many addons. Message me if you're interested in taking over one of my addons. Don’t message me about addon bugs or programming questions. |
|
08-17-16, 05:30 AM | #5 |
Got this after that:
Code:
Message: Interface\AddOns\caelNameplates\caelNamePlates.lua:202: attempt to index field 'nameFrame' (a nil value) Time: 08/17/16 07:28:50 Count: 1 Stack: Interface\AddOns\caelNameplates\caelNamePlates.lua:202: in function <Interface\AddOns\caelNameplates\caelNamePlates.lua:192> Interface\AddOns\caelNameplates\caelNamePlates.lua:337: in function <Interface\AddOns\caelNameplates\caelNamePlates.lua:322> Locals: frame = NamePlate1 { namePlateUnitToken = "nameplate1" driverFrame = NamePlateDriverFrame { } UnitFrame = NamePlate1UnitFrame { } done = true ApplyOffsets = <function> defined @Interface\AddOns\Blizzard_NamePlates\Blizzard_NamePlates.lua:288 castBar = <unnamed> { } healthBar = <unnamed> { } OnRemoved = <function> defined @Interface\AddOns\Blizzard_NamePlates\Blizzard_NamePlates.lua:275 OnAdded = <function> defined @Interface\AddOns\Blizzard_NamePlates\Blizzard_NamePlates.lua:266 absorbBar = <unnamed> { } barFrame = NamePlate1UnitFrame { } 0 = <userdata> OnOptionsUpdated = <function> defined @Interface\AddOns\Blizzard_NamePlates\Blizzard_NamePlates.lua:282 } healthBar = <unnamed> { 0 = <userdata> r = 0.99999779462814 otherHealPrediction = <unnamed> { } overAbsorbGlow = <unnamed> { } g = 0.99999779462814 barTexture = <unnamed> { } totalAbsorbOverlay = <unnamed> { } b = 0 myHealAbsorbLeftShadow = <unnamed> { } myHealAbsorb = <unnamed> { } myHealPrediction = <unnamed> { } border = <unnamed> { } totalAbsorb = <unnamed> { } background = <unnamed> { } overHealAbsorbGlow = <unnamed> { } myHealAbsorbRightShadow = <unnamed> { } } castBar = <unnamed> { 0 = <userdata> GetPadding = <function> defined @Interface\SharedXML\LayoutFrame.lua:9 GetBaseYOffset = <function> defined @Interface\AddOns\Blizzard_NamePlates\Blizzard_NamePlates.lua:345 SetTargetYOffset = <function> defined @Interface\AddOns\Blizzard_NamePlates\Blizzard_NamePlates.lua:333 CalculateFrameSize = <function> defined @Interface\SharedXML\LayoutFrame.lua:27 AddLayoutChildren = <function> defined @Interface\SharedXML\LayoutFrame.lua:18 spacing = 4 fixedHeight = 14 OnUpdate = <function> defined @Interface\AddOns\Blizzard_NamePlates\Blizzard_NamePlates.lua:325 GetTargetYOffset = <function> defined @Interface\AddOns\Blizzard_NamePlates\Blizzard_NamePlates.lua:337 targetYOffset = 0 OnLoad = <function> defined @Interface\AddOns\Blizzard_NamePlates\Blizzard_NamePlates.lua:311 UpdateAnchor = <function> defined @Interface\AddOns\Blizzard_NamePlates\Blizzard_NamePlates.lua:349 Layout = <function> defined @Interface\SharedXML\LayoutFrame.lua:56 UpdateBuffs = <function> defined @Interface\AddOns\Blizzard_NamePlates\Blizzard_NamePlates.lua:367 OnEvent = <function> defined @Interface\AddOns\Blizzard_NamePlates\Blizzard_NamePlates.lua:319 unit = "nameplate1" BuffFrameUpdateTime = 0.2 baseYOffset = 0 filter = "HARMFUL|INCLUDE_NAME_PLATE_ONLY" buffList = <table> { } LayoutChildren = <function> defined @Interface\SharedXML\LayoutFrame.lua:130 SetBaseYOffset = <function> defined @Interface\AddOns\Blizzard_NamePlates\Blizzard_NamePlates.lua:341 ShouldShowBuff = <function> defined @Interface\AddOns\Blizzard_NamePlates\Blizzard_NamePlates.lua:359 } glowRegion = <unnamed> { 0 = <userdata> } overlayRegion = <unnamed> { 0 = <userdata> } highlightRegion = nil levelTextRegion = nil bossIconRegion = nil raidIconRegion = nil stateIconRegion = nil _ = nil castbarOverlay = nil shieldedRegion = nil spellIconRegion = nil (*temporary) = nil (*temporary) = nil (*temporary) = nil (*temporary) = nil (*temporary) = nil (*temporary) = nil (*temporary) = nil (*temporary) = nil (*temporary) = nil (*temporary) = "attempt to index field 'nameFrame' (a nil value)" font = "Fonts\FRIZQT__.TTF" fontSize = 10 fontOutline = "THINOUTLINE" barTexture = "Interface\AddOns\caelNameplates\media\normtexc" backdrop = <table> { insets = <table> { } bgFile = "Interface\ChatFrame\ChatFrameBackground" edgeSize = 2 edgeFile = "Interface\AddOns\caelNameplat |
|
08-17-16, 06:13 AM | #6 |
Short version:
It's probably easier just to delete everything and start over from scratch, since you're going to have to rewrite 90% of your code anyway. Long version: This is not how you identify nameplate children/regions anymore: lua Code:
All of the objects on a nameplate are accessible through named keys now. See here: https://www.townlong-yak.com/framexm...Plates.xml#289 This is no longer relevant either: lua Code:
This should work now: lua Code:
Other changes you'll need to make: Your "CreatePlate" function should only create any new objects you want to add. It should not: - assign existing objects to keys (eg. don't write "nameplate.healthBar = <something>") - overwrite existing keys (look what exists before adding keys for your custom objects) Your "UpdatePlate" function will need to be updated to refer to the existing keys for default objects.
__________________
Retired author of too many addons. Message me if you're interested in taking over one of my addons. Don’t message me about addon bugs or programming questions. |
|
08-18-16, 05:35 PM | #7 | |
I've removed the parts you told me were irrelevant and added the function you gave, now I'm working on the CreatePlate function, since it shouldn't assign existing objects do I just remove all of the "nameplate.healthBar = <something>" or assign them differently? As for overwriting existing keys which ones do I have overwritten? |
||
08-18-16, 08:35 PM | #8 | |
I don't know all the nameplate child key names off the top of my head. You'll have to go through the default nameplate code and see what's there. If you are overwriting anything it should also be fairly obvious in-game (once the addon is actually loading without errors).
__________________
Retired author of too many addons. Message me if you're interested in taking over one of my addons. Don’t message me about addon bugs or programming questions. |
||
08-19-16, 04:18 PM | #9 |
Lua Code:
|
|
08-19-16, 07:10 PM | #10 |
I'd really strongly suggest starting over from scratch. Don't try to do everything at once. Start with something really basic like detecting when a nameplate is created and printing a message to the chat frame. Then figure out how to add a texture -- just use "Interface\\Icons\\Icon_Misc_QuestionMark" for now as a demo -- to each nameplate. Then detect when a nameplate's unit changes and print a message. Then show/hide the texture based on some simple condition, like whether the unit is a player or an NPC. Then try something like finding the existing font string that shows the unit's name and changing its font, or moving it. Once you've got these basics down, then start building back up toward what you had with caelNameplates before.
Right now you've just got a bunch of someone else's code that you don't understand that doesn't even work, where huge portions of it need to be removed or rewritten from scratch anyway. You're not doing yourself any favors by starting so far in the hole. Even I'd just throw away the existing code and write some new code if I was trying to update a nameplate addon for 7.0. You're going to end up with almost all new code anyway, so just skip ahead to the part where you start writing that new code, instead of wasting a bunch of time now trying to figure out code that's not functional and not relevant.
__________________
Retired author of too many addons. Message me if you're interested in taking over one of my addons. Don’t message me about addon bugs or programming questions. |
|
08-20-16, 05:15 PM | #11 |
I guess I'm gonna have to do just that..sigh
|
|
08-21-16, 10:31 AM | #12 |
Having recently gone through this process, I agree with Phanx, you'll be much better off, and likely take less time, to simply rewrite it from scratch.
If all you're looking for is reskinning the nameplates to use different bar textures, you can take a look at mine (http://www.wowinterface.com/download...ameplates.html) for some code ideas, really all you need to do is change the statusbar file with the one you want to use. The default blizzard frames take care of things like raid icons, elite/boss icons, debuffs, etc that cael and many others use to do, and thus they really aren't needed. |
|
08-21-16, 03:44 PM | #13 |
You could also write your own skin for TidyPlates.
|
|
08-23-16, 05:18 PM | #14 |
Basically just used my current nameplate addon and changed the skin and a few other small things, incase anyone else wanted it:
http://www.wowinterface.com/download...ameplates.html |
|
WoWInterface » Developer Discussions » Lua/XML Help » caelNameplates |
«
Previous Thread
|
Next Thread
»
|
Display Modes |
Linear Mode |
Switch to Hybrid Mode |
Switch to Threaded Mode |
|
|