hhyyrylainen / GodotPckTool

Standalone tool for extracting and creating Godot .pck files
MIT License
383 stars 31 forks source link

Override file #28

Closed merasmus44 closed 1 year ago

merasmus44 commented 1 year ago

If I were to add Globals.gd to the pck, is there any way to make it override the already built in Globals.gd?

hhyyrylainen commented 1 year ago

If you add a file that is already in a .pck the existing file is overwritten. If you mean about creating a patch or mod .pck file that overrides a file from the base game, that also works the same way, specify a file with the same path inside the .pck file than the inbuilt one and ensure then that the .pck file is loaded after the main .pck of the game to make it overwrite any resources specified in earlier loaded .pck files.

merasmus44 commented 1 year ago

So if the original Globals.gd is located in res://scripts/Globals.gd, would I have to put the new Globals.gd in a folder named scripts, then add it?

hhyyrylainen commented 1 year ago

Yes, all items inside .pck files are identified by a path. You can use this tool to list the contents of a .pck file to confirm what files exist, and also whether the overwrite succeeded (which can be seen based on the file size change to know when you managed to replace an existing entry, assuming the new file is different size).

merasmus44 commented 1 year ago

Ok this worked, thanks!