Merged in Governor-Tarkin/swg-src (pull request #17)
[swg-src.git] / tools / checkCreatureStrings.pl
blob43f14db31c29fc0cb98167aed7372045ae11d7e1
1 # ================================================================================
3 # checkCreatureStrings.pl
4 # Copyright 2006, Sony Online Entertainment LLC
6 # ================================================================================
8 use Cwd;
10 # --------------------------------------------------------------------------------
12 die "usage: $0\n\t Checks that all creatures.tab creature names are localized. Outputs missing creature names." if (@ARGV);
13 die "Must be run within a swg directory!" if (getcwd() !~ m!(.*/swg/\w+/)!);
14 my $rootPath = $1;
16 my $creaturesStringFile = "data/sku.0/sys.shared/built/game/string/en/mob/creature_names.stf";
17 my $creaturesTabFile = "dsrc/sku.0/sys.server/compiled/game/datatables/mob/creatures.tab";
18 my $localizationToolCon = "../all/tools/all/win32/LocalizationToolCon_r.exe";
20 # --------------------------------------------------------------------------------
22 open(CS, "$rootPath$localizationToolCon $rootPath$creaturesStringFile -list |") || die "$!";
23 while (<CS>)
25 split;
26 $creaturesString{$_[0]} = 1;
28 close(CS);
30 open(CT, "$rootPath$creaturesTabFile") || die "$!";
31 <CT>; <CT>; # skip column header name & type
32 while (<CT>)
34 split;
35 if (!$creaturesString{$_[0]})
37 print "$_[0]\n";
38 ++$missingStringCount;
41 close(CT);
43 if ($missingStringCount)
45 print STDERR "\nFAILURE! Missing $missingStringCount creature name strings!\n";
47 else
49 print STERR "\nSUCCESS! No missing creature strings!\n";
52 exit $missingStringCount;
54 # ================================================================================