[TOOL] Level cleaner utility

BeigeAlertBeigeAlert Texas Join Date: 2013-08-08 Member: 186657Members, Super Administrators, Forum Admins, NS2 Developer, NS2 Playtester, Squad Five Blue, Squad Five Silver, NS2 Map Tester, Reinforced - Diamond, Reinforced - Shadow, Subnautica Playtester, Pistachionauts
edited June 2015 in Mapping
Hey guys, I've created a quick little utility that searches through .level files, and removes any static_props that have no model files.

Ensure you have Python 3 installed, and simply drag+drop the .level onto the script. The cleaned level will be saved with '_modified' appended to the name.

Already tested it out on refinery, and it works like a charm!

The name "cleaner" is a bit more general than just removing invalid entities... I may later expand this utility to recognize and "clean" more errors. For now, if you've been getting that "couldn't load model "" " error, this should fix it for you.

https://www.dropbox.com/s/uk32uym2h6b1bmq/level_cleaner.py?dl=1

Cheers!
Beige

Changelog:
6-13-15
-Console output is more clear now on when the utility cannot find anything to fix.

6-12-15
-First release
-Detects blank model file paths, and removes these objects from the .level.

Comments

  • McGlaspieMcGlaspie www.team156.com Join Date: 2010-07-26 Member: 73044Members, Super Administrators, Forum Admins, NS2 Developer, NS2 Playtester, Squad Five Blue, Squad Five Silver, Squad Five Gold, Reinforced - Onos, WC 2013 - Gold, Subnautica Playtester
    Awesome. Well done sir. At some point, I'd like to get things like this worked into the Editor itself.
  • BeigeAlertBeigeAlert Texas Join Date: 2013-08-08 Member: 186657Members, Super Administrators, Forum Admins, NS2 Developer, NS2 Playtester, Squad Five Blue, Squad Five Silver, NS2 Map Tester, Reinforced - Diamond, Reinforced - Shadow, Subnautica Playtester, Pistachionauts
    McGlaspie wrote: »
    Awesome. Well done sir. At some point, I'd like to get things like this worked into the Editor itself.

    Probably would be even easier to do it there. All this does is check every object for a "model" property, and if it's an empty string, delete the whole object.
  • UncleCrunchUncleCrunch Mayonnaise land Join Date: 2005-02-16 Member: 41365Members, Reinforced - Onos
    McGlaspie wrote: »
    Awesome. Well done sir. At some point, I'd like to get things like this worked into the Editor itself.

    I wished it was in the editor in the first place (at NS2 launch).
    It would have save a loooooooooot of trouble for everyone including UWE/CDT.
  • Vert^Vert^ Join Date: 2013-01-22 Member: 181227Members
    Atleast it's here now, that's the beauty about the life & evolution of modded games.

    Thank you, Biege bro <3
  • BeigeAlertBeigeAlert Texas Join Date: 2013-08-08 Member: 186657Members, Super Administrators, Forum Admins, NS2 Developer, NS2 Playtester, Squad Five Blue, Squad Five Silver, NS2 Map Tester, Reinforced - Diamond, Reinforced - Shadow, Subnautica Playtester, Pistachionauts
    Mini update: made it more clear when the utility doesn't find any errors to fix in the level file.
  • MauvaisVitrierMauvaisVitrier France Join Date: 2014-04-10 Member: 195291Members, NS2 Map Tester, Reinforced - Diamond
    edited June 2015
    What a beast this guy.

    rename : BeastAlert
  • BeigeAlertBeigeAlert Texas Join Date: 2013-08-08 Member: 186657Members, Super Administrators, Forum Admins, NS2 Developer, NS2 Playtester, Squad Five Blue, Squad Five Silver, NS2 Map Tester, Reinforced - Diamond, Reinforced - Shadow, Subnautica Playtester, Pistachionauts
    What a beast this guy.

    rename : BeastAlert

    But I like Beige! Do I have a choice in this? :/
  • Vert^Vert^ Join Date: 2013-01-22 Member: 181227Members
    BeigeAlert wrote: »
    What a beast this guy.

    rename : BeastAlert

    But I like Beige! Do I have a choice in this? :/

    Lies. You told me to remove beige colored props in the past!
Sign In or Register to comment.