We have updated our Terms of Service and Privacy Policy.
Dismiss
  1. #1

    LUA code help with oUF Skaarj

    I am at the minute in the process of redoing my interface. Trying for a cross between Lyn UI and twin2's UI. The problem I have is that incoming heals will not show up on any frame. I am a novice when it comes to LUA amd just can't get it to work properly. This appears to be the code that deals withs incoming heals.

    local Healcomm = function(self)
    self.MyHealBar = createStatusbar(self.Health, cfg.texture, nil, nil, self:GetWidth(), 0.33, 0.59, 0.33, 0.75)
    self.MyHealBar:SetPoint('TOPLEFT', self.Health:GetStatusBarTexture(), 'TOPRIGHT')
    self.MyHealBar:SetPoint('BOTTOMLEFT', self.Health:GetStatusBarTexture(), 'BOTTOMRIGHT')

    self.OtherHealBar = createStatusbar(self.Health, cfg.texture, nil, nil, self:GetWidth(), 0.33, 0.59, 0.33, 0.75)
    self.OtherHealBar:SetPoint('TOPLEFT', self.Health:GetStatusBarTexture(), 'TOPRIGHT')
    self.OtherHealBar:SetPoint('BOTTOMLEFT', self.Health:GetStatusBarTexture(), 'BOTTOMRIGHT')

    self.HealPrediction = {
    myBar = self.MyHealBar,
    otherBar = self.OtherHealBar,
    maxOverflow = 1,}
    end

    I can get a bar to show up when I heal by changing self:GetWidth to an actual value but this just shows a bar that doesn't really relate to the size of the incoming heal. I am hoping that someone with a better knowledge of LUA might be able to help me out. Thanks in advance for any help.

  2. #2
    Don't think you need a healcomm plugin for oUF anymore.

    The problem is probably the way your creating the statusbars, i can't see the height anywhere? not sure how skaarjs createstatusbar works :P

    This is a rewrite of what i use basicly, try it... assign texture and change color to your liking.

    local MyHealBar = CreateFrame("StatusBar", nil, self.Health)
    MyHealBar:SetPoint("TOPLEFT", self.Health:GetStatusBarTexture(), "TOPRIGHT")
    MyHealBar:SetPoint("BOTTOMLEFT", self.Health:GetStatusBarTexture(), "BOTTOMRIGHT")
    MyHealBar:SetStatusBarTexture(TEXTURE)
    MyHealBar:SetStatusBarColor(1,1,1)

    local OtherHealBar = CreateFrame("StatusBar", nil, self.Health)
    OtherHealBar:SetPoint("TOPLEFT", MyHealBar:GetStatusBarTexture(), "TOPRIGHT")
    OtherHealBar:SetPoint("BOTTOMLEFT", MyHealBar:GetStatusBarTexture(), "BOTTOMRIGHT")
    OtherHealBar:SetStatusBarTexture(TEXTUREPATH)
    OtherHealBar:SetStatusBarColor(.5, 1, .5, 0.7)

    MyHealBar:SetSize(self:GetWidth(),27)
    OtherHealBar:SetSize(self:GetWidth(),27)

    self.MyHealBar = MyHealBar
    self.OtherHealBar = OtherHealBar

    self.HealPrediction = {
    myBar = MyHealBar,
    otherBar = OtherHealBar,
    maxOverflow = 1,
    }

  3. #3
    I tried copying that into the Skaarj layout file but it's throwing an error in the line

    local MyHealBar = CreateFrame("StatusBar", nil, self.Health)

    oUF_Skaarj\Core\layout.lua:506: attempt to index global "self"(a nil value)
    oUF_Skaarj\Core\layout.lua:506:in main chunk
    Last edited by Candiman; 2013-01-10 at 07:32 PM.

  4. #4
    ah, what is his healthbar called?

    he might not be using self.Health so hooking it to that will obviously not work :P sorry

  5. #5
    From what I can see he does use self.Health which has me kind of confused. This is the first time I've heavily edited an oUF layout and it has gone pretty well up to now but this just has me totally frustrated.

    By the way my wife and I both love your UI and if we hadn't seen it in the Post your UI thread I'd probably not have decided to change my own UI but I'm glad I did.

    edit-

    Wanted to say that if I add local "Healcomm = function(self)" at the start and "end" at the end it doesn't throw an error but doesn't show incoming heals either.

    Oh and I have no idea what everyone thinks of me dropping from the roof in IF to test this. They must think I'm nuts.
    Last edited by Candiman; 2013-01-10 at 07:50 PM.

  6. #6
    Downloaded the layout, can't see anything wrong tbh.. but it sure does not work :-)

    He codes a little different from what im used to and im not a coding expert, but you're probably better off reporting to the author that it's not working!

    Good luck!

  7. #7
    I have posted in the WoWInterface thread for the addon but the author hasn't posted there in a while. While I have you here I don't suppose you'd share your oUF layout so I could have a go at customising it and possibly use it instead of oUF_Skaarj. I totally understand if you don't want to. By the way I know you use a modified oUF Phanx but what do you use for raid frames? Are they oded in oUF or is it another addon as I know Phanx doesn't have raid frames as standard and that's the only thing that stopped me from using it as a base for my UI.

    Thanks for the help with Skaarj I guess I either need to do without incoming heals or be prepared to lose a lot of hair trying to figure it out

  8. #8
    I used to have my oUF(oUF_NIN) layout public for about 3 years, but recently removed it due to a couple things.

    I'll drop you a present in PM so you have something to play around with

  9. #9
    I have sort of got this working.

    local Healcomm = function(self)
    self.MyHealBar = createStatusbar(self.Health, cfg.texture)
    self.MyHealBar:SetPoint('TOPLEFT', self.Health:GetStatusBarTexture(), 'TOPRIGHT')
    self.MyHealBar:SetPoint('BOTTOMLEFT', self.Health:GetStatusBarTexture(), 'BOTTOMRIGHT')

    self.OtherHealBar = createStatusbar(self.Health, cfg.texture)
    self.OtherHealBar:SetPoint('TOPLEFT', self.Health:GetStatusBarTexture(), 'TOPRIGHT')
    self.OtherHealBar:SetPoint('BOTTOMLEFT', self.Health:GetStatusBarTexture(), 'BOTTOMRIGHT')

    self.MyHealBar:SetStatusBarColor(.5, 1, .5,.7)
    self.OtherHealBar:SetStatusBarColor(.5, 1, .5, 0.7)

    if self.unit == "raid" then
    self.MyHealBar:SetWidth(42)
    self.OtherHealBar:SetWidth(42)
    elseif self.unit == "pet" or self.unit == "targetoftarget" then
    self.MyHealBar:SetWidth(110)
    self.OtherHealBar:SetWidth(110)
    else
    self.MyHealBar:SetWidth(220)
    self.OtherHealBar:SetWidth(220)
    self.HealPrediction = {
    myBar = self.MyHealBar,
    otherBar = self.OtherHealBar,
    maxOverflow = 1,}
    end
    end

    This shows an incoming heal bar on my frames but it shows up as the same length on all the frames so the heal prediction is wrong on all frames escept the player and target frames. I have no idea why it's not changing width depending on frame.

    ---------- Post added 2013-01-11 at 09:26 PM ----------

    Finally got this to work. Here's the code if anyone is interested.

    local Healcomm = function(self)
    self.MyHealBar = createStatusbar(self.Health, cfg.texture)
    self.MyHealBar:SetPoint('TOPLEFT', self.Health:GetStatusBarTexture(), 'TOPRIGHT')
    self.MyHealBar:SetPoint('BOTTOMLEFT', self.Health:GetStatusBarTexture(), 'BOTTOMRIGHT')

    self.OtherHealBar = createStatusbar(self.Health, cfg.texture)
    self.OtherHealBar:SetPoint('TOPLEFT', self.Health:GetStatusBarTexture(), 'TOPRIGHT')
    self.OtherHealBar:SetPoint('BOTTOMLEFT', self.Health:GetStatusBarTexture(), 'BOTTOMRIGHT')

    self.MyHealBar:SetStatusBarColor(.5, 1, .5,.7)
    self.OtherHealBar:SetStatusBarColor(.5, 1, .5, 0.7)

    if self.unit == "raid" then
    self.MyHealBar:SetWidth(cfg.raid.width)
    self.OtherHealBar:SetWidth(cfg.raid.width)
    elseif
    self.unit == "targettarget" or self.unit == "pet" then
    self.MyHealBar:SetWidth(cfg.target.width)
    self.OtherHealBar:SetWidth(cfg.target.width)
    else
    self.MyHealBar:SetWidth(cfg.player.width)
    self.OtherHealBar:SetWidth(cfg.player.width)
    end

    self.HealPrediction = {
    myBar = self.MyHealBar,
    otherBar = self.OtherHealBar,
    maxOverflow = 1,}

    end

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •