knuckles88 wrote:
OK so further to my previous post... I'm actually trying this right now and I'm getting a few errors.
-I was able to install grfmaker but I don't understand what I'm supposed to do with pngcodec. "sudo apt-get install pngcodec" does nothing - I can download a compiled binary from the pngcodec website, but I don't know where to put it so that I can call "pngcodec" in terminal and not have it fail. Right now I've placed pngcodec in the same folder as all the .png's, but when I run the script it repeatedly says "pngcodec: command not found"
You don't need grfmaker, but grfcodec for the create.txt script. Pngcodec can be forgotten about in the future, but is needed now in the conversion to decode the offsets in the png text chunks, so they can be used in the new format. That new format is created by grfcodec, and it needs png files and a text file (the nfo file, with information about the sprites, like the filename and offsets) as input.
So the scripts loops over all the png (that contain an encoded offset) in the old format, grabs the offset and creates and nfo file out of it. And then renumbers the lines in the nfo file (one more thing you need: nforenum) and finaly uses grfcodec to encode the nfo file and the pngfiles to make a .grf file that can be loaded by the game.
Your pngcodec problem can be solved by putting pngcodec in a directory that is included in your path, or by changing the script to call ./pngcodec if it is in the current directory.
knuckles88 wrote:
-I think I need some other libraries? I installed both PIL and PLY, but when I run the script it says "ImportError: No module named Image"
Check that you installed PIL correctly. I forgot about this in the previous post, but the script checks some palette stuff etc and needs PIL for that.
knuckles88 wrote:
-I'm still confused about what .png's go in the folder with the script. When I un-tar'd 32bit-gfx-nightly-megapack-2011-04-16 it contained all those subfolders I mentioned earlier. Trying to run create.txt from the parent folder failed, saying there were no images, so I extracted some of the files out of a subfolder, but I don't understand how the script can assign the correct meaning to each sprite this way - doesn't the subfolder provide important information about which graphics the .png's are to replace?
Perform the process per subfolder (except the 32bpp_extra folder, that one needs different handling). The most useful one to start with is the ogfx1_base folder. Go to this directory, check it contains several png files, and copy the necessary things: the pcx file and the script. The information about which graphics are replaced, is in the png file numbering (for the base sets, except for the extra grf, that is the reason why that one needs different handling). Start the script, if all goes well it will create a .grf file, that you can put in the newgrf directory of one of your recent game installs. And you can activate it ingame in the newgrf settings.