So what could cause g to be nil? Simple answer is the ff assignment. ff isn't a number it's a variable. Since ff has never been assigned it's nil. If you want to use hexidecimal values in Lua you need to prefix the number with 0xx. So change:
[code]r,g,b = 00, ff, 00[/code]to
[code]r,g,b = 0x00,0xff,0x00[/code]or even
[code]r,g,b = 0,255,0[/code]And it should work fine.
huh! sad thing is that I've programmed for a while, but C++ was never my strong point. So the color manipulation has always been weak for me. I knew that I wanted 255 just I thought setting the variable as a hex number would work, I guess not. Thanks a lot for the correction.
local unit_a,unit_b = ThreatPair(unit)
if unit_a and unit_b then
local _,status,percent = UnitDetailedThreatSituation(unit_a, unit_b)
local modifier = 1
if percent and percent ~= 0 then
if GetItemInfo(37727) then
if (IsItemInRange(37727, unit_b) == 1) then
modifier = 1.1
else
modifier = 1.3
end
else
if CheckInteractDistance(unit_b, 3) then
modifier = 1.1
else
modifier = 1.3
end
if not queried and not ItemRefTooltip:IsVisible() then
ItemRefTooltip:SetHyperlink("item:37727")
queried = true -- Only query once per session
end
end
percent *= modifier
local r,g,b = ThreatStatusColor(status)
if (status == 0) then
r,g,b = 00,ff,00
end
return "|cff%02x%02x%02x%s%%|r",r,g,b,Round(percent,1)
end
end
return ConfigMode()
I then get an error
Message: PitBull4_LuaTexts:Player:Lua:Threat Test caused the following error:
bad argument #4 to 'SetFormattedText' (number expected, got nil)
Debug:
...erface\AddOns\PitBull4\Modules\LuaTexts\LuaTexts.lua:585:
...erface\AddOns\PitBull4\Modules\LuaTexts\LuaTexts.lua:573
...erface\AddOns\PitBull4\Modules\LuaTexts\LuaTexts.lua:639:
...erface\AddOns\PitBull4\Modules\LuaTexts\LuaTexts.lua:595
...erface\AddOns\PitBull4\Modules\LuaTexts\LuaTexts.lua:935: ?()
...Tom\libs\CallbackHandler-1.0\CallbackHandler-1.0.lua:146:
...Tom\libs\CallbackHandler-1.0\CallbackHandler-1.0.lua:146
Somthing is messing with the Callbackhandler that is in a lot of my mods.
Shefki, is there going to be a range function for LuaText, I am trying to set up a more dynamic threat meter then the one provided (something more similar to Omen). However when I try to implement Omen's coding (with some changes) I get an error which I'm unclear as to why. In case you don't know what I'm talking about, this is what Xinhaun uses in his code:
Don't need an entire lib to check if you are in melee range. Here's how I do it in Omen3:
[php]
local queried = false
function Omen:UpdateBarsReal()
...
...
if GetItemInfo(37727) then -- 5 yards (Ruby Acorn - http://www.wowhead.com/?item=37727)
threatTable["AGGRO"] = tankThreat * (IsItemInRange(37727, mob) == 1 and 1.1 or 1.3)
else -- 9 yards compromise
threatTable["AGGRO"] = tankThreat * (CheckInteractDistance(mob, 3) and 1.1 or 1.3)
if not queried and not ItemRefTooltip:IsVisible() then
ItemRefTooltip:SetHyperlink("item:37727")
queried = true -- Only query once per session
end
end
...
...
end
[/php]The check is basically (IsItemInRange(37727, mob) == 1 and 1.1 or 1.3) where it evaluates to 1.1 or 1.3 depending if item 37727 (Ruby Acorn, a quest item) is in melee range.
Unfortunetly, there is no way in Dogtag at this time to evaluate perameters using item information. Everything in the Help dialog box is referring to unit information. They do have Range functions, like I used in the code above, but they require the RangeCheck library, which in the case of Pitbull 4, is not supplied.
I was thinking that after I posted that. I still need to download libRangeCheck though which I think got updated from what Dogtags is saying to use.
edit: yea it is updated. Dogtags Help is saying to use RangeCheck - 1.0. But Curse is only showing RangeCheck - 2.0. Still works with 2.0. This is what I eventually came up with.
[if (ThreatStatus = 3) then
"100":Percent:ThreatStatusColor(ThreatStatus)
elseif MaxRange(unit="target") < 6 then
if (ThreatStatus > 0) then
(PercentThreat * 1.1):Round(1):Hide(0):Percent:ThreatStatusColor(ThreatStatus)
else
(PercentThreat * 1.1):Round(1):Hide(0):Percent:Green
end
elseif (ThreatStatus > 0) then
(PercentThreat * 1.3):Round(1):Hide(0):Percent:ThreatStatusColor(ThreatStatus)
else
(PercentThreat * 1.3):Round(1):Hide(0):Percent:Green
end]
I personally don't like the grey look when ThreatStatus = 0 so I forced it to use Green for my color.
I'm trying to generate a more dps oriented Threat Dogtag instead of the one provided by Dogtag. The one provided by Dogtag only gives threat as a percentage against the tank with a range of 0-100%. However every other threat display that I've worked with (ie Omen), gives threat with, with pull percentage beyond 100% (Melee can go up to 110% before pulling, or Range can go up to 130%). Unfortunetly Dogtag's built in features don't really work that way. What I want to do is set up my own Threat generator. However it requires the raw threat numbers, instead of "RawPercentThreat" which only gives it as a percent against the tank. Does anyone know if they are going to add this or if there is a way to do that with the current Dogtags?
What I'm planning on doing is something along these lines
[if [COLOR=MediumTurquoise]IsTanking [/COLOR]then
[COLOR=Sienna] "100%"[/COLOR]:[COLOR=green]Red[/COLOR]
else if (([COLOR=MediumTurquoise]RawThreat[/COLOR]([COLOR=Red]unit[/COLOR]=[COLOR=Sienna]"player"[/COLOR])/[COLOR=lightblue][COLOR=MediumTurquoise]RawThreat[/COLOR][COLOR=Black]([/COLOR][COLOR=Red]unit[/COLOR][/COLOR]=[COLOR=Sienna]"ToT"[/COLOR]) * 100) < 100) then
(([COLOR=lightblue][COLOR=MediumTurquoise]RawThreat[/COLOR][COLOR=Black]([/COLOR][COLOR=Red]unit[/COLOR][/COLOR]=[COLOR=Sienna]"player"[/COLOR])/[COLOR=MediumTurquoise]RawThreat[/COLOR]([COLOR=Red]unit[/COLOR]=[COLOR=Sienna]"ToT"[/COLOR]) * 100):[COLOR=green]Floor[/COLOR] [COLOR=Sienna]"%"[/COLOR]):[COLOR=green]Green[/COLOR]
else
(([COLOR=lightblue][COLOR=MediumTurquoise]RawThreat[/COLOR][COLOR=Black]([/COLOR][COLOR=Red]unit[/COLOR][COLOR=Black]=[/COLOR][COLOR=Sienna]"player"[/COLOR][COLOR=Black])/[/COLOR][COLOR=MediumTurquoise]RawThreat[/COLOR][COLOR=Black]([/COLOR][COLOR=Red]unit[/COLOR][/COLOR]=[COLOR=Sienna]"ToT"[/COLOR]) * 100):[COLOR=green]Floor[/COLOR] [COLOR=Sienna]"%"[/COLOR]):[COLOR=green]Yellow[/COLOR]
end
end
Ever since the patch this past tuesday, pallypower doesn't seem to be linking with other players with the mod. Of the three pallies in the raid, only one is saying that it works. the others have tried to re-download/re-install and it still didn't work. Anyone else having this problem?
Ok, I'm trying to use the SeparateDigits fuction of DogTag with Pitbull4. As an example of what I'm trying to do, I'll use my health function as a basis.
Currently I use
[Status or (FractionalHP ' | ' PercentHP:Percent)]
This prints out "15163 / 15163 | 100%"
What I'm trying to do is set is so that it shows up as "15,163 / 15,163 | 100%"
I have tried multiple veriations of SeparateDigits, and each of them is coming up as a nil value.
[Status or (FractionalHP:SeparateDigits ' | ' PercentHP:Percent)]
[Status or (SeparateDigits(FractionalHP) ' | ' PercentHP:Percent)]
[Status or (SeparateDigits(FractionalHP, thousand=",", decimal=".") ' | ' PercentHP:Percent)]
Ok, that was the problem. I had disembedded the files (downloaded them individually from curse' program) and running it that way and the programming didn't like that. Thanks for the help.
I'm having great difficulties getting this mod to load properly. I currently have Ace2, Ace3, and FuBar 3.5. I am not sure if i should be enabling Fubar_SavedInstance and/or SavedInstance or not. The problem is that in order for me to see Fubar, I need to have Lib:Fubarplugin 2.0 turned on. If I turn on Lib:Rock-1.0 then there is a glitch somewhere and I cannot see Fubar at all. Anyone have any clue what is going on?
OYou can turn portraits on and off for individual layouts. If you want to turn portraits off for a particular frame just make a new layout for it with portraits turned off. Hint: Making a new layout with an existing layout selected copies the existing layout's settings to your new layout.
AH! did not know I could create individual layouts for particular frames. The impression I was getting was setting for all frames. I figured out how you do this. Thank you.
I found a few errors in the latest build. It's mostly dealing with Acelocale-3.0. I am using the current version of Ace3 (the one released on the 4th), so that is not the issue. I attached the errors in the text file provided.
Also I'm coming up with an oddity. If I turn on portraits, the Player frame is fine, the target frame is fine. However the Target's target frame's portrait seems to be jumpy. like it will do 1 second's worth of animation then recycle that animation over again. It would be nice to be able to select which frames I want portraits to.
This is an interesting concept. Nice to see how I'm doing to other people on the server until the Armory comes back on. Then you know a website is going to show up with their own web version.
From what I saw of the alpha, it looks like it can definitely be ready by Tuesday. My only issue is the bug I had, and the default size of the title (which can be changed manually by players). Other then that, it looks good to go.
0
huh! sad thing is that I've programmed for a while, but C++ was never my strong point. So the color manipulation has always been weak for me. I knew that I wanted 255 just I thought setting the variable as a hex number would work, I guess not. Thanks a lot for the correction.
0
I then get an error
Somthing is messing with the Callbackhandler that is in a lot of my mods.
0
http://forums.wowace.com/showpost.php?p=279095&postcount=4
0
0
edit: yea it is updated. Dogtags Help is saying to use RangeCheck - 1.0. But Curse is only showing RangeCheck - 2.0. Still works with 2.0. This is what I eventually came up with.
I personally don't like the grey look when ThreatStatus = 0 so I forced it to use Green for my color.
0
What I'm planning on doing is something along these lines
0
0
Currently I use
This prints out "15163 / 15163 | 100%"
What I'm trying to do is set is so that it shows up as "15,163 / 15,163 | 100%"
I have tried multiple veriations of SeparateDigits, and each of them is coming up as a nil value.
Any ideas?
0
0
0
AH! did not know I could create individual layouts for particular frames. The impression I was getting was setting for all frames. I figured out how you do this. Thank you.
0
Also I'm coming up with an oddity. If I turn on portraits, the Player frame is fine, the target frame is fine. However the Target's target frame's portrait seems to be jumpy. like it will do 1 second's worth of animation then recycle that animation over again. It would be nice to be able to select which frames I want portraits to.
0
Last I can remember 2915/280 from earlier today.
0
0