forked from SWG-Source/swg-main
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcheckCreatureStrings.pl
executable file
·54 lines (44 loc) · 1.54 KB
/
checkCreatureStrings.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# ================================================================================
#
# checkCreatureStrings.pl
# Copyright 2006, Sony Online Entertainment LLC
#
# ================================================================================
use Cwd;
# --------------------------------------------------------------------------------
die "usage: $0\n\t Checks that all creatures.tab creature names are localized. Outputs missing creature names." if (@ARGV);
die "Must be run within a swg directory!" if (getcwd() !~ m!(.*/swg/\w+/)!);
my $rootPath = $1;
my $creaturesStringFile = "data/sku.0/sys.shared/built/game/string/en/mob/creature_names.stf";
my $creaturesTabFile = "dsrc/sku.0/sys.server/compiled/game/datatables/mob/creatures.tab";
my $localizationToolCon = "../all/tools/all/win32/LocalizationToolCon_r.exe";
# --------------------------------------------------------------------------------
open(CS, "$rootPath$localizationToolCon $rootPath$creaturesStringFile -list |") || die "$!";
while (<CS>)
{
split;
$creaturesString{$_[0]} = 1;
}
close(CS);
open(CT, "$rootPath$creaturesTabFile") || die "$!";
<CT>; <CT>; # skip column header name & type
while (<CT>)
{
split;
if (!$creaturesString{$_[0]})
{
print "$_[0]\n";
++$missingStringCount;
}
}
close(CT);
if ($missingStringCount)
{
print STDERR "\nFAILURE! Missing $missingStringCount creature name strings!\n";
}
else
{
print STERR "\nSUCCESS! No missing creature strings!\n";
}
exit $missingStringCount;
# ================================================================================