Jump to content

Ufo color Pallet


inteck

Recommended Posts

Ill try to make this brief. I have more than 1 .BMP file which uses 256 colors that are not to the specifications of the UFO pallet. Trying to import these files usually chops off a portion of the image or simply makes them look weird (providing you don't get tons of errors or an outright crash just trying to import them). Is their a way to convert BMPs with non standard UFO colors to the right ones used by ufo?? This is an ongoing problem that I ran into last time. I have more than one .bmp that simply WON'T import because of this ongoing situation. In particluar I have some replacements for the laser rifle, laser pistol and maybe a grenade or two. I am not too sure how to post images here *as Monkeylord did* but if anyone can help me out on this I would appreciate it. This may also be a problem with size, even though I have fitted everything exactly...this is frustrating.

 

See the end of this message for details on invoking

just-in-time (JIT) debugging instead of this dialog box.

 

************** Exception Text **************

System.NullReferenceException: Object reference not set to an instance of an object.

at PckView.ViewPck.paint(Object sender, PaintEventArgs e)

at System.Windows.Forms.Control.OnPaint(PaintEventArgs e)

at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer, Boolean disposeEventArgs)

at System.Windows.Forms.Control.WmPaint(Message& m)

at System.Windows.Forms.Control.WndProc(Message& m)

at System.Windows.Forms.ScrollableControl.WndProc(Message& m)

at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)

at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)

at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

 

 

************** Loaded Assemblies **************

mscorlib

Assembly Version: 1.0.5000.0

Win32 Version: 1.1.4322.2032

CodeBase: file:///c:/windows/microsoft.net/framework/v1.1.4322/mscorlib.dll

----------------------------------------

PckView

Assembly Version: 1.0.1702.29682

Win32 Version: 1.0.1702.29682

CodeBase: file:///D:/UNKNOWN/WORK/PCKVIEW.EXE

----------------------------------------

System.Windows.Forms

Assembly Version: 1.0.5000.0

Win32 Version: 1.1.4322.2032

CodeBase: file:///c:/windows/assembly/gac/system.windows.forms/1.0.5000.0__b77a5c561934e089/system.windows.forms.dll

----------------------------------------

System

Assembly Version: 1.0.5000.0

Win32 Version: 1.1.4322.2032

CodeBase: file:///c:/windows/assembly/gac/system/1.0.5000.0__b77a5c561934e089/system.dll

----------------------------------------

System.Drawing

Assembly Version: 1.0.5000.0

Win32 Version: 1.1.4322.2032

CodeBase: file:///c:/windows/assembly/gac/system.drawing/1.0.5000.0__b03f5f7f11d50a3a/system.drawing.dll

----------------------------------------

XCom

Assembly Version: 1.0.1702.29573

Win32 Version: 1.0.1702.29573

CodeBase: file:///D:/UNKNOWN/WORK/XCom.DLL

----------------------------------------

Accessibility

Assembly Version: 1.0.5000.0

Win32 Version: 1.1.4322.573

CodeBase: file:///c:/windows/assembly/gac/accessibility/1.0.5000.0__b03f5f7f11d50a3a/accessibility.dll

----------------------------------------

 

************** JIT Debugging **************

To enable just in time (JIT) debugging, the config file for this

application or machine (machine.config) must have the

jitDebugging value set in the system.windows.forms section.

The application must also be compiled with debugging

enabled.

 

For example:

 

<configuration>

<system.windows.forms jitDebugging="true" />

</configuration>

 

When JIT debugging is enabled, any unhandled exception

will be sent to the JIT debugger registered on the machine

rather than being handled by this dialog.

 

Any idea what this gibberish means??

 

Or how about this one (similar)

 

See the end of this message for details on invoking

just-in-time (JIT) debugging instead of this dialog box.

 

************** Exception Text **************

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.IndexOutOfRangeException: Index was outside the bounds of the array.

at XCom.PckImage..ctor(Int32 imageNum, Byte[] idx, Palette pal, PckFile pFile, Int32 height, Int32 width)

at XCom.PckImage.FromBMP(Bitmap b, Int32 num, Palette pal, Int32 startX, Int32 startY, Int32 width, Int32 height)

at XCom.PckFile.FromBmp(Bitmap b)

