MakeSHP -- quick PNG to SHP converter

Information and discussion for custom maps and mods.
Post Reply
chrisf
Posts: 246
Joined: Mon Sep 06, 2010 4:59 am

MakeSHP -- quick PNG to SHP converter

Post by chrisf »

Here's a very simple tool for converting 8bit (correct palette!) PNGs to SHP without having to wrangle XCC Mixer.

Setup: unzip this package into a folder somewhere

Name your PNGs with frame numbers -- 1.png, 2.png, 3.png etc.

Do

Code: Select all

`makeshp firstframe# lastframe# outputfile.shp`
like this:

Code: Select all

makeshp 1 5 myunit.shp 
Attachments
makeshp-a1.zip
makeshp and prerelease version of OpenRA.FileFormats.dll required for it to work
(53.94 KiB) Downloaded 529 times

chrisf
Posts: 246
Joined: Mon Sep 06, 2010 4:59 am

Post by chrisf »

Ouch! Two retarded things:

1. I left an absolute path in the app.
2. The .NET image loader forces everything to the wrong pixelformat on load, so the palette is all screwy.

chrisf
Posts: 246
Joined: Mon Sep 06, 2010 4:59 am

Post by chrisf »

Here's a new version of makeshp. It works the same way, but it fixes the dimensions of the files for you, and also actually works.
Attachments
makeshp-a2.zip
(133.96 KiB) Downloaded 490 times

chrisf
Posts: 246
Joined: Mon Sep 06, 2010 4:59 am

Post by chrisf »

Disregard that, I should actually test the builds I upload.
Attachments
makeshp-a3.zip
(133.94 KiB) Downloaded 512 times

Matt
Posts: 1144
Joined: Tue May 01, 2012 12:21 pm
Location: Germany

Post by Matt »

You should add this to OpenRA.Utility.exe

Matt
Posts: 1144
Joined: Tue May 01, 2012 12:21 pm
Location: Germany

Post by Matt »

Do you still have the source code for it?

chrisf
Posts: 246
Joined: Mon Sep 06, 2010 4:59 am

Post by chrisf »

This is what grew into OpenRA.Utility's --shp command.

Matt
Posts: 1144
Joined: Tue May 01, 2012 12:21 pm
Location: Germany

Post by Matt »

It would be nice to select multiple single PNGs instead of one already appended one sometimes though.

tacozmeister
Posts: 126
Joined: Tue Jun 26, 2012 3:37 am
Location: St. Louis, MO

Post by tacozmeister »

I tried it, and I got this.

Code: Select all

Unhandled Exception: System.IO.EndOfStreamException: Unable to read beyond the end of the stream. 
    at System.IO.BinaryReader.ReadByte()
    at OpenRA.Fileformats.Graphics.PngLoader.Load(Stream s)
    at OpenRA.FileFormats.Graphics.PngLoader.Load(String filename)
    at makeshp.Program.Main(String [] args)
I input "makeshp 1 1 anyname.shp" in the correct directory.

chrisf
Posts: 246
Joined: Mon Sep 06, 2010 4:59 am

Post by chrisf »

Use OpenRA.Utility, not makeshp. This is a dead tool.

Post Reply