[Tool] FTL Error Checker

Discuss and distribute tools and methods for modding. Moderator - Grognak
User avatar
kartoFlane
Posts: 1470
Joined: Mon Jan 14, 2013 10:20 pm

[Tool] FTL Error Checker

Postby kartoFlane » Thu Aug 08, 2013 1:02 am

.
FTL ErrorChecker - a problem detector for FTL mods

Image


About

As is commonly known, modding FTL is a pain. It's very easy to make a mistake, and unproportionately hard to find and fix it. And even if everything seems to be correct, the game still crashes, for no apparent reason.

This tool is intended to help with that.

The name gives it all away - it's a utility that parses the game's archvies and looks for errors or mistakes - both the blatant and the obscure ones - and displays them to the user, to help with debugging of installed mods.
SleeperService has been unwittingly tricked into testing this utility for me (Image), and said that it, I quote, "makes excessive modding so much more comfortable".


Download

Important: The editor requires at least Java 6 in order to run.

[ FTL ErrorChecker 0.1 Alpha ]

Source code is available at Github.


Setup

    Installation:
  • Unpack the program anywhere.

    Running:
  • Don't double-click on the .jar file. Use one of the launchers instead:
    • For Windows users:
      - Double-click on run.bat. If that doesn't work, make sure Java is installed correctly.
    • For Linux/Mac users:
      - Double-click on run.sh (Linux) or run.command (Mac)
      - If that doesn't work, open the Terminal, drag the script file onto it, and press Enter.

    Setup:
  • When running for the first time, the program will attempt to find FTL installation.
    Most of the time this should be located automatically, and you'll only be asked for confirmation,
    but in the rare case that it fails, you'll have to locate FTL installation yourself.

    How To Use:
  • Install the mod you wish to check with SMM.
  • Run the ErrorChecker (or, if it's already running, press the "refresh" button)
  • Press the "parse" button
There are some errors in FTL's vanilla files that are not your mod's fault -- you can ignore
them, they're mostly harmless. If you can't distinguish between them and those caused by your
mod, run the Checker against clean, unmodded FTL first.


Troubleshooting

In case of problems, ask here in this thread.


Database Improvements & Suggestions

If you have dabbled with the checker's scripted database and improved some of the code, or added a script that verifies some aspect of a mod, please share it -- I can't possibly know all of FTL's quirks, so all help is appreciated.
Last edited by kartoFlane on Sun Aug 28, 2016 2:34 pm, edited 24 times in total.
Superluminal2 - a ship editor for FTL
User avatar
Sleeper Service
Posts: 2305
Joined: Sun Mar 24, 2013 8:49 pm

Re: [Tool] FTL Error Checker

Postby Sleeper Service » Thu Aug 08, 2013 8:48 am

As mentioned in the op: I tested this this thing and it is the one single reason Captains Edition runs stable now. It's pure modding gold.

Tools for event or blueprint creation have been requested some times. But I really think this tool here already does a great job with making modding more accessible and secure. No more bug tracing by endless trial and error ever again... no matter how big the mod.
Last edited by Sleeper Service on Thu Aug 08, 2013 10:09 am, edited 2 times in total.
UltraMantis
Posts: 2141
Joined: Thu Sep 20, 2012 3:17 pm

Re: [Tool] FTL Error Checker

Postby UltraMantis » Thu Aug 08, 2013 9:57 am

Oooh, you're going to spoil us rotten :D :D

Thanks for writing this tool, error checking a sea of xml is maddening.
Report spam using the handy Report Button Mod.
speedoflight
Posts: 660
Joined: Mon Feb 18, 2013 11:08 am

Re: [Tool] FTL Error Checker

Postby speedoflight » Thu Aug 08, 2013 12:38 pm

Nice!. This will be really really helpful for a lot of people.

1 question, is this tool able to detect mistakes in events that are not related to syntaxis or bad referenced parent lines?? for example, bad position of an event line (that will not make the game crash but the event will just not work) or a bad structure of an event (yup, this is hard to detect, but again, it will not cause the game to crash, just the event will not work, and it could affect other events, since the ftl event engine becomes crazy after that).
My currently mods / wips ->
ImageImage
User avatar
kartoFlane
Posts: 1470
Joined: Mon Jan 14, 2013 10:20 pm

Re: [Tool] FTL Error Checker

Postby kartoFlane » Thu Aug 08, 2013 12:53 pm

speedoflight wrote:bad position of an event line (that will not make the game crash but the event will just not work) or a bad structure of an event

That's rather broad. What exactly do you mean? An example of badly structurized event?

The checker will tell if you an event if is missing a required tag, or an obligatory attribute, or when a number is negative when it's not supposed to, among some other things. Also, when an event termination tag (<store/>, <quest/>, <event/>) is not last in a nested structure.
Events referencing their ancestors (creating a loop) is not successfully implemented yet.
Superluminal2 - a ship editor for FTL
Vhati
Posts: 792
Joined: Thu Oct 25, 2012 12:01 pm

Re: [Tool] FTL Error Checker

Postby Vhati » Fri Sep 13, 2013 11:21 pm

kartoFlane wrote:New version currently in development:
  • Uses a [proper] XML parser from Vhati's SMM, which is basically as tolerant as FTL's own parser.

A proper XML parser wouldn't be tolerant...
How about "more robust", if you mean relative to the Error Checker's current parser. ;)
User avatar
kartoFlane
Posts: 1470
Joined: Mon Jan 14, 2013 10:20 pm

Re: [Tool] FTL Error Checker

Postby kartoFlane » Fri Sep 13, 2013 11:38 pm

Good point :lol:
Superluminal2 - a ship editor for FTL
Vhati
Posts: 792
Joined: Thu Oct 25, 2012 12:01 pm

Re: [Tool] FTL Error Checker

Postby Vhati » Sat Sep 14, 2013 9:14 pm

The non-Windows builds throw NullPointerException on startup because of the getRealArch() bug.
User avatar
kartoFlane
Posts: 1470
Joined: Mon Jan 14, 2013 10:20 pm

Re: [Tool] FTL Error Checker

Postby kartoFlane » Sat Sep 14, 2013 9:36 pm

Vhati wrote:The non-Windows builds throw NullPointerException on startup because of the getRealArch() bug.

Got that covered in the update I'm working on.
Currently trying to devise a way to reliably check for loops in events, and determine which blueprints are unused...
Superluminal2 - a ship editor for FTL
User avatar
kartoFlane
Posts: 1470
Joined: Mon Jan 14, 2013 10:20 pm

Re: [Tool] FTL Error Checker - v 0.95a

Postby kartoFlane » Wed Sep 18, 2013 4:21 pm

I've finally updated the checker to version 0.95. Some most significant changes:

Code: Select all

  - Internal overhaul - ported to use Vhati's SloppyXMLParser, which is basically as sensitive and tolerant as FTL's own parser
  - Added search text feature
  - Added case-sensitive flag to search window (off by default)
  - Added checking for event loops
  - Added checking for unused objects (may be imperfect)
  - Added "Previous" button to search window
  - 0x0 rooms should no longer show up as an error
  - Right-clicking on the error table opens up a popup menu, allowing you to copy the error message
  - Errors are now always listed from earliest to latest in the table


Download: FTL Error Checker 0.95a

Edit:
Unsurprisingly enough, there was a bug in original 0.95 version that would prevent the checker from parsing some modded archives. This has been fixed.
Superluminal2 - a ship editor for FTL

Who is online

Users browsing this forum: No registered users and 4 guests