--- End of inner exception stack trace ---

at System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean isBinderDefault, Assembly caller, Boolean verifyAccess)

at System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean verifyAccess)

at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)

at XCom.Bmp.Load(String file, Type collectionType)

at PckView.PckView.openItem_Click(Object sender, EventArgs e)

at System.Windows.Forms.MenuItem.OnClick(EventArgs e)

at System.Windows.Forms.MenuItemData.Execute()

at System.Windows.Forms.Command.Invoke()

at System.Windows.Forms.Control.WmCommand(Message& m)

at System.Windows.Forms.Control.WndProc(Message& m)

at System.Windows.Forms.ScrollableControl.WndProc(Message& m)

at System.Windows.Forms.ContainerControl.WndProc(Message& m)

at System.Windows.Forms.Form.WndProc(Message& m)

at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)

at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)

at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

 

 

************** Loaded Assemblies **************

mscorlib

Assembly Version: 1.0.5000.0

Win32 Version: 1.1.4322.2032

CodeBase: file:///c:/windows/microsoft.net/framework/v1.1.4322/mscorlib.dll

----------------------------------------

PckView

Assembly Version: 1.0.1702.29682

Win32 Version: 1.0.1702.29682

CodeBase: file:///D:/UNKNOWN/WORK/PCKVIEW.EXE

----------------------------------------

System.Windows.Forms

Assembly Version: 1.0.5000.0

Win32 Version: 1.1.4322.2032

CodeBase: file:///c:/windows/assembly/gac/system.windows.forms/1.0.5000.0__b77a5c561934e089/system.windows.forms.dll

----------------------------------------

System

Assembly Version: 1.0.5000.0

Win32 Version: 1.1.4322.2032

CodeBase: file:///c:/windows/assembly/gac/system/1.0.5000.0__b77a5c561934e089/system.dll

----------------------------------------

System.Drawing

Assembly Version: 1.0.5000.0

Win32 Version: 1.1.4322.2032

CodeBase: file:///c:/windows/assembly/gac/system.drawing/1.0.5000.0__b03f5f7f11d50a3a/system.drawing.dll

----------------------------------------

XCom

Assembly Version: 1.0.1702.29573

Win32 Version: 1.0.1702.29573

CodeBase: file:///D:/UNKNOWN/WORK/XCom.DLL

----------------------------------------

Accessibility

Assembly Version: 1.0.5000.0

Win32 Version: 1.1.4322.573

CodeBase: file:///c:/windows/assembly/gac/accessibility/1.0.5000.0__b03f5f7f11d50a3a/accessibility.dll

----------------------------------------

 

************** JIT Debugging **************

To enable just in time (JIT) debugging, the config file for this

application or machine (machine.config) must have the

jitDebugging value set in the system.windows.forms section.

The application must also be compiled with debugging

enabled.

 

For example:

 

<configuration>

<system.windows.forms jitDebugging="true" />

</configuration>

 

When JIT debugging is enabled, any unhandled exception

will be sent to the JIT debugger registered on the machine

rather than being handled by this dialog.

 

 

If this means that the picture is not the correct size, I dont see how, my images have been shrunk to fit over the original images I saved as bitmaps from the original pck file.....weird

Link to comment
Share on other sites

