Lone Wolf Development Forums

Lone Wolf Development Forums (http://forums.wolflair.com/index.php)
-   HL - Authoring Kit (http://forums.wolflair.com/forumdisplay.php?f=58)
-   -   Invalid Alignment Specifications? (http://forums.wolflair.com/showthread.php?t=50582)

sincla September 4th, 2014 04:17 PM

Invalid Alignment Specifications?
 
The compiler is constantly throwing an "Invalid Alignment Specification" error over the following position script, and I have no idea why. The problem is on line 8, aligning portal[name] to the right of portal[level]:

Code:

        <position><![CDATA[
1
2                ~center the portals vertically
3                perform portal[level].centervert
4                perform portal[name].centervert
5                perform portal[HP].centervert
6         
7                perform portal[level].alignedge[left,3]
8                perform portal[name].alignrel[ltor,level,3]
9                perform portal[HP].alignedge[right,-3]
                ]]></position>

This has worked in other scripts including one in the same file and I can't find any documentation on what constitutes invalid alignment specifications.

Driving me crazy! Any insights?

sincla September 4th, 2014 05:52 PM

Got it! The "Invalid Alignment Specification" was because the portal definition was invalid. After deleting everything in the position script, the new error message was that I did not have the required "additem" element for my dynamic table that contained this template. Though the documentation said this element was optional.

I added an "additem" script to the table element. It then told me that the portals "level" and "HP" were referencing fields that were not present in the compset. This confused me because the compset was exactly the one I wanted. So I want to check the definition of the compset in the structure files, and lo and behold I had the wrong component name in the compref element.

It's instructive how you can't really always rely on the final error message given to you, but have to work your way backwards by eliminating one-by-one the things throwing error messages until you find the root cause which could be a different error message entirely.

sincla September 4th, 2014 11:04 PM

There's also an additional issue it seems. A template within a table doesn't seem to have a well-defined width or edge and so you can't use an alignedge reference without throwing errors with a template in a table.

Colen September 5th, 2014 09:30 AM

The "additem" element is optional, but if you don't specify it for a dynamic table, you have to specify an "addtemplate" attribute with the portal id. You always need one or the other.

It does sound like the error messages here are quite unhelpful, so I'll put this on the bug list to improve in a future release.

I regularly use alignedge on templates within tables, so something like you posted above:

perform portal[HP].alignedge[right,-3]

Should work fine, as far as I know. If you comment out the line with the alignedge statement, do you get a different error, or is the error definitely with that line?

sincla September 5th, 2014 09:40 AM

Quote:

Originally Posted by Colen (Post 192290)
The "additem" element is optional, but if you don't specify it for a dynamic table, you have to specify an "addtemplate" attribute with the portal id. You always need one or the other.

It does sound like the error messages here are quite unhelpful, so I'll put this on the bug list to improve in a future release.

I regularly use alignedge on templates within tables, so something like you posted above:

perform portal[HP].alignedge[right,-3]

Should work fine, as far as I know. If you comment out the line with the alignedge statement, do you get a different error, or is the error definitely with that line?

I have an addtemplate set up for this table, so that's all good.

The align statements still don't work, so I had to position the portals horizontally by simply adding spacing.

I copied those align statements back in to do testing as you requested.

I got the same "Invalid alignment specification given" for the

Code:

perform portal[name].alignrel[ltor,level,3]
line.

I then commented out that line but still got the same error.

I then commented out the remaining alignedge lines one by one and got the same "Invalid alignment specification given" error message. Based on your response, I now don't know why it's happening.


All times are GMT -8. The time now is 06:33 AM.

Powered by vBulletin® - Copyright ©2000 - 2024, vBulletin Solutions, Inc.
wolflair.com copyright ©1998-2016 Lone Wolf Development, Inc. View our Privacy Policy here.