Main Site | Forum | Rules | Downloads | Wiki | Features | Podcast

NLSC Forum

Patchmaking tutorials for NBA 2K12.
Post a reply

Hex Editing: Court Colors

Tue Oct 18, 2011 10:35 am

The process looks to be identical to last year's. If you run into any issues with this procedure, please let me know.


I am going to walk you through how to change the Celtics green out of bounds and lane colors to their Saint Patty's Day gold. So first we need to get the RGB (Red, Green, Blue) values of that gold.

Image

Alright, so open the Celtics court up (f005.iff) in the hex editor of your choice. I use Hex Workshop, but as long as your editor has a Base Converter and basic Find, Find/Replace tools you should be OK.

Image

Alrighty, so the first thing we want to do is run a search for the following Hex, press CTRL + F to search.
Code:
FFFFFFFF000000000000000000000000FFFFFFFF

Image

Now we want to find the 2nd instance of that in the file. Then we want to look "up" in the file for the "0000 803F" in the first two columns. The part circled in red is the Celtics green we want to change.

Image

For those that know a bit more about hex, you want to look 8c bytes before the first instance of the code we searched for.

Image

Alright, so this is where it gets tricky. This area circled in red above contains the RGB for that Celtics green. What we need to do is convert the hex shown to Float (32 bit) values so we can get those into RGB numbers. We need to start looking at the hex like this.

Code:
|  Red   |  Green  |   Blue  |
DDBC 173E 4260 B13E 76AE 463E 0000803F


Hex Workshop automatically converts your selection into various things, like (un)signed bytes, (un)signed short/long, and what we need, Float values. Here are the 3 Float values that correlate to the RGB in that hex.

Image
Image
Image

Now we need to convert those decimals into RGB values. White is what you get when you max out the RGB scale, which is 255, 255, 255. Black is 0, 0, 0. These decimals we just obtained from that hex are actually relate to that 255 scale. To get the RBG values we need to multiply those decimals by 255.

Image

If we plug the RGB of 43, 101, 48 into GIMP or Pain, or whatever you use, that green looks familiar.

Image

So, if we multiply by 255 to go from decimal to RGB, we need to divide our custom RGB by 255 to get our Float decimals.

Image

Now that we have our Float values, we need to convert those to hex. I'm sure there is a website that will do this online, but Hex Workshop comes with a Base Converter which allows us to do the conversion in the program.

Image

You need to make sure that you choose "Intel" for the Byte Order and "float (32)" as the Data Type. You then want to input your decimal in the Decimal box and then copy out your generated Hex. Copy these out into notepad.

Image
Image
Image

So we should have this

Image

Now string them all together Red first, then Green, then Blue, and add the 0000803F at the end. You want to do a find/replace (CTRL + H in hex workshop), finding the original Celtics green hex, and replacing it with your new color.

Image

You want to make sure that you replace exactly the same amount as you find or else you will corrupt the file by changing the file size. The number of occurrences differs from court to court and depends if the court has multiple paint colors.

Image

Now that will replace all the green with the gold on the Celtics court, that means the out of bounds and both lane colors will be gold now. Courts with multiple colors on it, like the Lakers with the Purple lanes and Yellow out of bounds, will require you to look at the other instances of this code,
Code:
FFFFFFFF000000000000000000000000FFFFFFFF

and manually try to locate those colors. Unfortunately again, these color locations differ from court to court so we cannot simply have a list of offsets that cover them all.

Re: Hex Editing: Court Colors

Fri Nov 18, 2011 9:48 pm

sir jao can u make a tutorial of hex editing using hxd or is it the same as this?

Re: Hex Editing: Court Colors

Fri Nov 18, 2011 9:56 pm

The process would be the same using any hex editor. Some of the windows/commands would be a little different (from memory, Replace is Ctrl + R in HxD) but apart from that the steps are the same. As noted:

JaoSming wrote:Alright, so open the Celtics court up (f005.iff) in the hex editor of your choice. I use Hex Workshop, but as long as your editor has a Base Converter and basic Find, Find/Replace tools you should be OK.

Re: Hex Editing: Court Colors

Fri Nov 18, 2011 10:10 pm

thank you sir andrew.

Re: Hex Editing: Court Colors

Thu Nov 24, 2011 9:04 am

and to change the color of the lines, color in the paint and inside the three point line? Is it possible? as
Thanks from now

Re: Hex Editing: Court Colors

Thu Nov 24, 2011 9:33 am

same process, just a matter of finding them

Re: Hex Editing: Court Colors

Tue Nov 29, 2011 8:31 pm

can someone help me? :? ...please

I have problem to understand a couple of things. I read the tutor by jaosming, and it's simple to understand, but in practice I have problem with HEX codes:
for example: this is f001.iff ( milwauky) by mithbuster that I use for understand colors values

now, RGB values are between 255 and 0..right??..and I see the float values to understand decimal values to traslate in RGB values like in tutorial example....

Image