I currently working on a program that will convert PCK files to GIF and back again. It's not done yet, but it'll handle transparency pretty well (as it's supported in GIF), and it'll also re-write the palette of your image to match UFO's if you mess it up.

 

As it stands, I have enough snippets of code lying around that I could create your PCK files for you now... The size of the image doesn't really matter, so long as it is 32 pixils wide. If you send the files you wanna convert to jeffy90@hotmail.com I'll see what I can do, but I may take a few days to get around to it. :blush:

Link to comment
Share on other sites

My program has never been able to export the bigobs file correctly. Doing a load/save to the original file will save it with just a couple bytes difference, but that is just enough to make them not display correctly in the original game. My theory is that the extra bytes are there to account for some hard coding in the exe, as all the other formats are 'optimal'.

 

And you are correct, the original intent of the program is to view the graphics. Saving an exported image came after all the view framework is in place and the code is... not so great. It needs to be rewritten more generically and with save/load/export/import in mind.

Link to comment
Share on other sites

Thanks for letting me know the facts on that Daishiva. More often than not, I have found that I am the one to blame for the messups :blush: , but on this occasion I was just flatly stumped. Munkeylord has a good stock of weapon images that I have never had any problem whatsoever importing into the game (go figure), and yet these few simple images I have been messing with really have been inflicting some pain. I have been messing around with these images using Paint Shop Pro 9 along with a couple of pallets I downloaded from your site. The images show up perfectly in the viewer, but when I go to import them, things just are not the same and look really bad. I used Kaisers old program and got more or less the same result. I have been trying to get these images looking right for the last couple of days and have been running into stone walls each and every way I turn. I am going to send Bomb Bloke a couple of the images I have been having serious problems with and see what he says. The laser rifle is 32x80 256 colors and I have been shrinking it, but that still doesn't work so I think i'm going to leave it alone for now.

 

I am going to go ahead and drop working on the images for the moment. I will work on some of the other stuff which I probably could have finished but got hung up on this.

Link to comment
Share on other sites

I currently working on a program that will convert PCK files to GIF and back again. It's not done yet, but it'll handle transparency pretty well (as it's supported in GIF), and it'll also re-write the palette of your image to match UFO's if you mess it up.

 

As it stands, I have enough snippets of code lying around that I could create your PCK files for you now... The size of the image doesn't really matter, so long as it is 32 pixils wide. If you send the files you wanna convert to jeffy90@hotmail.com I'll see what I can do, but I may take a few days to get around to it.  :blush:

 

I'm in no rush on the images as I have a lot to do myself. I just learned it might be possible to actually add about 6 images if I have TFTD (which I do). Be sure and give a post when you have completed your pallet. I for one am looking forward to it. I have downloaded the pallets from daishivas site, but either they are not at 100% or I am simply doing something wrong, because the laser rifle image simply doesn't do when I import it in. Crunching it down from 32x80 to 32x48 might be the problem, but I dont think so because the colors more or less remain the same. Let me know what you think when you get the time.

Link to comment
Share on other sites

I'm not writing a palette... I'm writing a program. My program gets most of it's palette information from the original game files.

 

Going by the debug info you posted, I don't think it's a color problem you're having. Methinks the program you're using doesn't handle image sizes correctly.

 

System.NullReferenceException: Object reference not set to an instance of an object.

at PckView.ViewPck.paint(Object sender, PaintEventArgs e)

 

--------------------

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.IndexOutOfRangeException: Index was outside the bounds of the array.

at XCom.PckImage..ctor(Int32 imageNum, Byte[] idx, Palette pal, PckFile pFile, Int32 height, Int32 width)

 

These two snippets are the important ones. The painter is blowing up because something being referrenced doesn't exist (or isn't being referrenced propally).

 

That might be because of the second snippet, where there's a referrence to a element of an array (think a slot in a grid) that isn't actually part of the grid...

 

Erm. Not helpful, I know, but whatever.

Link to comment
Share on other sites

I'm not writing a palette... I'm writing a program. My program gets most of it's palette information from the original game files.

 

Going by the debug info you posted, I don't think it's a color problem you're having. Methinks the program you're using doesn't handle image sizes correctly.

These two snippets are the important ones. The painter is blowing up because something being referrenced doesn't exist (or isn't being referrenced propally).

 

That might be because of the second snippet, where there's a referrence to a element of an array (think a slot in a grid) that isn't actually part of the grid...

 

Erm. Not helpful, I know, but whatever.

 

Just about any info on whats going on is useful. I used Irfanview to do (resize) the images a couple of times, then I tried paint shop pro 9 to try and get things right. I finally managed to get the image in, but the colors are still way off. I still don't understand the coloring mess up, I would have thought that PSP 9 in combo with daishivas color pallet would have set things right. At any rate, I will put this on hold for the moment. I look forward to seeing your program up and running. I for one am certainly going to download and use it.

Link to comment
Share on other sites

  • 2 weeks later...
What version of PCKView are you using? If it's 1.3. or 1.4. then the problem is that it messes up the .pck files (it should be by the reason you said, wrong dimensions) and makes them unloadable by the original game or Map View. If you get version 1.2. you will be able to replace the images without those problems.
Link to comment
Share on other sites

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...