View Single Post
Tabun
Junior Member
Join Date: Sep 2011
Old 01-19-2014 , 13:20   Re: Stripper:Source (Updated 2011-04-15)
Reply With Quote #1191

I built a validator for Stripper:Source map config files. Hope it helps someone here too.

The Validator Tool


http://tabun.nl/tools/strippervalidator/

Simply enter the contents of your Stripper:Source map config file and hit 'Validate'. It will then spit out a list of problems, if it finds anything wrong. Warnings are there to notify you of stuff that might be unintentional; Errors indicate stuff that will break the stripper config from executing (in part).

The library code for the parser is on my github, if anyone's interested.


Reason
Stripper's kinda finicky, there's no clear documentation on (the limits of) its syntaxis and it's annoying to debug (unless you like reloading a map dozens of times).
This tool should make it easier to test and debug configs.
I've been wanting to do this for a while now, but didn't have the time for it.


Feedback
Feedback is welcome, especially is something breaks. Superfluous unexpected-bracket reports are known, but not a priority. Just fix the first bracket problem and the other errors will disappear too.
I'm planning to add a syntax highlighted print of the config code later too, but no promises.

If you have any stripper files that get you 'unknown property' warnings, please let me know.
You can just send me the entire .cfg if there's a lot of them, so I can use my nifty tools to update StripperConfig automatically.


Example
To test the parser I did a check on all of the stripper files included in a L4D2 competitive package. Here's a snippet of the output:

Code:
Errors and warnings for file: promod\stripper\maps\c4m1_milltown_a.cfg
4 error(s):
    line #    7: Unexpected opening bracket for a MODIFY block without a preceding MATCH/INSERT/DELETE/REPLACE modifier.
    line #   13: Unexpected closing bracket at root block level. (Found no opened ADD/MODIFY/FILTER block that can be closed.)

Errors and warnings for file: promod\stripper\maps\c5m5_bridge.cfg
1 error(s):
    line # 1704: Unexpected content following the property and value content. Property statement must be no other or more than: "(property)" "(value)". (Tip: check for embedded quotes (").)
2 warning(s):
    line #  171: Found backslash (\) in path property ('model'): 'models\props_highway\bridge_rail_tall_128_damaged.mdl'. It is recommended to use forward slashes (/) to avoid problems.

Errors and warnings for file: promod\stripper\maps\l4d2_stadium1_apartment.cfg
2 error(s):
    line #   35: Unexpected property statement; outside of any valid block scope (prop: hammerid => 1951907)
    line #   36: Unexpected closing bracket at root block level. (Found no opened ADD/MODIFY/FILTER block that can be closed.)

Errors and warnings for file: promod\stripper\maps\versus_3.cfg
2 error(s):
    line #   82: Found mode modifier (ADD) not followed by ":".

Last edited by Tabun; 01-19-2014 at 13:23.
Tabun is offline