

If both conditions are true, it dumps the contents of the file without the ZLIB header. The change I made is that, if decompression fails, it checks if there is only one chunk and the resulting file size is supposed to be less than 32 bytes in length. I'll see if I can find a logical solution but if I can't, I might just have to write an exception for that file.Įdit: 1.0.7 up. It's one of those files that lies about being compressed. Modified HpkFile.cs (my edits marked with //ZUR: )
#TROPICO 4 MODS LIST ZIP#
Zipped _a contains this line after zip header "LuaRevision = 181599".Īnd I've changed ArchiveZippedFile(ref BinaryWriter bw, int index) method so it checks if input starts with "ZLIB" it calls ArchiveFile(ref bw, index).īut the trick failed after repack new hpk file has less size and the game fails to start without error messages in debug log.
#TROPICO 4 MODS LIST CODE#
I've made small changes in your code so if it fails to unzip file it writes it as is (i.e. The game has failed to start and in the the debug console was smth about lua revision 1815!= 181599. G:\Tropico 5\Packs\Unpacked\Lua.hpk\Lua\Config\_a Could not decompress the file.įirst i've tried to ignore this and just repack all back to hpk and launch the game with debug. I've tried to unpack Lua.hpk from Tropico 5 and repack it back without changing anything.Īfter unpack error log with this line appeared: Still nothing in terms of progress on decompressing. It would cause the compressed file to be smaller than it really is if extracting failed. It is suggesting there is way more data in there than there really is.Įdit: Hmm, I think I found a bug that affected all versions. ID,Revision,Text,Location,Context,Actor,Voice Actor,Old Revision,Old Text,Old Translation,New Translation,Status,Warnings,Xbox Terminology/Whitespace/Status Warningsġ000001,174226,Common,CommonLua/Classes/a(00015),174226,Common,Common,Common,OK,ġ000002,174226,Default,CommonLua/Core/a(00003),options refresh rate,174226,Default,Default,Default,OK,ġ000003,174226, x ,CommonLua/Core/a(00233),screen resolution,174226, x, x, x ,OK,ġ000004,174226,Windowed,CommonLua/Core/a(00243),Options dialog resolution setting,174226,Windowed,Windowed,Windowed,OK,The error is: Bad state (unknown compression method (0x0D))Įdit: I'm beginning to think it isn't the compression, it is the ZLIB header.
