Thread Tools Display Modes
07-22-10, 03:57 PM   #1
iNoob
A Deviate Faerie Dragon
Join Date: Jul 2010
Posts: 15
Embedding - Hmm..

No matter what layout im trying to do this with, I simply cant get it to work. The layout will throw a lua error (as if oUF wasn't there(which it isn't, I wanna embed it))

Any idea what I am doing wrong? I know it's not a hella' lotta' info, but I'm doing exactly as you are instructing me to
  Reply With Quote
07-22-10, 08:53 PM   #2
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
Originally Posted by iNoob View Post
No matter what layout im trying to do this with, I simply cant get it to work. The layout will throw a lua error (as if oUF wasn't there(which it isn't, I wanna embed it))

Any idea what I am doing wrong? I know it's not a hella' lotta' info, but I'm doing exactly as you are instructing me to
How are you trying to do this? It's not like we know anything about what you've tried and what you've done.

To me it just sounds like you aren't loading the oUF core files before the layout in your embed setup. That's really all the help I can give you based on the information you've posted.
__________________
「貴方は1人じゃないよ」
  Reply With Quote
07-23-10, 12:54 AM   #3
Mischback
A Cobalt Mageweaver
 
Mischback's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2009
Posts: 221
The guide is very helpfull, so if you followed the instructions, you should be fine...

I simply added
Code:
## X-oUF: PSoUF

PSoUF\oUF.xml
in my .toc and
Code:
local oUF = ns.oUF or oUF
assert(oUF, "<name> was unable to locate oUF install.")
in my layout-file.

The folder PSoUF is a copy of the original oUF-folder, only renamed it, nothing changed in the sources (k, I have changed something in there, otherwise there would be no need to embed oUF, but it has nothing to do with the embedding itsself).
  Reply With Quote
07-23-10, 02:19 PM   #4
Sojik
A Wyrmkin Dreamwalker
 
Sojik's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 53
Originally Posted by Mischback View Post
(k, I have changed something in there, otherwise there would be no need to embed oUF, but it has nothing to do with the embedding itsself).
I can think of reasons to embed other than that. I don't think you should be distributing an edited oUF, personally.
  Reply With Quote
07-23-10, 02:25 PM   #5
Mischback
A Cobalt Mageweaver
 
Mischback's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2009
Posts: 221
Releasing a layout with a nice feature is pointless, if the feature is not working due to a known bug in oUF... So I embedded it for the current release and will thankfully remove the embedded oUF once the bug is fixed.
  Reply With Quote
07-23-10, 02:39 PM   #6
Sojik
A Wyrmkin Dreamwalker
 
Sojik's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 53
Oh, sorry for assuming the worst.
  Reply With Quote
07-25-10, 05:54 PM   #7
iNoob
A Deviate Faerie Dragon
Join Date: Jul 2010
Posts: 15
Tried your tut and the one in the forums

All it gives is this


attempt to index global 'ns' (a nil value)
  Reply With Quote
07-26-10, 01:03 AM   #8
Mischback
A Cobalt Mageweaver
 
Mischback's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2009
Posts: 221
Originally Posted by iNoob View Post
attempt to index global 'ns' (a nil value)
Obviously you have to fetch the namespace (ns) before you could do this...

Code:
local ADDON_NAME, ns = ...
  Reply With Quote
07-26-10, 04:41 AM   #9
iNoob
A Deviate Faerie Dragon
Join Date: Jul 2010
Posts: 15
I still cant get this to work, here my code in the top of the layout...

local للللللل, ns = ...
print("[Debug] UF's loaded")
local oUF = ns.oUF or oUF
assert(oUF, "<name> was unable to locate oUF install.")
  Reply With Quote
07-26-10, 04:55 AM   #10
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
Originally Posted by iNoob View Post
local للللللل, ns = ...
print("[Debug] UF's loaded")
local oUF = ns.oUF or oUF
assert(oUF, "<name> was unable to locate oUF install.")
What's up with "للللللل"?
How does your TOC look?
How does the folder and file structure look?
__________________
「貴方は1人じゃないよ」
  Reply With Quote
07-26-10, 05:56 AM   #11
Mischback
A Cobalt Mageweaver
 
Mischback's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2009
Posts: 221
Ok, let's start from the beginning:

1.create the folder structure(should look like this)
Code:
Word of Warcraft
    -> Interface
        -> AddOns
            -> YOUR_LAYOUT
                -> embedded_oUF
                    -> oUF.xml (and all the other content of the original oUF-directory)
                -> layout.lua
                -> YOUR_LAYOUT.toc
2. Edit your .toc-file, so the embedded oUF-version is used
Code:
## Interface: 30300
## Author: YOUR_NAME
## Title: YOUR_LAYOUT
## X-oUF: embedded_oUF

embedded_oUF/oUF.xml
layout.lua
Please note the "##X-oUF" and the "embedded_oUF/oUF.xml". Here's the first part of the magic!

