Jump to content

How to Mod the textures


KillerStarBunny

Recommended Posts

OK so you can do this but there isn't any tools (yet) to do the annoying stuff for you, but you will need to download a hex editor i recommend this one HxD http://mh-nexus.de/en/downloads.php

 

If you have no idea what hex is read this

Hex is a way to view binary with the numbers 0-9 and A-F each letter represents four binary... things and the numbers and letters are put into pairs so you will see stuff like 1A 8D 4F 7B AA 48 etc... Hex makes up everything on a computer, be it programs, videos, tmp files, anything. So it is a crucial part of a computer and if you know what you are doing you can do anything with hex.


 

Some defintions

Offset: Hex id number (always as hex and for HxD it is found in the bottom left corrner) ex 32C


 

If you want to know about .pack file architecture read this

All I know is that offset 0 has the number of pngs that are in the file


 

So here is the real tut and for demonstration's sake it will be how to make no blood appear.

1st: Open HxD and go to File --> Open (Ctrl+O)

2nd: Navigate to your .pack files Project Zomboid\media\texturepacks\ and choose the tiles.pack

3rd: CLICK ON FILE--> SAVE AS (no Ctrl+)you need backups in case you mess something up (HxD does automatically make a file with the same file name but puts .bak at the end to access the .bak rename it and take off the .bak)

4th: Go to Search --> Find (Ctrl+F)

5th: For the "Search for" type in "blood" and make sure the "Datatype" is "Text-string" then hit OK.

Now you should come across "blood_floor_large_01" this will make it so HxD will search for the nearest PNG to the file you want to edit.

6th: Now go to Search --> Find (Ctrl+F) and type in PNG. Make sure that the "Search Direction" is "Forward"

7th: You should run across ‰PNG put your cursor right before the "‰" and click so now it looks like "|‰" the offset (at the bottom left) should read "AB58C"

8th: Open Notepad and write that down

9th: Go to Search --> Find (Ctrl+F) and for the "Search for" type in "iend" make sure the "Datatype" is "Text-string" and the "Search Direction" is "Forward" then hit OK.

10th: You should run across "IEND®B" put your cursor between the "N" and the "D" so it now reads "IEN|D®B"

11th: The offset should now read "E737C"

A quick Hex lesson the letters on the right are to make stuff easier for the reader, but "." could be 00 - 19 so the text isn't that reliable which is why this next step is very important.

12th: If you look to your left there should be a faint box around 44 click in the middle and it should read "|44". The hex should stay the same.

13th: Now go to Edit --> Select block... (Ctrl+E)

14th: For the "Start Offset" make it the offset you wrote down in notepad (aka step 7) which should be "AB58C". Hit OK.

15th: The left side should have a dark blue selector thing while the right has a light blue. If not go to the 11th step.

16th: Hit Ctrl+C (Copy), then Ctrl+N (New), then Ctrl+V (paste insert). It will tell you that you are about to change file size. Ignore it and hit OK.

17th: Hit Ctrl+S (save), name it "Blood.png" make sure to have the .png.

18th: Open it in an editor that supports alpha (anything besides Paint will be good)

19th: Edit

 

This only has part of the blood stuff rest of it is in the "75A148", "BC4290", "C519A7", "D1729D", and even more than that png blocks so if you want to find the rest of the blood have at it all you need to do is search for blood again and grab that PNG and again (yada yada). If you really want to test this just make everything black. Now how to put it back in.

 

This is the easy part.

 

1st: Open the png in HxD

2nd: click on the hex in the left side.

3rd: Hit Ctrl+A (Select All), then Ctrl+C (copy)

4th Go to the .pack file and hit Ctrl+G (Goto) and make the "Offset" the number you wrote down.

5th: Make sure you are on the left hand side.

6th: Make sure you are at "|‰PNG"

7th: Hit Ctrl+B (Paste write)

8th: Save

9th: Copy the orginal Tiles.pack folder and paste it somewhere where you can easily find it (a backup folder inside of the texturepacks folder works)

10th: Delete the orginal

11th: Paste the modded one inside of the folder

12th: Name it Tiles.pack

13th: Run PZ and bask in your glory.

 

Here is a list of where PNGs stop and start it is incomplete but here it is half done


UI:

{

16A - 3156

809C - 3C811

3CFDD - 3E967

40BDC - 5D6A1

5DEA5 - 6576C

68AAF - 9D754

}

 

Tiles:

{

4F42

39E83

3EC0A

AB58C

E9CB9

134FC3

19561D

1C2F56

203293

29FF48

32F451

36CD26

389DDC

424ADC

512629

582198

5EE2C3

656B45

6E1A06

75A148

795F03

7E9F8D

814254

862528

8F31FDS

9C8002

A383F2

B06830

BC4290

C519A7

D1726B

DBB2F7

E5FEC1

EE7038

F8CC95

1062633

111E206

11EC62D

126580E

1315BD5

1454A09

14CE22C

1569849

15C48EF

1666418

1685DEA

168C3B1

168D1A9

168E158 - 168EEB1

}

 

 

FP (Frequent Problems)


1. It says my PNG is corupted

Your PNG's header or footer is incorrect make sure you copied it right


Link to comment
Share on other sites

With all this effort you probably could have just written an unpacker and a packer, since the format is just catenated pngs. I forget if there was an offset to the next one included before header or something. IIRC someone already did the unpacker on the old forums.

 

Although we are supposed to get the tools soonish anyway...

Link to comment
Share on other sites

With all this effort you probably could have just written an unpacker and a packer, since the format is just catenated pngs. I forget if there was an offset to the next one included before header or something. IIRC someone already did the unpacker on the old forums.

 

Although we are supposed to get the tools soonish anyway...

Yeah I would really like a tool, I was planing on making one by my file accessing skills aren't that great and I'm too busy to learn. Also it's fun to play with hex, even though it can be quite vexing (puns).

Link to comment
Share on other sites

  • 3 weeks later...

Here you go:

 

Really simple code to split the PNG files 

wrote it in 20min, so its not perfect/optimized and can have errors!!!

but for the meantime its OK ^^

 

I attached a zip [OLD_POST] (sourcecode(Main.java [namefail -.-]), executable .jar) and the first 5 of 7 PNG files you get when splitting the file (UI.pack)

 

How to execute:

java -jar extract.jar "Path to file" "Path to folder where the pngs should be placed"

Example (same folder):

java -jar extract.jar UI.pack \

I will use this myself for the wiki

 

Have fun ^^

Link to comment
Share on other sites

Well, up till now i dont understand what kind of information was placed between the single png files.

So, i dont know how to generate those.

But if somebody manage to generate these, then I can include the packing option in a V0.2(lets say this is V0.1 ^^)

Link to comment
Share on other sites

So, here is V0.3

It took some work to rewrite the progam, but now it has a better format and is optimized (well i get some problems with the Characters.pack, because its huge -.-)

 

Now, what can this "UnPacker" do:

 

1. It can unpack .pack files into the packed .png files(with naming) and created a .xml file with all informations.

2. It can (re)pack the .pack file (.xml file and all .png files required)

3. It can split the .png files resulting through 1. into all subtextures

(merging is on its way ^^)

 

I attached a mediafire link conaining a runnable .jar with GUI

 

https://www.mediafire.com/folder/8a37ath7zayyd/Project%20Zomboid

 

P.S. I forgot to add some bytes at the end of each .png file while packing.

I fixed this bug and apologize for those who had problems -.-

Link to comment
Share on other sites

  • 1 year later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...