Skip to content

Commit

Permalink
move the directory of the original game files to make patch creation …
Browse files Browse the repository at this point in the history
…easier
  • Loading branch information
wchristian committed Jul 11, 2019
1 parent 5afaa16 commit b2db902
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 26 deletions.
2 changes: 1 addition & 1 deletion README_mith.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ in the taskbar but not actually visible, click on that and hit esc once.
The following stuff doesn't need to be done everytime, it's just preparation.

- put unityex in ../unity_tools
- put the decrypted game in ../kc_original
- put the decrypted game in ../kc_original/repatch/PCSG00684
- decrypt on console: https://github.com/TheRadziu/NoNpDRM-modding/wiki#obtaining-decrypted-game-assets-from-nonpdrm-rips-through-vitashell-decryption-on-console
- decrypt on pc: https://github.com/TheRadziu/NoNpDRM-modding/wiki#obtaining-decrypted-game-assets-from-nonpdrm-rips-through-psvpfstools-decryption-on-pc
- # perl unpack_original_files.pl
Expand Down
4 changes: 2 additions & 2 deletions copy_unmodded_files.pl
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ sub run {
}
my @files = grep /\.$ext$/, io($src)->all_files;
for my $file (@files) {
die "didn't find file '$file' in original game" if !-e "../kc_original/$tgt" . $file->filename;
my $target_file = "../kc_original_unpack_modded/$tgt" . $file->filename;
die "didn't find file '$file' in original game" if !-e "../kc_original/repatch/PCSG00684/$tgt" . $file->filename;
my $target_file = "../kc_original_unpack_modded/repatch/PCSG00684/$tgt" . $file->filename;
io( io->file($target_file)->filepath )->mkpath;
$file->copy($target_file);
}
Expand Down
2 changes: 1 addition & 1 deletion find_strings.pl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
sub utf8_asset_files {
my $has_find = -e "c:/cygwin/bin/find.exe";
say "has find: $has_find";
my $src_dir = "../kc_original_unpack/Media/Unity_Assets_Files/";
my $src_dir = "../kc_original_unpack/repatch/PCSG00684/Media/Unity_Assets_Files/";
my @list = $has_find ? split /\n/, `c:/cygwin/bin/find "$src_dir" -type f` #
: io($src_dir)->All_Files;
@list = grep !/\.(tex|dds(_\d)*|mat|gobj|shader|txt|xml|ttf|amtc|ani|avatar|cbm|flr|fsb|mesh|obj|physmat2D|rtex|script|snd|[0-9]+)$/, @list;
Expand Down
11 changes: 3 additions & 8 deletions import_files_to_assets.pl
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ sub plain_or_asset {

sub run {
my $cwd = io(".")->absolute->pathname;
my $patch_dir = "../kc_original_unpack_modded";
my $src_dir = "../kc_original";
my $patch_dir = "../kc_original_unpack_modded/repatch/PCSG00684";
my $src_dir = "../kc_original/repatch/PCSG00684";
my $target_dir = "../kc_translation_mod_candidate";
my $media_dir = "$target_dir/Media";
my $media_dir = "$target_dir/repatch/PCSG00684/Media";
my $asset_dir = "$media_dir/Unity_Assets_Files";
my $unity_ex = io("../unity_tools/UnityEX.exe")->absolute->pathname;
my $verbose = grep /^-v$/, @ARGV;
Expand Down Expand Up @@ -59,11 +59,6 @@ sub run {
say "\ndeleting patches";
io($asset_dir)->rmtree;

my $sub_path = "repatch/PCSG00684/";
say "moving to $sub_path";
io("$target_dir/$sub_path/")->mkpath;
$_->rename( "$target_dir/$sub_path/" . $_->filename ) for io($target_dir)->all_dirs;

say "done";
return;
}
4 changes: 2 additions & 2 deletions mod_textures.pl
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ ($)

sub run {
say "copying and converting images";
my $target_path = "../kc_original_unpack_modded/Media/Unity_Assets_Files";
my $target_path = "../kc_original_unpack_modded/repatch/PCSG00684/Media/Unity_Assets_Files";
my @images = grep /\.png$/, io("en/Unity_Assets_Files")->All_Files;
my ( $processed, %known ) = (0);
for my $image (@images) {
my @file_parts = split /\/|\\/, $image;
my $source_tex = "../kc_original_unpack/Media/Unity_Assets_Files/$file_parts[2]/$file_parts[4]";
my $source_tex = "../kc_original_unpack/repatch/PCSG00684/Media/Unity_Assets_Files/$file_parts[2]/$file_parts[4]";
my $target_tex = "$target_path/$file_parts[2]/$file_parts[4]";
$_ =~ s/\.png$// for $source_tex, $target_tex;
die "source texture missing: '$source_tex'" if not -e $source_tex;
Expand Down
4 changes: 2 additions & 2 deletions modify_fonts_and_inject.pl
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ sub mod_font {
sub run {
my $ff = "C:/Program Files (x86)/FontForgeBuilds/bin/fontforge.exe";
my $t_body = "Media/Unity_Assets_Files";
my $t_root = "../kc_original_unpack_modded/$t_body";
my $font_root = "../kc_original_unpack/$t_body";
my $t_root = "../kc_original_unpack_modded/repatch/PCSG00684/$t_body";
my $font_root = "../kc_original_unpack/repatch/PCSG00684/$t_body";

# ume is used to make texts ingame more narrow
my @fonts = (
Expand Down
10 changes: 5 additions & 5 deletions translate_utf8_binary.pl
Original file line number Diff line number Diff line change
Expand Up @@ -696,19 +696,19 @@ sub run {

say "grabbing file list";
my @list = (
utf8_asset_files("../kc_original_unpack/Media/Unity_Assets_Files/"),
utf8_asset_files("../kc_original/Media/StreamingAssets/Xml/tables/master/"),
utf8_asset_files("../kc_original_unpack/repatch/PCSG00684/Media/Unity_Assets_Files/"),
utf8_asset_files("../kc_original/repatch/PCSG00684/Media/StreamingAssets/Xml/tables/master/"),
{ #
file => io("../kc_original/Media/Managed/Assembly-CSharp.dll"),
file => io("../kc_original/repatch/PCSG00684/Media/Managed/Assembly-CSharp.dll"),
filename => "Assembly-CSharp.dll",
fileparts => [ split /\/|\\/, "../kc_original/Media/Managed/Assembly-CSharp.dll" ],
fileparts => [ split /\/|\\/, "../kc_original/repatch/PCSG00684/Media/Managed/Assembly-CSharp.dll" ],
enc => [ "UTF-16LE", "UTF-8" ],
fileid => "a-csharp",
ext => "dll",
},
);
@list = sort { lc $a->{fileid} cmp lc $b->{fileid} } @list;
io($_)->unlink for grep !/\.(tex|ttf)$/, io("../kc_original_unpack_modded/Media")->All_Files;
io($_)->unlink for grep !/\.(tex|ttf)$/, io("../kc_original_unpack_modded/repatch/PCSG00684/Media")->All_Files;
say "prepped";
my ( %found, %unmatched, %hit, %untranslated, %ignored );

Expand Down
10 changes: 5 additions & 5 deletions unpack_original_files.pl
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
# delete things after unpacking.

sub run {
my $target = "../kc_original_unpack/Media";
my $target = "../kc_original_unpack/repatch/PCSG00684/Media";
io($target)->mkpath;
chdir "../kc_original_unpack/Media";
my @files = io("../../kc_original/Media/")->all_files;
$_->copy(".") for @files;
my $unity_ex = io("../../unity_tools/UnityEX.exe")->absolute->pathname;
chdir "../kc_original_unpack/repatch/PCSG00684/Media";
my @files = io("../../../../kc_original/repatch/PCSG00684/Media/")->all_files;
$_->copy("./" . $_->filename) for @files;
my $unity_ex = io("../../../../unity_tools/UnityEX.exe")->absolute->pathname;
for my $file ( grep !/resources\.resource/, io(".")->all_files ) {
say "unpacking file $file'";
my ( $out, $err, $res ) = capture { system qq["$unity_ex" export $file] };
Expand Down

0 comments on commit b2db902

Please sign in to comment.