Results 1 to 5 of 5

Thread: Checking descr_model_battle.txt

  1. #1
    Crazy Russian Member iamphet's Avatar
    Join Date
    Oct 2006
    Location
    Москва
    Posts
    128

    Default Checking descr_model_battle.txt

    Hi, below is a simple Perl script to check your descr_model_battle.txt for consistency

    Can you suggest what other files are worth such a check?

    Code:
    #
    # dmbcheck.pl
    #
    
    # an ad-hoc Perl script to check for references to missing files in descr_model_battle.txt
    # run it from your RTW folder with something like "perl dmbcheck.pl > ok.txt 2>errors.txt"
    # and examine files ok.txt and errors.txt
    
    # set it to your mod dir if the mod uses -mod switch or set it to "" otherwise
    # using EB by default
    
    $mod = "eb/";
    
    open F, "<${mod}data/descr_model_battle.txt";
    
    while (<F>)
    {
      if (/^model_sprite\s+[^,]+,[^,]+,\s*(.*?)\s*$/ or
        /^model_sprite\s+[^,]+,\s*(.*?)\s*$/)
      {
        if (-f $1)
        {
          print "sprite $1 exists\n";
        }     
        else
        {
          print STDERR "sprite $1 does not exist\n";
        }
      }
      elsif (/^texture\s+[^,]+,\s*(.*?)\s*$/)
      {
        if (-f $1 or -f "$1.dds")
        {
          print "texture $1 exists\n";
        }     
        else
        {
          print STDERR "texture $1 does not exist\n";
        }
      }
      elsif (/^model_flexi(?:_m)?\s+(.*?)\s*,/)
      {
        if (-f $1)
        {
          print "model $1 exists\n";
        }     
        else
        {
          print STDERR "model $1 does not exist\n";
        }
      }
      # consistency check
      elsif (/^model_sprite/ or /^model_flexi/ or /^texture/)
      {
        print STDERR "entry '$_' has not been parsed for some reason, please check\n";
      }
    }
    
    
    close F;
    Last edited by iamphet; 02-10-2009 at 15:47.



  2. #2

    Default Re: Checking descr_model_battle.txt

    How about one for descr_strat, that will check for the consistency of character names?

    Any chance you can pack this into an .exe that will do things automatically? (the user will only have to selectthe path to his modfolder)

    Norman Invasion - The fate of England lies in your hands...

    Viking Invasion II - Unite Britain in the best TW campaign ever!

    Gods and Fighting Men: Total War - Enter the Mists of Myth in Ancient Ireland

  3. #3
    Anything that isn't 'member' Member Squid's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    596

    Default Re: Checking descr_model_battle.txt

    Aradan, over at twcenter there's a name checker that does check character names in descr_strat, it was made for M2TW but works perfectly well on RTW.

    -Trait/Ancillary/Building Editor

    "Two things are infinite: the universe and human stupidity;
    and I'm not sure about the universe." -----Albert Einstein

  4. #4

    Default Re: Checking descr_model_battle.txt

    I knew there was a name verifier, but last time I checked it didn't parse DS at all. Different tool maybe.

    Thanks for the tip, will go find it.

    Spoiler Alert, click show to read: 
    Well, you can expect me to know every file on TWC, it's not like I'm an admin there or sth...


    K, here's another one. How about a tool that will check for the existence of proper text descriptions and UI cards for the buildings defined in EDB?

    Norman Invasion - The fate of England lies in your hands...

    Viking Invasion II - Unite Britain in the best TW campaign ever!

    Gods and Fighting Men: Total War - Enter the Mists of Myth in Ancient Ireland

  5. #5
    Anything that isn't 'member' Member Squid's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    596

    Default Re: Checking descr_model_battle.txt

    That unfortunately doesn't exist as of yet, who knows once I get around to finishing the new version of my trait/ancillary validator. I may decide to tackle a new project.

    EDIT: http://www.twcenter.net/forums/showthread.php?t=85734 is the tool I was referring to. It's been reported that mod foldered descr_strat files aren't parsed properly, but as I have no acecss to the code I can't say for sure.
    Last edited by Squid; 11-27-2008 at 21:50.

    -Trait/Ancillary/Building Editor

    "Two things are infinite: the universe and human stupidity;
    and I'm not sure about the universe." -----Albert Einstein

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Single Sign On provided by vBSSO