Author Topic: Rebuilding resource.000 with external patches  (Read 4005 times)

0 Members and 1 Guest are viewing this topic.

Offline Charles

Rebuilding resource.000 with external patches
« on: August 04, 2021, 04:58:51 PM »
Is there any easy way to rebuild a resource.000 with all the external patch files?

I thought Tools-->Rebuild resources did it, but it looks like that just removes duplicates from within the resource itself, not adding in any additional patch files.  I feel like I'm missing something obvious.



Offline troflip

Re: Rebuilding resource.000 with external patches
« Reply #1 on: August 04, 2021, 06:43:26 PM »
Is there a checkbox for "Manage resources as patch files" in Game properties?

Not sure if that was a private thing I added or not... or how well tested it was.

Check out my website: http://icefallgames.com
Groundhog Day Competition

Offline Collector

Re: Rebuilding resource.000 with external patches
« Reply #2 on: August 04, 2021, 11:05:42 PM »
Is there a checkbox for "Manage resources as patch files" in Game properties?

Not sure if that was a private thing I added or not... or how well tested it was.

It's a checkbox in the Game Properties dialog.
KQII Remake Pic

Offline Charles

Re: Rebuilding resource.000 with external patches
« Reply #3 on: August 05, 2021, 12:12:27 AM »
Ah yes, I remember the discussion of that option a few years back -- I was kinda hoping there'd be a way without me substantially altering my workflow. Toggling the "Manage resources as patch files" has some pretty serious consequences that I wasn't looking to implement at this stage.

I'm using Kawa's build v3.2.3.0, btw.

Toggling it on has a fairly lengthy pause while it extracts each resource to an external patch file -- not sure if it overwrote any existing patch files with their (older) internal resource counterpart -- also not really sure if there were any overlapping files there... it's been nearly a year since I touched this mod.

Once all the patch files were extracted, the Explorer only showed patch files, not any files already existing in resource.000. But Tools-->Rebuild resources seems to have worked as I'd wanted.

Trouble is when I uncheck the "Manage resources as patch files" to change things back to how I had it before, it's asking me for confirmation after it deletes every single script file.  It also asks if I want to delete the corresponding script source code (thank goodness that's not checked by default).

I'm just going to hard-crash SCICompanion and restore from the zip I made beforehand -- I don't feel like clicking yes on 285 individual confirmation dialogs tonight. It'd be really nice if the Rebuild resources window itself could just build those patch files in without needing "Manage resources as patch" enabled.

Offline Kawa

Re: Rebuilding resource.000 with external patches
« Reply #4 on: August 05, 2021, 06:42:43 AM »
If the amount of patch files isn't too wild, I like to just import them, then rebuild to get rid of the older ones that just got replaced.

Offline Charles

Re: Rebuilding resource.000 with external patches
« Reply #5 on: August 05, 2021, 10:32:50 PM »
Ahah! Import patch file! I completely overlooked that. That's exactly what I was looking for. Thank you Kawa.

It's 185 or so I need to import, so not something I'd want to do often, but now that I know about the import option I can just import them as needed in the future.

Offline Collector

Re: Rebuilding resource.000 with external patches
« Reply #6 on: August 06, 2021, 09:19:19 AM »
Toggling it on has a fairly lengthy pause while it extracts each resource to an external patch file -- not sure if it overwrote any existing patch files with their (older) internal resource counterpart -- also not really sure if there were any overlapping files there... it's been nearly a year since I touched this mod.

I don't know for sure, but I would be very surprised if it didn't only extract ones specified by the MAP file and then only if there was no existing external patch.
KQII Remake Pic

Offline Kawa

Re: Rebuilding resource.000 with external patches
« Reply #7 on: August 07, 2021, 04:52:33 AM »
*seriously considers adding script support*

Offline Charles

Re: Rebuilding resource.000 with external patches
« Reply #8 on: August 08, 2021, 12:15:22 AM »
Honestly, I was tempted myself to attempt to modify the "Import patch file" menu item to allow selecting multiple files.  If multiple patches are selected, I'd skip the import dialog, and just use the default values.

Unfortunately I'm quite rusty in my C++, and don't want to take on another learning project. But if you do it, I'm very interested.

Offline Kawa

Re: Rebuilding resource.000 with external patches
« Reply #9 on: August 08, 2021, 06:18:25 AM »
Honestly, I was tempted myself to attempt to modify the "Import patch file" menu item to allow selecting multiple files.  If multiple patches are selected, I'd skip the import dialog, and just use the default values.

Unfortunately I'm quite rusty in my C++, and don't want to take on another learning project. But if you do it, I'm very interested.
So I took that as a personal challenge.

The actual release is in the link in my signature, as always.

Offline Charles

Re: Rebuilding resource.000 with external patches
« Reply #10 on: August 08, 2021, 12:26:25 PM »
Oh, this sparks joy.  ;D  Thank you, Kawa!

Looks like it's capping out at 25 views at a time.  I think it's related to this: https://stackoverflow.com/questions/14903496/why-cfiledialoggetnextpathname-doesnt-work-when-the-file-path-is-long.

Not really a problem. Just means I needed to import 5 times instead of 112 times.
« Last Edit: August 08, 2021, 12:54:32 PM by Charles »

Offline Kawa

Re: Rebuilding resource.000 with external patches
« Reply #11 on: August 08, 2021, 08:50:11 PM »
Ah yes. I actually had code similar to that in Barak Manos' answer at first but removed it since it seemed to Work Fineā„¢ as-is. Might put it back, but it's almost three AM and I should've been in a more horizontal orientation since at least two hours ago.


SMF 2.0.19 | SMF © 2021, Simple Machines
Simple Audio Video Embedder

Page created in 0.053 seconds with 23 queries.