diff --git a/README_mith.txt b/README_mith.txt index 9c53346..265f63d 100644 --- a/README_mith.txt +++ b/README_mith.txt @@ -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 diff --git a/copy_unmodded_files.pl b/copy_unmodded_files.pl index 880d3a5..bab6b9a 100644 --- a/copy_unmodded_files.pl +++ b/copy_unmodded_files.pl @@ -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); } diff --git a/find_strings.pl b/find_strings.pl index eeeee5e..7927308 100644 --- a/find_strings.pl +++ b/find_strings.pl @@ -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; diff --git a/import_files_to_assets.pl b/import_files_to_assets.pl index 9730ae7..8f7294b 100644 --- a/import_files_to_assets.pl +++ b/import_files_to_assets.pl @@ -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; @@ -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; } diff --git a/mod_textures.pl b/mod_textures.pl index 8294c17..5ca377a 100644 --- a/mod_textures.pl +++ b/mod_textures.pl @@ -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; diff --git a/modify_fonts_and_inject.pl b/modify_fonts_and_inject.pl index ac17b99..4a555ce 100644 --- a/modify_fonts_and_inject.pl +++ b/modify_fonts_and_inject.pl @@ -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 = ( diff --git a/translate_utf8_binary.pl b/translate_utf8_binary.pl index e565dfc..44719cb 100644 --- a/translate_utf8_binary.pl +++ b/translate_utf8_binary.pl @@ -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 ); diff --git a/unpack_original_files.pl b/unpack_original_files.pl index d5c5526..b68c8e7 100644 --- a/unpack_original_files.pl +++ b/unpack_original_files.pl @@ -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] };