Please read the Forum Rules before posting.
![]() ![]() |
8th August 2005, 5:20pm
Post
#1
|
|
|
Sergeant ![]() ![]() ![]() Group: Members Posts: 67 Joined: February 2003 Member No.: 538 |
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 |
|
|
|
9th August 2005, 7:13am
Post
#2
|
|
![]() Xcomutil Developer ![]() ![]() ![]() ![]() Group: Members Posts: 573 Joined: November 2002 From: Gresham, Oregon, USA Member No.: 136 |
Have you tried contacting Daishiva directly? He's probably the only one who can tell you what his programs errors mean.
-Blade FireLight -------------------- QUOTE Combat is very simple, there is a first place and second place, second place is laying face down in the mud, sometimes, so is first place. |
|
|
|
9th August 2005, 2:52pm
Post
#3
|
|
|
Sergeant ![]() ![]() ![]() Group: Members Posts: 67 Joined: February 2003 Member No.: 538 |
QUOTE(BladeFireLight @ Aug 9 2005, 07:13 AM) Have you tried contacting Daishiva directly? He's probably the only one who can tell you what his programs errors mean. -Blade FireLight After cussing myself and my machine, a friend of mine (7 years younger than myself) came over and pointed out an embarasingly simple fact. Daishivas Pck viewer does not properly encode 32x48 images used by the original files. If you use it to save over the original pictures with other 32x48 bmps, all sorts of "events" will take place. The modified Bigobs.pck file will be completely wrong, even if you match your modified/new 32x48 image(s) to the letter with correct colors. It seems to be that while it can read the originals and their "Bigobs.pck/Bigobs.tab" correctly, attempting to replace the original images with any any other 32x48 bmp will result in failure as it is encoded/saved improperly. This took a while to figure out, because I was matching EVERYTHING exactly and the new 32x48 bmp images I was using were showing up properly (in the original Bigobs.pck) when read by the viewer. Yet when I used the saved/modified Bigobs.pck file in the game, I had pieces of weapons and graphic glitches everywhere. To add to the confusion it will also read 32x40 images. Loading up the original Bigobs.pck file and then importing a smaller 32x40 image will cause an exception (progam crash and error seen above). If you do NOT load up the original .pck, and instead simply load up a 32x40 bitmap it will work.......saving the now single image back into .pck form will create both a custom "bigobs.pck" file and "bigobs.tab" file which read 32x40 images. On a rather strange note; those that saved original images from the 32x48 Bigobs.pck will find that the custom Bigobs.pck CAN import these images, but since the vertical spacing is wrong, the images will usually be cut off at the very bottom or top. Bottom line- While the 32x40 format is O.K. taking the time to re-size all the 32x48 images is not practical (IMHO) and causes image distortion. My friends own personal suggestion was to simply use this program for what it is good for-namely viewing and making sure my pictures can be imported correctly. Until Daishiva can re-program this utility to work with and encode 32x48 bmp images files back into the original bigobs.pck properly (views them just fine), it looks like I am going to be stuck using Marco Kaisers old program to put stuff into the game. Is there anyone here who knows if Daishiva is working on this problem?? I don't want to bother sending an E-Mail in over there if someone else has already mentioned these. |
|
|
|
10th August 2005, 7:58am
Post
#4
|
|
![]() The Smily Admin ![]() ![]() ![]() ![]() ![]() Group: Admin Posts: 2,999 Joined: September 2002 From: Tasmania (AU) Member No.: 152 |
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. -------------------- |
|
|
|
10th August 2005, 4:56pm
Post
#5
|
|
![]() .net modder ![]() ![]() ![]() Group: Members Posts: 93 Joined: November 2002 From: Tucson, AZ Member No.: 256 |
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. -------------------- Author of MapEdit.net and PckView.net - http://www.daishiva.com
Member 2^8 |
|
|
|
10th August 2005, 10:01pm
Post
#6
|
|
|
Sergeant ![]() ![]() ![]() Group: Members Posts: 67 Joined: February 2003 Member No.: 538 |
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
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. |
|
|
|
13th August 2005, 2:38am
Post
#7
|
|
|
Sergeant ![]() ![]() ![]() Group: Members Posts: 67 Joined: February 2003 Member No.: 538 |
QUOTE(Bomb Bloke @ Aug 10 2005, 07:58 AM) 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. 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. |
|
|
|
13th August 2005, 4:50am
Post
#8
|
|
![]() The Smily Admin ![]() ![]() ![]() ![]() ![]() Group: Admin Posts: 2,999 Joined: September 2002 From: Tasmania (AU) Member No.: 152 |
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. QUOTE("Gibberish Output") 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. -------------------- |
|
|
|
13th August 2005, 4:21pm
Post
#9
|
|
|
Sergeant ![]() ![]() ![]() Group: Members Posts: 67 Joined: February 2003 Member No.: 538 |
QUOTE(Bomb Bloke @ Aug 13 2005, 04:50 AM) 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. |
|
|
|
27th August 2005, 3:47am
Post
#10
|
|
![]() The Smily Admin ![]() ![]() ![]() ![]() ![]() Group: Admin Posts: 2,999 Joined: September 2002 From: Tasmania (AU) Member No.: 152 |
I'm thinking you've got the right colors in the wrong places.
-------------------- |
|
|
|
27th August 2005, 9:08pm
Post
#11
|
|
![]() Satan's Kitten ![]() ![]() ![]() ![]() Group: Fan Fiction Posts: 558 Joined: September 2002 Member No.: 503 |
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.
-------------------- My X-COM:Area 51 site UFO terrain mods, fanfic, etc.
My X-COM Fan Fictions: The Unknown Menace, Abyssal, Eulogy ![]() |
|
|
|
![]() ![]() |
Similar Topics
| Topic Title | Replies | Topic Starter | Views | Last Action | |||
|---|---|---|---|---|---|---|---|
![]() |
4 | -Anonymous- | 595 | 17th October 2003, 10:36pm Last post by: -Anonymous- |
|||
![]() |
3 | dude | 513 | 27th November 2003, 6:06pm Last post by: uly |
|||
![]() |
9 | HunterKiller | 848 | 4th January 2008, 6:39am Last post by: Bomb Bloke |
|||
|
Lo-Fi Version | Time is now: 2nd December 2008, 3:02am |