Thread Tools Display Modes
09-04-10, 04:35 AM   #1
Wimpface
A Molten Giant
 
Wimpface's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 648
Tried to add raidframes, killed my layout!

I tried to add raid/party frames to my layout today, and decided to use the code of oUF_Gdx as it seemed clean, I understood it (I thought) and it looked as if it fit my needs, which it did.

But it kind of killed my layout, and I can't see what I'm doing wrong. So I come here to ask for help.

I get this error:
Code:
Message: Interface\AddOns\oUF_Haori\layout.lua:599: bad argument #1 to '(for generator)' (table expected, got nil)
Time: 09/04/10 12:29:53
Count: 1
Stack: [C]: in function `(for generator)'
Interface\AddOns\oUF_Haori\layout.lua:599: in main chunk

Locals: (*temporary) = nil
(*temporary) = nil
(*temporary) = "table expected, got nil"

Here's my code
!

Any help is _very_ appreciated.
Thanks in advance!
__________________
All I see is strobe lights blinding me in my hindsight.
  Reply With Quote
09-04-10, 04:58 AM   #2
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
unitSpecific is not the same variable as UnitSpecific.
__________________
「貴方は1人じゃないよ」
  Reply With Quote
09-04-10, 05:09 AM   #3
Wimpface
A Molten Giant
 
Wimpface's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 648
Originally Posted by haste View Post
unitSpecific is not the same variable as UnitSpecific.
Thank you very much!
__________________
All I see is strobe lights blinding me in my hindsight.
  Reply With Quote
09-04-10, 05:22 AM   #4
Wimpface
A Molten Giant
 
Wimpface's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 648
More problems.

So I don't get that error anymore, now I get this instead.
Code:
[13:17:58] Interface\AddOns\oUF_Haori\layout.lua:273: attempt to index local 'health' (a nil value)
I removed a piece of code that I saw as not needed (that also spewed errors for that matter, and it was just one line) so the new code is this:
http://pastebin.com/W3w9F1uV

Any help with this is appreciated, since I'm still learning (I've been learning for a long time. ) I can't really solve this alone. :/
__________________
All I see is strobe lights blinding me in my hindsight.
  Reply With Quote
09-04-10, 06:01 AM   #5
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
Your Shared() function is never executed. Take a look at how oUF_Lily does unit specific with a shared base.
__________________
「貴方は1人じゃないよ」
  Reply With Quote
09-04-10, 06:29 AM   #6
Wimpface
A Molten Giant
 
Wimpface's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 648
I took a look as you said, but I just can't figure it out. Sorry for asking what must seem like stupid questions to you, but I just can't get it right!

Here's the code I'm running now, and I think I might've destroyed the entire layout as I get another error now.

Code: http://pastebin.com/10kyM4sW
Error:
Code:
[14:29:15] Interface\AddOns\hUnitFrames\layout.lua:274: attempt to call global 'Shared' (a nil value)
Thanks for taking your time Haste, it's deeply appreciated!
__________________
All I see is strobe lights blinding me in my hindsight.
  Reply With Quote
09-04-10, 06:56 AM   #7
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
You have to define your Shared function above the UnitSpecific table. You can't access local variables defined further down the file like you are attempting.

The difference between your UnitSpecific solution and the one used in Lily is:
- You have several unit specific checks in your Shared function.
- You call UnitSpecific from Shared, while Lily registers each unit specific unit as a separate style and calls Shared in the unit specific function.

I'm guessing Gdx has a similar approach to unit specific as Lily has, as your mixing the two solutions with your raid layout.

In hopes to make the "flow" of the code clearer than the descriptions above:
Lily's unit specific solution: style -> UnitSpecific[unit] -> Shared
Your unit specific solution: style -> Shared -> UnitSpecific[unit]

I used the same solution as you in Lily before 1.4, but decided it would be cleaner to separate the styles as much as possible.
__________________
「貴方は1人じゃないよ」
  Reply With Quote
09-04-10, 07:11 AM   #8
Wimpface
A Molten Giant
 
Wimpface's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 648
I see. I think I understand now. Gdx does look similiar to Lily in that sense, and I certainly see it now.
Would swapping the Shared function and UnitSpecific table around make a difference? Just making one before the other?

Since I now know there's 2 ways of doing this, and I'm trying to mix them both, how would I go about creating raid frames in the way I'm doing the rest of my layout?

I'm not good enough to modify my layout as it is right now to the other way of doing it that you're doing in Lily, so if I had to do it your way I'd have to scrap my entire layout and modify oUF_Lily, which would probably take me ages.

Thanks in advance!
- Wimpface.
__________________
All I see is strobe lights blinding me in my hindsight.
  Reply With Quote
09-04-10, 07:50 AM   #9
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
1. Move Shared above UnitSpecific.
2. Remove the local keyword from UnitSpecific
3. Write the following above Shared: local UnitSpecific

That way UnitSpecific will have access to Shared and Shared will have access to UnitSpecific.
__________________
「貴方は1人じゃないよ」
  Reply With Quote
09-04-10, 08:02 AM   #10
Wimpface
A Molten Giant
 
Wimpface's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 648
Makes sense, ofcourse. Thanks for the help! I'll try it as soon as I can access my WoW account again. Blasted character transfers!

EDIT: Thanks a bunch Haste, you helped a ton!
__________________
All I see is strobe lights blinding me in my hindsight.

Last edited by Wimpface : 09-04-10 at 08:09 AM.
  Reply With Quote
09-04-10, 10:14 AM   #11
Wimpface
A Molten Giant
 
Wimpface's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 648
So I finally got in to my WoW account, got into a group to test it out and bam, error in my face and black bars forming everywhere (Yep, after around 3-4 seconds the bottom of my screen was covered and I could only see half of what was going on.) and this error kept spewing into my face. Well, it only fired once.
Code:
[18:02:49] Interface\AddOns\hUnitFrames\layout.lua:287: attempt to index local 'unit' (a nil value)
The code I'm running right now:
http://pastebin.com/tsxPmtv9

Having huge issues getting this to work. Stings a bit aswell since I'm a freshly dinged restoration shaman in need of dungeons and heroics!

Any more help is appreciated.
-Wimpface
__________________
All I see is strobe lights blinding me in my hindsight.
  Reply With Quote
09-04-10, 10:32 AM   #12
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
It's your Shared() function that gets called without a unit. I'd recommend you to disable your error add-on and use the default blizzard one instead, as it shows the entire stack + variable information.
__________________
「貴方は1人じゃないよ」
  Reply With Quote
09-04-10, 10:35 AM   #13
Wimpface
A Molten Giant
 
Wimpface's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 648
Originally Posted by haste View Post
I'd recommend you to disable your error add-on and use the default blizzard one instead, as it shows the entire stack + variable information.
I'll do so! Should I come back with the full error report?

It's your Shared() function that gets called without a unit.
I don't know how to fix this, as I thought it was what was fixed earlier!

EDIT: Pastebin seems to have died on me, so I threw up the full error report here: http://pastey.net/140369
__________________
All I see is strobe lights blinding me in my hindsight.

Last edited by Wimpface : 09-04-10 at 10:49 AM.
  Reply With Quote
09-04-10, 11:59 AM   #14
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
The issue is the following:
oUF calls your layouts style function, which is UnitSpecific.raid in this case. UnitSpecific.raid calls Shared which again calls UnitSpecific.raid, which then calls Shared, at this point the recursion stops because the call to UnitSpecific.raid from Shared was lacking the unit variable.

You need to:
a) Change UnitSpecific to always call Shared, and Shared never to call UnitSpecific. Which means converting all the entries in UnitSpecific into their own separate style.
b) Do the opposite. Make UnitSpecific.raid not call Shared and do it all through one style.
c) Prevent Shared from calling UnitSpecific.raid
__________________
「貴方は1人じゃないよ」
  Reply With Quote
09-04-10, 01:54 PM   #15
Wimpface
A Molten Giant
 
Wimpface's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 648
Originally Posted by haste View Post
The issue is the following:
oUF calls your layouts style function, which is UnitSpecific.raid in this case. UnitSpecific.raid calls Shared which again calls UnitSpecific.raid, which then calls Shared, at this point the recursion stops because the call to UnitSpecific.raid from Shared was lacking the unit variable.

You need to:
a) Change UnitSpecific to always call Shared, and Shared never to call UnitSpecific. Which means converting all the entries in UnitSpecific into their own separate style.
b) Do the opposite. Make UnitSpecific.raid not call Shared and do it all through one style.
c) Prevent Shared from calling UnitSpecific.raid
Thanks for the help! I'm going to wrestle around with it until it bends the way I want it to, and take it from there. If it doesn't bend I'll have to find an alternative.

Appreciate you taking your time!
__________________
All I see is strobe lights blinding me in my hindsight.
  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » Tried to add raidframes, killed my layout!


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off