0 of 0

File information

Last updated

Original upload

Created by

PaperFox

Uploaded by

jackalopefeet

Virus scan

Safe to use

About this mod

A PowerShell script to recursively unpack all HPK files in a game then decompile all Lua that it finds.

Requirements
Permissions and credits
Changelogs
Haemimont Engine HPK Extractor and Lua Decompiler Script

Requires Java runtime, unluac.jar,  hpk.exe, and PowerShell 7

Instructions:
1) Verify that the Java runtime is installed.
2) Place this script in the game root folder (e.g "C:\Steam\steamapps\common\Surviving Mars" )
3) Place the "hpk.exe" in game folder.
4) Rename the "unluac*.jar" that you downloaded to "unluac.jar" and place in game folder.
5) Run this script!

Process takes about 10 minutes to complete on my 8 core laptop with solid state hard drives.
Your mileage my vary.

The HPK Archiver, hpk.exe, can be found at:
https://github.com/nickelc/hpk/releases

The Lua Decompiler, unluac.jar, can be found at:
https://sourceforge.net/projects/unluac/

The Java Runtime installer can be found at:
https://java.com/en/download/
or:
https://www.oracle.com/java/technologies/javase-jre8-downloads.html

PowerShell 7 can be found at:
https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-windows?view=powershell-7.2

This script is covered by a MIT style license.




NOTES:
ChoGGi provided great information on reliably converting the DDS:
ChoGGi's Extract HPK Guide

If anyone knows how to convert HGM meshes to Blender or Wings or some other workable file type and back again, please post in the comments.