Coding

 Reply to this postStart new topic

[Memory] GTA SA HUD Addresses

Deji
post Apr 15 2010, 08:46 PM
Post #1


Coding like a Rockstar!

Group Icon

Posts: 1,468
From: ???
Joined: 28-May 09



Changing HUD Colours


I'm working on making all the info more presentable and understandable smile.gif

Base Colours

CODE
0xBAB22C
  + 4*ID

There are 15 colours. Each colour has 4 bytes (RGBA). To get the desired colour, add 4 times the colour ID you wanna edit smile.gif You'll see that this "Base Colours" thing is the same address as the "Red Stuff" thing.


Base Colour IDs

CODE
   0  - Health Bar, Red Stuff
   1  - Cash/Money, Entered Car Name Text, Green Stuff
   2  - Blue Stuff
   3  - San Andreas Text (White/Blue)
   4  - Armour Bar, White Stuff
   5  - Black
   6  - Map Lines (Brown/Yellow)
   7  - Pink, Purple Stuff
   8  - Radio Text (Gray)
   9  - Dark Red
   10 - Dark Green
   11 - Yellow Stuff
   12 - Panel Text (Blue/Gray)
   13 - Blue Radar Blips
   14 - Yellow
   15 - Transparent


Edit: Seems these aren't just used by HUD elements.. 3D in-game elements use the same addresses in places where colour ID's are used... Obviously excluding car colours.

Higher values seem to just read from a memory offset, so since the Base Colour is 0xBAB22C, an ID of 2458 may come to memory address 0xBAD774.

As a CLEO Trick, you could create some memory space, get the amount of bytes between the Base Colour Address and the Address of the Memory Space you added and add that amount onto the Base Colour Address, meaning the colour will be read from your memory.

This is just theory, though... I've yet to put it into practise! This is like the oldskool DMA method of reading addresses tongue.gif


Example

SANNY
0006: 0@ = 0xBAB22C   // base
0A90: 1@ = 4 * 8   // radio text
005A: 0@ += 1@
0A8C: write_memory 0@ size 4 value 0xFF994400 virtual_protect 0
// value is the RGBA backwards


Result...



This post has been edited by Deji: Aug 23 2010, 06:00 PM


--------------------
Go to the top of the page
 
+Quote Post
Siggi
post Apr 16 2010, 01:43 PM
Post #2


User banned by request due to personal reasons. - SV

Posts: 24
From: 0xFFFFFFFF
Joined: 14-March 10



cool.gif wow, thats quite interresting Ó.ò gonna use the change panel text stuff tongue.gif


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


User banned by request due to personal reasons. - SV
Go to the top of the page
 
+Quote Post
Deji
post Jul 14 2010, 08:30 PM
Post #3


Coding like a Rockstar!

Group Icon

Posts: 1,468
From: ???
Joined: 28-May 09



There's much more to come!


Plane Radar Level RGBA

Ever wanted to change the colour of the plane level thingy? Umm... I guess not.. But here it is anyway...



CODE
0x58A514 - R
0x58A50D - G
0x58A506 - B
0x58A4FF - A


This is the first in the series of related finds since I g2g for now smile.gif


--------------------
Go to the top of the page
 
+Quote Post
Adler
post Jul 14 2010, 08:36 PM
Post #4


Devil's Advocate

Group Icon

Posts: 413
From: CA US
Joined: 26-July 09



Hehe I'll make it blue for some reason then. Can't let good memory go to waste. laugh.gif


--------------------
Go to the top of the page
 
+Quote Post
Deji
post Jul 14 2010, 11:48 PM
Post #5


Coding like a Rockstar!

Group Icon

Posts: 1,468
From: ???
Joined: 28-May 09



Aircraft Plane Height RGBA

This may be slightly more useful than the last thing. Depends on your needs when it comes to customization smile.gif

These addreses change the Aircraft Height Meter RGBA.



CODE
0x58A514 - R
0x58A50D - G
0x58A506 - B
0x58A4FF - A



Radar Aircraft Height Marker RGBA

The little white line that goes across the little black rectangle, signifying how high you are... Well.. Maybe you don't want it to be white...

CODE
0x58A753 - R
0x58A74A - G
0x58A741 - B
0x58A73C - A



Radar Plane Height Width

The width of the semi-transparent height box when in an aircraft.

CODE
0x85862C



Radar Y Position

I think the Y one was already posted by Seemann a while ago, so thank him for that.

CODE
0x866B70 [float]



Radar Height

This changes the actual height of the radar. Looks pretty weird...

CODE
0x866B74 [float]



Colour Intensity?

