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;
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)
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.
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.
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?
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.