Surviving Mars

Surviving Mars

Evaluări insuficiente
Extract HPK files
De către ChoGGi
How to extract files from HPK files
   
Premiază
Adaugă la preferate
Preferat
Elimină din preferate
How to
Get a copy of hpk.exe from https://github.com/nickelc/hpk/releases
(if you're uncertain of which file: x86_64-pc-windows-msvc.zip)

Put this in a batch file (make a new .txt file and rename it to extract.bat)
for %%g in (*.hpk) do mkdir "%%~ng" for %%g in (*.hpk) do hpk.exe extract "%%g" "%%~ng" @echo All Done! pause


Copy hpk.exe, somefile.hpk, and extract.bat to the same location.


Run extract.bat.


Google what you don't know.
https://www.makeuseof.com/tag/write-simple-batch-bat-file/

To create hpk archives use: hpk.exe create FolderContainingFiles ModContent.hpk
Misc
If you're wondering why your image editor/exporter doesn't work with DDS files from Armstrong update (quote from dev):
For the UI images shipped with the game we switched to BC7 compression format, which we store in DDS files. We use Intel's ispc_texcomp conversion library (on GitHub).
Because BC7 works on 4x4 blocks of pixels, and thus requires image dimensions to be multiples of 4; we internally pad the images to 4x4, but still store the "real" dimensions in the header, because we need the exact original size to do UI layout. This probably makes them look corrupted to some tools.

You can directly edit them in Paint*NET[getpaint.net]

Use Texconv[github.com] to convert them:
texconv.exe *.dds -ft tga
(or png)
To convert images to the dds format used by the game:
texconv.exe *.tga -ft dds -f BC7_UNORM

To get a copy of texconv.exe: look for releases with 5 assets
https://github.com/microsoft/DirectXTex/releases

Chef Niko:
Script to convert dds to png using texconv. Place texconv in c:\ and run the script from the root of the directories with dds files in them.
forfiles /s /m *.dds /C "CMD /c c:\texconv.exe @path -ft png"


You can use my ECM mod to extract mods (Menu>Help>Extract Mods).


If you're extracting lua files to decompile them; then add --fix-lua-files to help out unluac (more help[github.com]).
55 comentarii
ChoGGi  [autor] 8 oct. 2023 la 20:06 
I really should get around to playing it...

and maybe some modding ;)
Sig 8 oct. 2023 la 19:28 
My thanks from another jagged alliance 3 wannabe modder, cheers for this guide
ChoGGi  [autor] 26 sept. 2023 la 16:16 
I just threw a guide together, nickelc is the one doing the heavy lifting by making hpk archiver.

but thanks :)
SupremeMaster 26 sept. 2023 la 12:23 
Thanks, I did this for jagged alliance 3. You deserve commendation! along with Igor!
ChoGGi  [autor] 15 iul. 2023 la 9:10 
If you're replacing the games hpk files then yes, use dont compress, but for mods it doesn't matter.

I haven't touched JA3 or SAD, maybe someday...
Vendaar 15 iul. 2023 la 8:57 
sorry i thought this was JA3 and not SM. someone told me to use dont-compress. is there a way to do it without replaying the hpks?
ChoGGi  [autor] 15 iul. 2023 la 8:30 
btw why do you use dont-compress-files? You only need that when replacing the game hpk files.
ChoGGi  [autor] 15 iul. 2023 la 8:22 
getpaint.net (you're linking to a link farm)

Thanks!
Vendaar 15 iul. 2023 la 8:11 
you can use paint.net to edit DDS without converting anything.

to convert folders to hpk agaiin use:
hpk.exe create --dont-compress-files foldername hpkname.hpk"
@echo All Done!
ChoGGi  [autor] 5 mart. 2023 la 9:20 
Yeah it works fine for that as well.