export file rename/antiduplication tool
Jun 16, 2017 4:15:02 GMT
apophys, concretedonkey, and 3 more like this
Post by treptoplax on Jun 16, 2017 4:15:02 GMT
Over in the "unofficial tournament" thread, an AI-vs-AI test tourney is being planned. Several people pointed out that this could cause name collisions in the designs; Argopeilacos made a proof-of-concept tool to handle this in the exports programmaticly, and I added a couple features.
It may also be more generally useful, though, as it also removes duplicate modules/blueprints, which have been reported to cause crashes on import.
You can try the tool here:
Try it online!
(Updated 6/18/17; original release didn't correctly update standalone laser turrets if the laser they were designed for was renamed.)
(Updated 6/21/17; now attempts to remove duplicate modules only if DEDUP=0 parameter changed)
You can run it though that webpage, or copy the awk script (it runs fine on Mac and I assume Linux, I'm sure you can find a modern awk for Windows somewhere if you're into that sort of thing). You can fill in your forum name after the -vname= parameter, or leave that blank and it will only delete duplicate modules.
It will do the following:
- If "name" is given, all module/blueprint names will be renamed to be prefaced with name (e.g., "treptoplax Matryoshka Drone MkIII"), unless 'name' is already the first word in the module name, in which case the module will be left alone.
- References to modified names elsewhere will be corrected to point to the new name.
- Any duplicate modules/blueprints will be reduced to a single copy. (This is reported to cause crashes, so that's nice).
The linked version has worked for me in the exactly one test I did of it, but YMMV, no warranty expressed nor implied; it could result in files that fail to load, replace all your boron with lead, and generally operates with safety margins that would appall a RFP Navy nuclear technician. If you find any issues let us know here; enhancements welcome (or just fork it, but it would be nice to put any improvements back out there).
It's a lot better than renaming by hand though.
It may also be more generally useful, though, as it also removes duplicate modules/blueprints, which have been reported to cause crashes on import.
You can try the tool here:
Try it online!
(Updated 6/18/17; original release didn't correctly update standalone laser turrets if the laser they were designed for was renamed.)
(Updated 6/21/17; now attempts to remove duplicate modules only if DEDUP=0 parameter changed)
You can run it though that webpage, or copy the awk script (it runs fine on Mac and I assume Linux, I'm sure you can find a modern awk for Windows somewhere if you're into that sort of thing). You can fill in your forum name after the -vname= parameter, or leave that blank and it will only delete duplicate modules.
It will do the following:
- If "name" is given, all module/blueprint names will be renamed to be prefaced with name (e.g., "treptoplax Matryoshka Drone MkIII"), unless 'name' is already the first word in the module name, in which case the module will be left alone.
- References to modified names elsewhere will be corrected to point to the new name.
- Any duplicate modules/blueprints will be reduced to a single copy. (This is reported to cause crashes, so that's nice).
The linked version has worked for me in the exactly one test I did of it, but YMMV, no warranty expressed nor implied; it could result in files that fail to load, replace all your boron with lead, and generally operates with safety margins that would appall a RFP Navy nuclear technician. If you find any issues let us know here; enhancements welcome (or just fork it, but it would be nice to put any improvements back out there).
It's a lot better than renaming by hand though.