This seems to change the way light and colours are made... Most noticably when firing rockets from the hydra while close to the ground. Underneath the missiles there will be a cool glow which will vary depending on what you set for this. The way the values work is still unknown, though.



CODE
0x858A48 [float]



Odd Aspect Ratio Thing

Something to do with aspect ratio or just width/height limit to stuff on screen, but I can't figure out the right values to get it to work without mucking up the menu/HUD position/width/ratio etc.

CODE
0x859524 [float]



Font Size

The size of text on screen. If you increase this value, the text will either become more wide or have more height. It might take some meddling to get it all proportional.

However it also changes the position of the radar for some reason. Lower values put the radar further to the left. Again, not much of an idea of what this does.

CODE
0x858A10 [float]



I hope you got something useful out of this... I'm working on finding more.


--------------------
Go to the top of the page
 
+Quote Post
Deji
post Jul 15 2010, 01:44 AM
Post #6


Coding like a Rockstar!

Group Icon

Posts: 1,468
From: ???
Joined: 28-May 09



Wanted Star Sizes

Simple enough.. Changes the size of the wanted stars.

CODE
0x866C60 [float]


The value is similar to that global font size changer thing I posted... In that the float is a really low, fiddly value. I'm sure someone more used to this stuff would understand it better smile.gif

Try just turning the value down a little... You can probably get the stars to separate. On the other hand, you could squash them up.


Wanted Star Font

Want a really useless address? Want to change the wanted stars into ]'s?

CODE
0x58DCDB [byte]


Indeedy, the wanted stars work like standard text draw smile.gif


Wanted Star Border

Changes how thick the border of the wanted stars are... Just like in text draw.

CODE
0x58DD41 [byte]


0 = no border
1 = default
2 = thicker border

etc.


Wanted Star Border RGB

Yay!

CODE
0x58DD50 - R
0x58DD4E - G
0x58DD4C - B


Ooh.. No A? sad.gif


Alpha Of Stuff

The alpha transparency of the HUD Fist Icon, Money and Wanted Level.

CODE
0x859AAC [byte]


--------------------
Go to the top of the page
 
+Quote Post
Deji
post Jul 15 2010, 02:07 AM
Post #7


Coding like a Rockstar!

Group Icon

Posts: 1,468
From: ???
Joined: 28-May 09



Active Wanted Star Y-Pos

This changes the position of the yellow stars, not the black (inactive) ones. The default value is 12.0 - Anything higher places these active stars higher than the rest. Anything lower puts them lower than the rest.

CODE
0x858CCC [float]


I'm sure the idea of finding memory addresses is to post the most helpful ones... but I'm having fun finding these odd, random things that make little difference tongue.gif


Wanted Star Colour

You've probably been wanting a Wanted Star Colour RGB... Well unfortunately, there's only ID's for this one. There may be a way around this, but I don't know.

CODE
0x58DDC9 [byte]


Change the ID for a variety of different colours. Default is 6, which is yellow.

It's actually quite odd... The ID's seem to confirm with the carcols in many cases, however the R(ed) channel is ignored, I think... So you can only have a combination of Blue and Green, which make yellow, by the way.


--------------------
Go to the top of the page
 
+Quote Post
Deji
post Jul 15 2010, 02:46 AM
Post #8


Coding like a Rockstar!

Group Icon

Posts: 1,468
From: ???
Joined: 28-May 09



Clock Font

This all feels too easy to be good... Some advanced modder will probably come along saying that memory shouldn't be written like this or something tongue.gif But oh well, here's the font for the clock...

CODE
0x58EB5B [byte]



Clock Border

Like wanted star border. 2 is default.

CODE
0x58EB70 [byte]



Clock Border RGBA

CODE
0x58EB83 - R
0x58EB81 - G
0x58EB7F - B
0x58EB7A - A


Remember before when I said about setting the alpha of the clock wouldn't work well because of a black background? This is the RGBA to that background! So basically, feel free to create semi-transparent clocks.

I'm writing this as I'm going along, so I'm not sure yet... But I think I've figured out the solution to giving each HUD element a different colour... So editing the health bar colour doesn't change loads of other things.


Clock and Money Width

Changes the text width of the clock and money text.

CODE
0x866CAC [float]



Clock and Money Height

Changes the text height of the clock and money text.

CODE
0x858F14 [float]


--------------------
Go to the top of the page
 
+Quote Post
Deji
post Jul 15 2010, 03:18 AM
Post #9


Coding like a Rockstar!

Group Icon

Posts: 1,468
From: ???
Joined: 28-May 09



Clock Colour ID

Remember just now... When I said about the alternate method of HUD Colour Editing? This is it!