3. Edit your layout.lua-file, so it will use the embedded oUF-version or looking for a globally visible one.
Start your layout.lua with
Code:
local ADDON_NAME, ns = ... -- get the addons namespace to exchange functions between core and layout
local oUF = ns.oUF or oUF     -- get oUF
assert(oUF, "YOUR_LAYOUT was unable to locate oUF install.")
The first-line fetches the addon-name and the addon's namespace (ns) from the vararg list.
The second line will look for oUF (it may be found in the addon's namespace, if it is embedded, or it may be globally visible, if you have a "normal" oUF-installation) and make it locally visible, so you will use the right one, when calling oUF:Spawn (for example).

Now it should work with the embedded oUF-installation.

Last edited by Mischback : 07-26-10 at 06:28 AM.
  Reply With Quote
07-26-10, 06:25 AM   #12
yj589794
A Rage Talon Dragon Guard
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 314
Originally Posted by Mischback View Post
Code:
assert(oUF, "<name> was unable to locate oUF install.")
It is advisable to change the <name> part of the error string to something unique. (like the name of your addon)
That way you can be sure that the error originated within your layout, rather than some other oUF layout/plugin that happens to use the same message.
  Reply With Quote
07-26-10, 06:28 AM   #13
Mischback
A Cobalt Mageweaver
 
Mischback's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2009
Posts: 221
*hust* fixed...
  Reply With Quote
07-26-10, 08:50 AM   #14
iNoob
A Deviate Faerie Dragon
Join Date: Jul 2010
Posts: 15
Originally Posted by haste View Post
What's up with "للللللل"?
How does your TOC look?
How does the folder and file structure look?
Whoa. I have no idea how that came out like that, I can't even make those fancy letters :P
  Reply With Quote
07-26-10, 08:58 AM   #15
iNoob
A Deviate Faerie Dragon
Join Date: Jul 2010
Posts: 15
Originally Posted by Mischback View Post
Ok, let's start from the beginning:

1.create the folder structure(should look like this)
Code:
Word of Warcraft
    -> Interface
        -> AddOns
            -> YOUR_LAYOUT
                -> embedded_oUF
                    -> oUF.xml (and all the other content of the original oUF-directory)
                -> layout.lua
                -> YOUR_LAYOUT.toc
2. Edit your .toc-file, so the embedded oUF-version is used
Code:
## Interface: 30300
## Author: YOUR_NAME
## Title: YOUR_LAYOUT
## X-oUF: embedded_oUF

embedded_oUF/oUF.xml
layout.lua
Please note the "##X-oUF" and the "embedded_oUF/oUF.xml". Here's the first part of the magic!

3. Edit your layout.lua-file, so it will use the embedded oUF-version or looking for a globally visible one.
Start your layout.lua with
Code:
local ADDON_NAME, ns = ... -- get the addons namespace to exchange functions between core and layout
local oUF = ns.oUF or oUF     -- get oUF
assert(oUF, "YOUR_LAYOUT was unable to locate oUF install.")
The first-line fetches the addon-name and the addon's namespace (ns) from the vararg list.
The second line will look for oUF (it may be found in the addon's namespace, if it is embedded, or it may be globally visible, if you have a "normal" oUF-installation) and make it locally visible, so you will use the right one, when calling oUF:Spawn (for example).

Now it should work with the embedded oUF-installation.

Thank you very much for taking your time to do this

However, it still doesn't work! - I made a new addons *just* with the UF's to be sure nothing else is interfering with it. Appereantly, theres a problem with loading oUF since it throws this:

Message: Interface\AddOns\Test\layout.lua:3: Test was unable to locate oUF install.
Time: Mon Jul 26 16:56:05 2010
Count: 1
Stack: [C]: in function `assert'
Interface\AddOns\Test\layout.lua:3: in main chunk

Locals: (*temporary) = nil
(*temporary) = "Test was unable to locate oUF install."
  Reply With Quote
07-26-10, 09:08 AM   #16
Freebaser
A Molten Kobold Bandit
 
Freebaser's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2008
Posts: 135
Originally Posted by iNoob View Post
Whoa. I have no idea how that came out like that, I can't even make those fancy letters :P
What text editor are you using?
  Reply With Quote
07-26-10, 09:42 AM   #17
Mischback
A Cobalt Mageweaver
 
Mischback's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2009
Posts: 221
Originally Posted by iNoob View Post
Whoa. I have no idea how that came out like that, I can't even make those fancy letters :P
Coming from Germany, I've got those "fancy letters" right here on my keyboard...

To your problem: I pretty much copied my current setup for you, so, if I didn't make any copy/paste-failures, it should work. Pls give us
a) your .toc,
b) your layout.lua (first lines should be sufficient) and
c) describe your folder-structure.

Another workaround to get you started: Go grab my layout, install it, and

1) edit oUF_PredatorSimple.toc (insert your name and so on, delete all listed files and keep just the reference to PSoUF/oUF.xml and then set a reference to your layout-file (layout.lua). Rename the file to "YOURADDON.toc"

2) delete the "media"-folder

3) delete "settings.lua", "lib.lua" and "core.lua"

4) KEEP the folder "PSoUF"!

5) Open up MY layout.lua, delete everything from line 14 to EOF (so keep the oUF-embedding-stuff) and paste your own layout-code.
  Reply With Quote
07-27-10, 12:16 PM   #18
iNoob
A Deviate Faerie Dragon
Join Date: Jul 2010
Posts: 15
You wont believe this...

I found the reason myself and... be ready for a full-facedesk. I USED AN ANCIENT VERSION OF oUF! - Gawd...

That was the reason the lua errors arose -.-'

Thanks for your help ^^
  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » Embedding - Hmm..

Thread Tools
Display Modes

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