.com.unity Forums

.com.unity Forums (http://forum.shrapnelgames.com/index.php)
-   Mods (http://forum.shrapnelgames.com/forumdisplay.php?f=249)
-   -   Distorted shp images in MobHack?? (http://forum.shrapnelgames.com/showthread.php?t=50142)

Gooseman2448 February 16th, 2014 08:50 AM

Distorted shp images in MobHack??
 
Hey guys,

Been working on a few things finally after a fatal hard drive issue. (My usb drive I was using got knocked off my desk... it was heart breaking.)

I had modified an icon (winter version of the LAV III 25) added it to a shp file and went to add it in MobHack but, the image was distorted.

Everything looks good in the shp file and as a bmp. It also looks fine in game.

I am just wondering if someone else had that issue and what you did to fix it.

I added the bmp files to a shp file I did previously and the images in line before these are fine in MobHack.

Anyway,
Cheers and great work by all as usual.
Gooseman2448

DRG February 16th, 2014 08:54 AM

Re: Distorted shp images in MobHack??
 
what are the exact dimensions of your shp image.... not the artwork, the pink square it sits on

Gooseman2448 February 16th, 2014 12:08 PM

Re: Distorted shp images in MobHack??
 
Well,

The bmp I modified is:

89x89
1.229x1.229 inches (yank measurement... lol)
72 pixel per inch
24 bit
16 million colors

I used a blank bmp exported from shped, copied and pasted from a bmp exported from MobHack. I made my modifications and saved as a new bmp.

I notice though that bmp images from MobHack are:

88x88
1.222x1.222 in
72 ppi
24 bit
16 mil

I then noticed in shped in SP Fix the images I put in are sized as 87x87 and all the others that look fine in MobHack are 88x88.

This confusses me because I have done this a hundred times before and made dozens of shp files and have not noticed this. It may be something basic I am missing or a change I am mot aware of, just not sure what.

If I can I will try to post my files, may be tomorrow when I can get to my desktop and better connection.

Thank you for taking the time to help DRG.

Mobhack February 16th, 2014 12:38 PM

Re: Distorted shp images in MobHack??
 
Shped is using a zero-based index (normal "C" behaviour). So 87 is 88 i.e. pixels 0..87. SHPED is not our code, it is a third party utility provided for your convenience, with permission.

Mobhack adds 1 to give an end-user friendly result and not what makes sense to C programmers;). End users tend to count from 1 up, not zero and up (the offset from the initial pointer index). That's why I report weapon slot 1 to 4, and not the 0 to 3 the game thinks they are, forex.

If replacing an existing SHP inside a SHP file then you have to use the exact same size. The icon sizes are hard-coded in internal game data. Your 89 pixel bitmap will likely have been packed into the space expected of the 88 square, so its going to produce weirdness.

Andy

DRG February 16th, 2014 01:04 PM

Re: Distorted shp images in MobHack??
 
89x89 is the accepted size for a standard BMP image to be processed into a SHP so disregard what Andy suggested. He doesn't work with them but I do but he is correct that Shped is using a zero-based index .

The numbers you said your image originally was should have worked and should not have produced a distorted image. HOWEVER.. because you ended up with 87x87 showing in SPFix I suspect you were set up for 88x88 not 89x89

Don

mkr8683 February 16th, 2014 11:20 PM

Re: Distorted shp images in MobHack??
 
How is it being distorted? I know it freaks out if you forget to save it in 24-bit.. also Mobhack shows weird icon images if they're bigger than 89x89.

Mobhack February 17th, 2014 12:03 AM

Re: Distorted shp images in MobHack??
 
How would I know? - SHPEdit is someone else's code, after all. As is the magic bit of indecipherable Delphi that someone sent me to decode SHP files way over a decade ago. Nor have I read the SHP file format specification since 2005 or thereabouts.

But - it probably stuffs the compression routine up no end by giving it an unexpected amount of data (each icon is individually compressed, not the SHP file as an entirety - that is about the only thing I half remember form 10-15 years ago).

Utter guess of course - I am not going to spend hours and hours reading code (especially obscure code I never wrote) to try to figure out whatever it does to answer some casual forum query, especially since there's a fix for the 'problem' that is already known..

Andy

mkr8683 February 17th, 2014 03:37 PM

Re: Distorted shp images in MobHack??
 
Andy, I was asking Gooseman what he means by the image being distorted.

Mobhack February 17th, 2014 03:50 PM

Re: Distorted shp images in MobHack??
 
Quote:

Originally Posted by mkr8683 (Post 823821)
Andy, I was asking Gooseman what he means by the image being distorted.

OK

Andy

DRG February 17th, 2014 04:42 PM

Re: Distorted shp images in MobHack??
 
Quote:

Originally Posted by mkr8683 (Post 823816)
How is it being distorted? I know it freaks out if you forget to save it in 24-bit.. also Mobhack shows weird icon images if they're bigger than 89x89.

NO, it does not....... but you cannot just drop anything in there you want

It's been YEARS since I've had to deal with this......thinking 15 at least. 89x89 is the standard for 99% of the BMP's that are made into SHP's but larger SHP's...... like the Vulcan bomber or the Russian Badger are a good examples of larger than 89x89 images that do NOT cause MOBHack to "freak out"

The Vulcan and Badger are 109x109 and I believe I have used 101x101 as well but for certain 89x89 and 109x109 work in MOBHack and those two sizes will cover every Icon needed by either game.

Don


All times are GMT -4. The time now is 12:40 AM.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©1999 - 2024, Shrapnel Games, Inc. - All Rights Reserved.