I'm to the understanding that the addresses posted in the first post edit the actual RGB of these ID's... Not the RGB of the elements themselves. The reason there are unknown ones that have a colour, but don't seem to change anything is because nothing is set to use that ID.

If we were to set each of these ID's to use a certain RGB, we could assign each HUD element to them manually. Thus separating them so that we can, say, change the colour of the green money text without changing the green car names and vice-versa.

CODE
0x58EBCA [byte]


Very similar to the Wanted Star variation, however it seems the ID's return different colours. E.G ID 5 doesn't make the clock colour yellow in this example.

Maybe it's because certain RGB channels are disabled... Maybe not. I've managed to get the clock to turn green, blue and red... So I'm really not sure at the moment. It's also 4AM in the morning, so I think I've been dedicated enough to this job... I'll stop soon.


Clock String Format

I was very happy to see this although I don't know why... I guess you can customize clocks, though.

This string goes by the rules of "printf" (if I remember right) in C, which is the style that CLEO 4's format feature uses.

CODE
0x859A6C [text(10)]


Default: %02d:%02d
Prints like: 14:39 or 09:04

If you were to change the format a little, you can do some fun things.

Changed To: %02d-%02i
Prints like: 14-39 or 09-04

Changed To: %2i:%02d
Prints like: 14:39 or 9:04

Changed To: %2i:%2i
Prints like: 14:39 or 9:4

This may also affect styled timers as well.


--------------------
Go to the top of the page
 
+Quote Post
Deji
post Jul 15 2010, 03:48 AM
Post #10


Coding like a Rockstar!

Group Icon

Posts: 1,468
From: ???
Joined: 28-May 09



Money Colour ID

Like the Clock Colour ID except for the cash instead smile.gif Oh, let me emphasize... This does not change any other colours... Just the clock!

CODE
0x58F492 [byte]




We aint had a screenshot in a while... Here's some of my HUD modifications so far...




Debt Colour ID

Just the money colour ID, except this one takes effect when your cash balance is in the minus.

CODE
0x58F4D4 [byte]



Money String Format

Just like clock format.

CODE
0x866C94 [text(5)]


Default: $%08d

The same thing, but when cash is in the negative...

CODE
0x866C8C [text(6)]


Default: -$%08d


More on cash later. Then: Health, Armour and Oxygen meters.


--------------------
Go to the top of the page
 
+Quote Post
Adler
post Jul 15 2010, 04:23 AM
Post #11


Devil's Advocate

Group Icon

Posts: 413
From: CA US
Joined: 26-July 09



Nice work Deji but the addresses for Aircraft Plane Height RGBA that you posted were the same as the Plane Radar Level RGBA. I guess you've been staying up wheeeyyy too late. tongue.gif


--------------------
Go to the top of the page
 
+Quote Post
DK22
post Jul 15 2010, 05:22 PM
Post #12


Member

Posts: 197
From: Liberty City, Shoreside
Joined: 15-July 10



wow, thanks, very helpfull for me.
Go to the top of the page
 
+Quote Post
Deji
post Aug 10 2010, 04:25 PM
Post #13


Coding like a Rockstar!

Group Icon

Posts: 1,468
From: ???
Joined: 28-May 09



w00t!

(edit) I updated the first post with the information wink.gif

Armour Bar - Enable Border
CODE
0x589123 [byte]

Disabling this stops the black border from being drawn around the armour bar.

Armour Bar - Enable Percentage Text
CODE
0x589125 [byte]

This will result in a percentage text showing inside the armour bar... It doesn't look too impressive, though...

Armour Bar - Enable Blue Thing
CODE
0x589127 [byte]

This will put a blue line on the end of the white on your armour bar and it moves left along with the white stuff when your armour goes down.


Draw Armour Bar
CODE
sub_728640(float posX, int posY, int width, int height, float, float, char drawPercentage, char drawBorder, unsigned int color, __int16)
0x728640


This is a function to draw the armour/health/lung capacity/stat/loading/status bar. I didn't have time to experiment with it.


Edit: A lot of mistakes were realised in this documentation. I'll be redoing it all later wink.gif


--------------------
Go to the top of the page
 
+Quote Post
Deji
post Aug 21 2010, 12:48 AM
Post #14


Coding like a Rockstar!

Group Icon

Posts: 1,468
From: ???
Joined: 28-May 09



Armour Required For Armour Bar

CODE
0x5890D3 [dword]


Write a pointer, like so:
SANNY
0007: 31@ = -1.0
0AC7: 30@ = var 31@ offset
0A8C: write_memory 0x5890D3 size 4 value 30@ virtual_protect 1


31@ is the armour required. In this example, the armour bar will always display (unless you somehow get the armour below -1.0). Usual value is 1.0 @ 0x858624.


Armour Width Percentage Multiplier

