From 36e4a4d1d8c3e31edba7b307c99db5a748a92cea Mon Sep 17 00:00:00 2001 From: Stewie Date: Mon, 27 Jun 2022 19:33:37 -0400 Subject: [PATCH 1/3] reuse story_XML_patch path --- ToolsTOR.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ToolsTOR.py b/ToolsTOR.py index e76cdfb..458e4a4 100644 --- a/ToolsTOR.py +++ b/ToolsTOR.py @@ -348,7 +348,7 @@ class ToolsTOR(ToolsTales): buffer = 0 - story_file_list = [self.get_file_name(ele) for ele in os.listdir("../Data/Tales-Of-Rebirth/Story/New")] + story_file_list = [self.get_file_name(ele) for ele in os.listdir( self.story_XML_patch +"New")] print(story_file_list) output_dat_path = self.datBinNew with open(output_dat_path, "wb") as output_dat: From 5829b8b88a8bc37107343c51a2cb4a7e4bcf7491 Mon Sep 17 00:00:00 2001 From: Stewie Date: Mon, 27 Jun 2022 19:55:39 -0400 Subject: [PATCH 2/3] fixing StoryPath for pack_Story_File --- ToolsTOR.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ToolsTOR.py b/ToolsTOR.py index 458e4a4..e17a287 100644 --- a/ToolsTOR.py +++ b/ToolsTOR.py @@ -28,7 +28,7 @@ class ToolsTOR(ToolsTales): datBinNew = '../Data/Tales-Of-Rebirth/Disc/New/DAT.BIN' elfOriginal = '../Data/Tales-Of-Rebirth/Disc/Original/SLPS_254.50' elfNew = '../Data/Tales-Of-Rebirth/Disc/New/SLPS_254.50' - story_XML_new = '../Tales-Of-Rebirth/Data/Data/TOR/Story/' #Story XML files will be extracted here + story_XML_new = '../Tales-Of-Rebirth/Data/TOR/Story/' #Story XML files will be extracted here story_XML_patch = '../Data/Tales-Of-Rebirth/Story/' #Story XML files will be extracted here skit_XML_patch = '../Data/Tales-Of-Rebirth/Skits/' #Skits XML files will be extracted here dat_archive_extract = '../Data/Tales-Of-Rebirth/DAT/' @@ -155,7 +155,7 @@ class ToolsTOR(ToolsTales): print(strings_offset) #Read the XML for the corresponding THEIRSCE - file = self.story_XML_patch +"XML/"+ self.get_file_name(scpkFileName)+'.xml' + file = self.story_XML_new +"XML/"+ self.get_file_name(scpkFileName)+'.xml' print("XML : {}".format(self.get_file_name(scpkFileName)+'.xml')) tree = etree.parse(file) root = tree.getroot() @@ -203,7 +203,7 @@ class ToolsTOR(ToolsTales): def pack_Story_File(self, scpkFileName): #Copy the original SCPK file to the folder used for the new version - shutil.copy( self.dat_archive_extract + "SCPK/" + scpkFileName, self.storyPathArchives + scpkFileName) + shutil.copy( self.dat_archive_extract + "SCPK/" + scpkFileName, self.story_XML_patch + "New/" + scpkFileName) #Open the original SCPK with open( self.dat_archive_extract + "SCPK/" + scpkFileName, 'r+b') as scpk: @@ -429,7 +429,7 @@ class ToolsTOR(ToolsTales): def pack_All_Story_Files(self): print("Recreating Story files") - listFiles = [ele for ele in os.listdir( self.storyPathArchives)] + listFiles = [ele for ele in os.listdir( self.story_XML_patch + "New/")] for scpkFile in listFiles: self.pack_Story_File(scpkFile) print("Writing file {} ...".format(scpkFile)) From 48a5b90efd4807c78fe282b704fbc4ed8f41c917 Mon Sep 17 00:00:00 2001 From: Stewie Date: Mon, 27 Jun 2022 19:56:10 -0400 Subject: [PATCH 3/3] Remove testing for scpk file --- ToolsTOR.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ToolsTOR.py b/ToolsTOR.py index e17a287..a5f678c 100644 --- a/ToolsTOR.py +++ b/ToolsTOR.py @@ -279,8 +279,8 @@ class ToolsTOR(ToolsTales): o.write(dataFinal) - with open("10247.scpk", "wb") as f: - f.write(o.getvalue()) + #with open("10247.scpk", "wb") as f: + # f.write(o.getvalue()) return o.getvalue()