If that's all it reported, you DO have valid XML, both in the eyes of a strict parser and the custom sloppy parser that tries to mimic FTL's typo tolerance.XionGaTaosenai wrote:This mod doesn't append. It clobbers.
What does blueprints.xml need to work?
-
- Posts: 792
- Joined: Thu Oct 25, 2012 12:01 pm
Re: What does blueprints.xml need to work?
-
- Posts: 36
- Joined: Wed Nov 14, 2012 6:04 pm
Re: What does blueprints.xml need to work?
Wow, really? I never thought anyone would offer to do that. Thanks!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...
I uploaded my blueprints.xml file to Google Drive. It'll be in no position to actually run the game with just that replacing the default, but hopefully it's enough to help you find out what's going wrong.
If you need anything else, like a .ftl file, I can provide. Should I just place the changed stuff in, or the entirety of data.dat/resource.dat in the .ftl file?
-
- Posts: 36
- Joined: Wed Nov 14, 2012 6:04 pm
Re: What does blueprints.xml need to work?
I double-clicked the syntax error in tooltips, and it didn't crash the app, instead just highlighting the copyright notice at the top of the tooltips file, saying something about an "unexpected exception:null".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.
- 5thHorseman
- Posts: 1665
- Joined: Sat Mar 02, 2013 2:29 am
Re: What does blueprints.xml need to work?
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.XionGaTaosenai wrote:I double-clicked the syntax error in tooltips, and it didn't crash the app, instead just highlighting the copyright notice at the top of the tooltips file, saying something about an "unexpected exception:null".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.
I made the XML valid (by removing the copyright notice and adding a huge wrapper around the rest of the file like you need to to make a valid XML file) and found the problem. It's just after line 600. Search for the text:
image>missile_2</image>
and make it:
<image>missile_2</image>
For reference, here's how I changed the first few lines:
Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2012 by Subset Games. All rights reserved -->
<!--**********ITEM BLUEPRINTS**********-->
<stuff>
<itemBlueprint name="fuel">
...
Code: Select all
...
</shipBlueprint>
</stuff>
NOTE! Don't make all those changes to your blueprints. That was just to get the validator to work. Only make that change to the image tag.
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..."
Simo-V - The Potential - Automated Scout - "Low O2" Icons
The Black Opal - The Asteroid - The Enforcer - The Pyro
"Every silver lining has a cloud..."
- kartoFlane
- Posts: 1488
- Joined: Mon Jan 14, 2013 10:20 pm
Re: What does blueprints.xml need to work?
Alright, looks like I messed up and put the code informing about the error in the wrong place... That's why it'd never show up, and no log would be created. Fixed
Also, found the culprits:
Missing forward slash (affects all crewBlueprint tags):
<image> is missing opening triangle bracket (causing whole world o' hurt):
Some of your weapons are also missing <weaponArt> tags, but that's something the checker will be able to detect.
Also, found the culprits:
Missing forward slash (affects all crewBlueprint tags):
Code: Select all
<crewBlueprint name="human">
<title>Human</title>
<short>Human</short>
<desc>Humans are common and uninteresting.</desc>
<cost>40</cost>
<rarity>1</rarity>
<powerList>
<power>No exceptional traits</power>
</powerList>
<crewBlueprint> <------ missing forward slash
Code: Select all
<weaponBlueprint name="MISSILES_2_PLAYER">
<type>MISSILES</type>
<title>Missiles!</title>
<short>Missile</short>
<desc>Missiles go right through enemy ships, but use up limited ammo. Don't run out!</desc>
<tooltip>Fires 1 missile that does 2 damage, Uses 1 missile</tooltip>
<damage>2</damage>
<shots>1</shots>
<sp>5</sp>
<fireChance>0</fireChance>
<breachChance>0</breachChance>
<cooldown>11</cooldown>
<power>1</power>
<missiles>1</missiles>
<cost>40</cost>
<rarity>0</rarity>
image>missile_2</image> <----------- missing opening triangle bracket
<launchSounds>
<sound>smallMissile1</sound>
<sound>smallMissile2</sound>
</launchSounds>
<hitShipSounds>
<sound>smallExplosion</sound>
</hitShipSounds>
<hitShieldSounds>
<sound>hitShield1</sound>
<sound>hitShield2</sound>
<sound>hitShield3</sound>
</hitShieldSounds>
<missSounds>
<sound>miss</sound>
</missSounds>
<weaponArt>missiles_1</weaponArt>
</weaponBlueprint>
Superluminal2 - a ship editor for FTL
-
- Posts: 792
- Joined: Thu Oct 25, 2012 12:01 pm
Re: What does blueprints.xml need to work?
That's exactly the sort of thing I was hoping to find.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.
Search for the text:
image>missile_2</image>
and make it:
<image>missile_2</image>
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).
I consider it a bug in the Validate feature that this wasn't listed.
I'll see if I can add a check for this.
Last edited by Vhati on Tue Sep 24, 2013 1:21 am, edited 1 time in total.
-
- Posts: 36
- Joined: Wed Nov 14, 2012 6:04 pm
Re: What does blueprints.xml need to work?
Alright, everything's going smoothly now. There are a few errors I still need to fix, but the Error Checker is working right again and my plans can continue hopefully without another hitch. Thanks for the help, and thanks for making the error checker in the first place; it's going to be a godsend for me.
So how come it detected the error with the Medbay, and then nothing else after I fixed that?
So how come it detected the error with the Medbay, and then nothing else after I fixed that?
Last edited by XionGaTaosenai on Tue Sep 24, 2013 1:39 am, edited 1 time in total.
-
- Posts: 792
- Joined: Thu Oct 25, 2012 12:01 pm
Re: What does blueprints.xml need to work?
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.Vhati wrote:That's exactly the sort of thing I was hoping to find.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.
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).
Code: Select all
> data/blueprints.xml
~ Strict XML Parser Issues:
! <?xml... ?> should only occur on the first line.
! <persDamage...>...</persdamage>
! <shipBlueprint>...</ship>
! Fix this and try again:
org.jdom2.input.JDOMParseException: Error on line 604: The element type "weaponBlueprint" must be terminated by the matching end-tag "</weaponBlueprint>".
~ ~ ~ ~ ~
image>missile_2</image>
~ ~ ~ ~ ~
~ This mod doesn't append. It clobbers.
And adding the missing bracket, changes the report to this...
Code: Select all
> data/blueprints.xml
~ Strict XML Parser Issues:
! <?xml... ?> should only occur on the first line.
! <persDamage...>...</persdamage>
! <shipBlueprint>...</ship>
! Fix this and try again:
org.jdom2.input.JDOMParseException: Error on line 2114: The element type "weap
onList" must be terminated by the matching end-tag "</weaponList>".
~ ~ ~ ~ ~
</weaponlist>
~ ~ ~ ~ ~
~ This mod doesn't append. It clobbers.
Code: Select all
! Fix this and try again:
org.jdom2.input.JDOMParseException: Error on line 2167: The element type "weap
onList" must be terminated by the matching end-tag "</weaponList>".
~ ~ ~ ~ ~
</weaponlist>
~ ~ ~ ~ ~
Seeing a pattern, I fix all the weaponLists...
Code: Select all
! Fix this and try again:
org.jdom2.input.JDOMParseException: Error on line 3248: The element type "crew
Blueprint" must be terminated by the matching end-tag "</crewBlueprint>".
~ ~ ~ ~ ~
</wrapper>
~ ~ ~ ~ ~
Code: Select all
<crewBlueprint name="human">
<title>Human</title>
<short>Human</short>
<desc>Humans are common and uninteresting.</desc>
<cost>40</cost>
<rarity>1</rarity>
<powerList>
<power>No exceptional traits</power>
</powerList>
<crewBlueprint>
This pattern is repeated for all crewBlueprints...
Fixing those, it finally reports nothing.
Last edited by Vhati on Tue Sep 24, 2013 1:56 am, edited 2 times in total.
-
- Posts: 36
- Joined: Wed Nov 14, 2012 6:04 pm
Re: What does blueprints.xml need to work?
It was probably a mistake on my part; I probably made the .ftl file wrong, and I didn't bother to reinstall FTL so that SMM would work properly. I just threw it up halfheartedly to see if it caught anything that the Error Checker didn't, and I thought that comment was funny.So it IS working as intended.
Doing what Karto suggested and installing the updated Error Checker fixed the hurdle I was dealing with, so I'll probably have everything going fine shortly. Thank you all for the help!
-
- Posts: 792
- Joined: Thu Oct 25, 2012 12:01 pm
Re: What does blueprints.xml need to work?
I should add...
SMM always adds <wrapper>...</wrapper> under the hood, just to get parsers to look at FTL's resources.
Adding your own wrapper has no effect.5thHorseman wrote:I made the XML valid (by removing the copyright notice and adding a huge wrapper around the rest of the file like you need to to make a valid XML file)
[...]
EDIT:
That was just to get the validator to work.
SMM always adds <wrapper>...</wrapper> under the hood, just to get parsers to look at FTL's resources.