CODE
0x589131 [dword]


Again, a pointer to a float. This one limits the amount of armour to display. If you set 50.0 the armour bar will only fill up half way. This affects that "percentage" thing I posted as well. It'll display 50% max.

If you set it to 150.0, your armour bar will be 150% full when you have full armour... You'll notice, though, that your armour bar goes down quicker... So this is a multiplier.


Armour Height

CODE
0x589146 [dword]


This pointer defines the height of the armour bar in pixels (did I already post this?).

SANNY
0007: 29@ = 9.0    // default
0AC7: 30@ = var 29@ offset
0A8C: write_memory 0x589140 size 4 value 30@ virtual_protect 1



Armour Width

CODE
0x58915D [dword]


Just like the last.. Pointer to a float of the width in pixels.


Armour Y Position

CODE
0x58EF3A [dword]


Guess what! It's a pointer to a float.


Armour X Position

Same as above except for the X Position.

CODE
0x58EF59 [dword]


EDIT: Actually, this is a margin.. The value works from right to left wink.gif


--------------------
Go to the top of the page
 
+Quote Post
Deji
post Aug 21 2010, 10:50 AM
Post #15


Coding like a Rockstar!

Group Icon

Posts: 1,468
From: ???
Joined: 28-May 09



Ohh yeah! Thought I posted this...


Armour Color ID

CODE
0x5890F4 [byte]


Default: 4

See the big list of color ID's at the top of the page! smile.gif


And by the way.. Most of these Armour addresses affect Player 2's armour meter in 2player mode, but the X and Y pos ones don't (I'll leave the reason to your imagination and/or common sense).

Can't be assed getting it at the moment, so if anyone wants them, just ask tongue.gif


--------------------
Go to the top of the page
 
+Quote Post
Deji
post Aug 22 2010, 12:42 PM
Post #16


Coding like a Rockstar!

Group Icon

Posts: 1,468
From: ???
Joined: 28-May 09



Health Bar Right Margin/XPos (Pointer)

CODE
0x58EE85 [dword]



Health Bar Y Pos (Pointer)

CODE
0x58EE66 [dword]



Health Colour ID

CODE
0x589329 [byte]


--------------------
Go to the top of the page
 
+Quote Post
Deji
post Oct 1 2010, 12:10 AM
Post #17


Coding like a Rockstar!

Group Icon

Posts: 1,468
From: ???
Joined: 28-May 09



Base Colours


SANNY
Start = 0xBAB22C
End = 0xBAB268
Size = dword (RGBA - 1 byte per value)
Num = 15


Here.. have a rather messy table smile.gif

IDAddressColor
00xBAB22C0xB4191DFF
10xBAB2300x36682CFF
20xBAB2340x323C7FFF
30xBAB2380xACCBF1FF
40xBAB23C0xE1E1E1FF
50xBAB2400x000000FF
60xBAB2440x906210FF
70xBAB2480xA86EFCFF
80xBAB24C0x969696FF
90xBAB2500x680F11FF
100xBAB2540x26471FFF
110xBAB2580xE2C063FF
120xBAB25C0x4A5A6BFF
130xBAB2600x1419C8FF
140xBAB2640xFFFF00FF


--------------------
Go to the top of the page
 
+Quote Post
Adler
post Oct 10 2010, 09:38 PM
Post #18


Devil's Advocate

Group Icon

Posts: 413
From: CA US
Joined: 26-July 09



Damn that's a nice table. Awesome finds Deji!


--------------------
Go to the top of the page
 
+Quote Post
Deji
post Oct 11 2010, 06:21 AM
Post #19


Coding like a Rockstar!

Group Icon

Posts: 1,468
From: ???
Joined: 28-May 09



Moved post here... I need to stop making posts at 7AM...


--------------------
Go to the top of the page
 
+Quote Post
jayd00
post Nov 29 2010, 06:38 AM
Post #20


Ameteur Member

Posts: 42
From: Guatemala
Joined: 22-December 09



QUOTE (Deji @ Jul 14 2010, 09:48 PM) *
Money Colour ID

For all this hard work, I deserve 1,000 members tongue.gif Oh well, I like simply providing resources for drifters as well...

Like the Clock Colour ID except for the cash instead smile.gif Oh, let me emphasize... This does not change any other colours... Just the clock!

CODE
0x58F492 [byte]



We aint had a screenshot in a while... Here's some of my HUD modifications so far...


how can I use it in a script?? to change the color
thanks! wink.gif

and what about positions? how to move the health bar? and how to change direction? the health bar in a vertical bar?

thumbsup.gif




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


Go to the top of the page
 
+Quote Post
Reply to this postStart new topic

2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members: