What does blueprints.xml need to work?

Discuss and distribute tools and methods for modding. Moderator - Grognak
XionGaTaosenai
Posts: 36
Joined: Wed Nov 14, 2012 6:04 pm

What does blueprints.xml need to work?

Postby XionGaTaosenai » Mon Sep 23, 2013 4:40 pm

One day, on a whim, I got mildly irritated with having to scroll through all the dummied out content that littered blueprints.xml, and with nothing better to do that afternoon, I made a new file and rewrote blueprints.xml from scratch. Predictably, the game failed to work when I tried to run it with this new file. After running it through Karto's error checker, I found I had made a typo (<medbay power="1" room=10"" start="true" img="room_medbay"> instead of <medbay power="1" room="10" start="true" img="room_medbay">). When I fixed the typo and rechecked, the results were strange.

blueprints.xml was fine. No bugs there. But autoBlueprints, and all the event stuff, was turning up errors. "Referenced Blueprint name does not exist" errors, and they were everywhere.

What seems to be happening is that my rewritten blueprints.xml is missing something, and whatever that something is, it makes all the other data files refuse to acknowledge it exists, so they crash the game and complain about "nonexistant" data. The Error checker read it just fine (or else I wouldn't have gotten the error about the typo when placing a medbay), but the rest of the data files just don't want to play with it.

So what does blueprints.xml need in order for the rest of the data files to recognize it as blueprints.xml?
User avatar
kartoFlane
Posts: 1488
Joined: Mon Jan 14, 2013 10:20 pm

Re: What does blueprints.xml need to work?

Postby kartoFlane » Mon Sep 23, 2013 5:40 pm

That depends on what you did. From what you described, it looks like you deleted nearly everything from blueprints.xml, and inserted only a single shipBlueprint -- that will break the game.

In the checker, every error points you to the place where it originated, what caused it (double click the error in the table to view it) -- it's quite possible that you removed a blueprint that is referenced from another file, which causes the game to crash, since it tries to load a resource that does not exist.

You can't just delete crucial data willy-nilly and expect the game to work.

It's best not to delete anything other than comments from the vanilla files, and restrict yourself to fixing typos/invalid XML, or if you're creating mods - just use the .append extension.
Superluminal2 - a ship editor for FTL
XionGaTaosenai
Posts: 36
Joined: Wed Nov 14, 2012 6:04 pm

Re: What does blueprints.xml need to work?

Postby XionGaTaosenai » Mon Sep 23, 2013 5:53 pm

Oh no, I never did anything so drastic. There's a full 18 ships and everything, and all the actually used data should be there. I'll get some screenshots of what I mean up, give me just a moment.
XionGaTaosenai
Posts: 36
Joined: Wed Nov 14, 2012 6:04 pm

Re: What does blueprints.xml need to work?

Postby XionGaTaosenai » Mon Sep 23, 2013 6:07 pm

Image
Image

Issues where the game tries to call something that I actually removed (like the Leto missiles), I can understand crashing the game, and I can fix that by removing all instances where Leto Missiles are called, and it works just fine. I've done that before. What's happening here is that there are weapons that are perfectly fine in the blueprints, but all the other files refuse to acknowledge that it's there.
Vhati
Posts: 792
Joined: Thu Oct 25, 2012 12:01 pm

Re: What does blueprints.xml need to work?

Postby Vhati » Mon Sep 23, 2013 6:33 pm

The XML parser might be getting confused and ignoring chunks of your document during the patch process.

Does SMM's "Validate" have anything interesting to say?

Digging deeper...

  • Use SMM to apply your mod. (Don't run the game, obviously)
  • Then from the file menu, "Extract Dats" would let you see what FTL actually sees.
    .
  • But the next menu item down, "XML Sandbox", is faster. It'll instantly show the parser's interpretation of your already-patched blueprints.xml, straight out of the dat.

See if you can find discrepancies, like the missing weapons.
Last edited by Vhati on Mon Sep 23, 2013 6:37 pm, edited 2 times in total.
User avatar
kartoFlane
Posts: 1488
Joined: Mon Jan 14, 2013 10:20 pm

Re: What does blueprints.xml need to work?

Postby kartoFlane » Mon Sep 23, 2013 6:36 pm

Very odd indeed. Are there any errors in any of the files after autoBlueprints? Specifically, sector_data.xml should have some errors about start beacon / track list tags missing, unless you manually fixed those.

Also, check the checker's directory for parse_stacktrace.log -- it's likely that an error occured during patching, and the info window didn't pop up for whatever reason...
Superluminal2 - a ship editor for FTL
XionGaTaosenai
Posts: 36
Joined: Wed Nov 14, 2012 6:04 pm

Re: What does blueprints.xml need to work?

Postby XionGaTaosenai » Mon Sep 23, 2013 6:42 pm

If you mean the error checker, presumably I'm seeing what the XML parser sees in the window. Right?

Or is an XML parser how SMM works? I've never used SMM or even GMM: I've just been unpacking and packing the files using ftldat via command prompt. It's never failed me until now, and I've been messing around in this game for almost a year.

Very odd indeed. Are there any errors in any of the files after autoBlueprints? Specifically, sector_data.xml should have some errors about start beacon / track list tags missing, unless you manually fixed those.


All of the event files have the same issue: whenever any file refers to a blueprint that is supposed be in to and is in blueprints.xml, the game behaves as if that blueprint isn't there.

It remains silent about sector_data. I've seen the bug you are referring to (it's in the unchanged data files, right?), and as long as the program is giving me 200 errors in autoBlueprints, it remains silent about everything else save for what it says is a syntax error in tooltips and some stuff in animations. It was only when I tried to fix and accidentally broke autoBlueprints with a typo did the checker bring up even the events bugs.
Vhati
Posts: 792
Joined: Thu Oct 25, 2012 12:01 pm

Re: What does blueprints.xml need to work?

Postby Vhati » Mon Sep 23, 2013 7:12 pm

XionGaTaosenai wrote:If you mean the error checker, presumably I'm seeing what the XML parser sees in the window. Right?
Oops, I forgot about that giant text area. :lol:
IIRC the Error Checker shows you the actual file from the dat, with no interpretation. But it uses an XML parser to create an invisible representation, which is what actually gets scrutinized for problems.

XionGaTaosenai wrote:Or is an XML parser how SMM works? I've never used SMM or even GMM
The Error Checker basically adds layers of code on top of a custom parser from Slipstream. I'd mistakenly assumed you used the mod manager to patch, so I figured something there broke the game.

Still, the "sandbox" feature prints the invisible representation back to the screen, so you could see what the Error Checker might be thinking. You've got two possibly different problems: FTL doesn't like the file, and the Error Checker doesn't like the file (the checker doesn't alter anything, so a bug in the checker wouldn't break the game).


Slipstream's got a "Validate" feature to find subtle syntax mistakes in the XML that could trip up either FTL or the parser.
XionGaTaosenai
Posts: 36
Joined: Wed Nov 14, 2012 6:04 pm

Re: What does blueprints.xml need to work?

Postby XionGaTaosenai » Mon Sep 23, 2013 7:37 pm

This mod doesn't append. It clobbers.


I don't think Slipstream likes me very much
User avatar
kartoFlane
Posts: 1488
Joined: Mon Jan 14, 2013 10:20 pm

Re: What does blueprints.xml need to work?

Postby kartoFlane » Mon Sep 23, 2013 7:43 pm

Well, the program started displaying errors, which means it completed parsing successfully and moved on to validation... And then it stops at autoBlueprints, meaning, there's an error there - probably a mistyped arg or something that the checker assumes to be present.

XionGaTaosenai wrote:...it remains silent about everything else save for what it says is a syntax error in tooltips and some stuff in animations...

Confirms my suspicion. I had this several times during testing -- never really noticed a pattern why it happens, but I think it should be the error that caused the checker to spill its guts. If you double click it, it'll probably crash the app.
The line should correspond to the erroneous line in autoBlueprints.

Hm. I think it'd be quickest if you just sent the me your mod so I can see where it fails, and fix the bug...
Superluminal2 - a ship editor for FTL