in this section ( the 2° of FFF000....) thre is this hex codes..should be the GREEN color but I have this decimal values
- 0 x 255= 0 ( R)
- 0,1843 x 255 = 47 ( G)
- 5, 0900 x 255 = 1297 ( :?: )...what values is it?
where is the green and red colors.. :( ..if someone help me I am very gratefull

Re: Hex Editing: Court Colors

Wed Nov 30, 2011 12:05 am

sorry man your wrong because of the "e"

http://en.wikipedia.org/wiki/Floating_p ... nt_numbers

replace the "e" with "x10^"

so instead of 5.0900001e-002, look at it as 5.0900001 x 10^-2 which equals 0.050900001

0.050900001 x 255 = 12.98 or 13

also remember that you are using an English program so your . and , will be switched, so 1.001 is 1,001 in the US, and 0,1843 looks like 0.1843 for me

Re: Hex Editing: Court Colors

Wed Nov 30, 2011 2:55 am

JaoSming wrote:sorry man your wrong because of the "e"

http://en.wikipedia.org/wiki/Floating_p ... nt_numbers

replace the "e" with "x10^"

so instead of 5.0900001e-002, look at it as 5.0900001 x 10^-2 which equals 0.050900001

0.050900001 x 255 = 12.98 or 13

also remember that you are using an English program so your . and , will be switched, so 1.001 is 1,001 in the US, and 0,1843 looks like 0.1843 for me


:shock: ..ohh,thanks, I did not know about this " e"...now I've found the right colors.
another question . if the float value is 1.0703125 ( for example),is a wrong hex line? for example, in the same f001.iff there is a couple of line
00008A3F 0000893F 00009A3F 0000803F: the float are
-1.078125
-1.0703125
-1.203125
if the RGB value exceeds the 255 is not a good line for edit colors? right?

Re: Hex Editing: Court Colors

Wed Nov 30, 2011 2:58 am

correct, there shouldnt be any float values over 1 for the colors

Re: Hex Editing: Court Colors

Wed Nov 30, 2011 3:05 am

ah ok, thanks much for the " revelation of the "e".. :D

Re: Hex Editing: Court Colors

Wed Nov 30, 2011 3:08 am

glad to help, can't wait to see what you are making (Y) (Y)

Re: Hex Editing: Court Colors

Mon Dec 12, 2011 7:04 pm

Hmm can you guide me what to search to find the paint colour? Do I find an instance of 0000 803f as well? Or is it different?

Re: Hex Editing: Court Colors

Mon Dec 12, 2011 10:43 pm

read the last part of the tutorial again

Re: Hex Editing: Court Colors

Tue Dec 13, 2011 5:46 am

Ok, there is something wrong with my hex workshop. I'm trying to search 0000 803f from f005.iff but its saying no instances found?

I also searched 'FFFFFFFF000000000000000000000000FFFFFFFF' but nothing found as well.

Re: Hex Editing: Court Colors

Tue Dec 13, 2011 10:32 am

make sure you are searching "hex values" look at my screenshot to make sure you are doing it right

Re: Hex Editing: Court Colors

Tue Dec 13, 2011 11:45 am

Yes I am searching hex values. From your screenshot, the only difference to mine is that yours says 'light' as Text, mine has dots instead like '...................'

I tried it on EditPad Pro and it cannot find it as well.

I was able to find instances of 803f but when I tested for RGB colours, the float values were too big like 2.2x10+18, etc.

Re: Hex Editing: Court Colors

Tue Dec 13, 2011 1:10 pm

ignore that "light" part, it was from the previous search and wasn't refreshed

did you decompress the file? open it in the mod tool before editing or the moddingway decompressor

Re: Hex Editing: Court Colors

Wed Dec 14, 2011 7:10 am

JaoSming, thanks bro. I was able to find what I needed to change. Sorry I had no idea that these were compressed. :D

Re: Hex Editing: Court Colors

Wed Dec 14, 2011 7:13 am

phew, glad it was something easy, ill be sure to add that to the tutorial

Re: Hex Editing: Court Colors

Sun Jan 22, 2012 11:22 pm

I've a little problem,
I'm trying to do a court on Idaho Stampede's base.
There's a part of the court colors that is white, and i can't find the way to change it, because there's too much Hex Values that are the White colours (Example for lightining and lines...). So how i can find the white part of painted area in Hex ?

Re: Hex Editing: Court Colors

Mon Jan 23, 2012 7:02 am

trial and error

Re: Hex Editing: Court Colors

Thu Jan 26, 2012 10:08 pm

Sorry, but i have another question.
How could i get trasparence on the floor?
I mean that in some zones there's no painted colour.
And it's possible to paint Three point inner area?

Re: Hex Editing: Court Colors

Fri Jan 27, 2012 1:17 am

since we cannot move things around you will have to find a court that has the lanes and shading you want already, then edit off that

Re: Hex Editing: Court Colors

Sat Mar 03, 2012 7:11 am

About the 8 digits after the colors. I think that is the transparency. I'm gonna make some test to see what happens with that numbers.
Post a reply