Thread Tools Display Modes
Prev Previous Post   Next Post Next
Unread 06-10-05, 10:24 AM   #1
Beladona
A Molten Giant
 
Beladona's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2005
Posts: 539
path formatting for Script and Include within XML

I haven't seen this covered anywhere and thought I would bring it up as I was experimenting with it.

I am extremely logical in the way I organize things, including file structures. As a result, it absolutely kills me to have 5 or 6 xml and lua scripts in the root directory of my mod, with varying names that just makes the directory look cluttered and badly organized. So I have taken to "tidying up" the directory structure. That I tried to do is this:

Took an existing mod with no bugs that I created (yet to be released) and threw all of my xml and lua scripts into a subdirectory called source. Graphics are in a subdirectory called artwork, and hopefully, this structure is what I plan to use in all my future addons. Then in the root I have my toc file, and a single xml file called manifest.xml which contains Script and Include directives to bring in my scripts and xml files from the source directory. Basically it looks like this:

MyMod/MyMod.toc
MyMod/manifest.xml
MyMod/artwork/image files....
MyMod/source/xml and lua files.....

The problem I ran into is this:
Include uses relative path to the addon directory, so you can use source\file.xml as the path.
Script however does one of two things. It allows you to use a file in the same directory as the file you are including it with OR you must use the full path to the file, just like when you define images. So for this instance, it would be Interface\AddOns\myMod\source\script.lua

I tried numerous ways of doing it, including the following:
source\script.lua
.\source\script.lua

None seemed to work, except the full path mentioned above. What I am asking here I guess, is if anyone else has had experience with Script paths that are not in the same directory as the toc file. Is there an easier way to do it? I would have preferred it to use the same directory pathing as Include, but it doesn't want to. Not sure I should even worry about it, because it DOES work using the full path, it just isn't the way I would have preferred.

On a side note, Include does NOT take full pathing like Script does, it only takes relative.

Last edited by Beladona : 06-10-05 at 10:27 AM.
Beladona is offline   Reply With Quote
 

Go BackWoWInterface » Developer Discussions » Lua/XML Help » path formatting for Script and Include within XML

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