What does blueprints.xml need to work?

Discuss and distribute tools and methods for modding. Moderator - Grognak
User avatar
5thHorseman
Posts: 1668
Joined: Sat Mar 02, 2013 2:29 am

Re: What does blueprints.xml need to work?

Postby 5thHorseman » Tue Sep 24, 2013 2:16 am

Vhati wrote:
Vhati wrote:
5thHorseman wrote:The problem is, the blueprints.xml that comes with the game also fails to validate XML. You can't find an error that will hurt FTL with a validator, at least not most of the time.

That's exactly the sort of thing I was hoping to find.
I would've thought the sloppy parser might accept that, but that the strict one would choke and hint at the location (that it'd be treated as an extraneous mismatched closing tag).

Uhh... I just dropped the file from google drive into an empty folder named data, zipped it, and I got this from SMM's Validate.


Oh, sorry. I didn't know you were using (or that there was) an FTL-specific xml validation tool in Slipstream. I just used the more generic method of validating the xml itself. The tool I had handy (Firefox) only lists the first error it finds and I didn't fix that error and re-validate so there may have been more.
My Videos - MY MOD HUB
Simo-V - The Potential - Automated Scout - "Low O2" Icons
The Black Opal - The Asteroid - The Enforcer - The Pyro

"Every silver lining has a cloud..."
Vhati
Posts: 792
Joined: Thu Oct 25, 2012 12:01 pm

Re: What does blueprints.xml need to work?

Postby Vhati » Tue Sep 24, 2013 3:10 am

5thHorseman wrote:Oh, sorry. I didn't know you were using (or that there was) an FTL-specific xml validation tool in Slipstream.


And it gets really convenient when repeatedly run from commandline, or double-clickable script, between edits...
modman.exe --validate "MyNotYetZippedModInAFolder"


*Revises the readme to add that tip.*
User avatar
kartoFlane
Posts: 1488
Joined: Mon Jan 14, 2013 10:20 pm

Re: What does blueprints.xml need to work?

Postby kartoFlane » Wed Sep 25, 2013 10:02 am

XionGaTaosenai wrote:So how come it detected the error with the Medbay, and then nothing else after I fixed that?

Mostly due to the specificness of the sloppy parser that the error checker and SMM use. The multiple unclosed <crewBlueprints> were opening a new nested structure each.
Since FTL tolerates mismatched opening and closing tags, the closing </image> was considered a closing tag for one of the crewBlueprints, and the image>missile_2 was considered junk characters sitting between tags.
Then any unclosed tags would be, I assume, automatically closed by the parser (since I saw some weird closing tags at the end of blueprints.xml).

Thus the code passed parsing, and then the checker went on to validate all that...

First two files went without trouble, because they were formed as expected.
But then it went to validate blueprints.xml - the reason for the missing blueprint errors was that everything in it was inside a <crewBlueprint> or some other tag, so they were considered as children tags, not top-level tags visible between files.

Why it caught the medbay error, I'm not exactly sure... But the validate code works recursively, so it's possible that it somehow reached the bellows of the nested structure and managed to validate something, so it triumphally registered the error.

The unexpected error that crashed the validation process and should've popped up a window, occured somewhere near the end of the file, but it was relatively unrelated to the problems mentioned in previous posts.
Superluminal2 - a ship editor for FTL
speedoflight
Posts: 660
Joined: Mon Feb 18, 2013 11:08 am

Re: What does blueprints.xml need to work?

Postby speedoflight » Wed Sep 25, 2013 1:58 pm

One thing, there are a lot of errors in the original vanilla blueprints files, such bad referenced names and such. But that is not wat is causing the problems, since that is the original code, the creators of FTL just messed up some code lines, but apparently they work. Thats not the problem. The Error checker detects tons of errors like that, but i play FTL since i can remember with those issues and i never had a problem. Its weird, but if the FTL original blueprints file is made that way, and it works, well better to leave it alone xD.
My currently mods / wips ->
ImageImage
XionGaTaosenai
Posts: 36
Joined: Wed Nov 14, 2012 6:04 pm

Re: What does blueprints.xml need to work?

Postby XionGaTaosenai » Wed Sep 25, 2013 2:19 pm

Just to keep people updated, I got everything working fine now. I'm hitting a minor visual issue, but it probably has nothing to do with anything here so I'll be asking about it in the general modding thread. Other than that, everything's peachy. Thanks for all the help!
User avatar
kartoFlane
Posts: 1488
Joined: Mon Jan 14, 2013 10:20 pm

Re: What does blueprints.xml need to work?

Postby kartoFlane » Wed Sep 25, 2013 2:34 pm

@speedoflight
It's mostly because the problems are located in parts of the xml that is never accessed by the game -- such as STARTING and (I assume) STANDARD weapon/drone/augment lists.

Some of it may be caused by the fact that every single error pattern has to be explicitly coded by me. Since I'm depending on the knowledge gathered by the community, it's possible some of the assumptions are just wrong or incomplete.

@Xion
Glad to hear it :)
Superluminal2 - a ship editor for FTL