Results 1 to 5 of 5

Thread: Checking descr_model_battle.txt

Threaded View

Previous Post Previous Post   Next Post Next Post
  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.



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