ThePedro004 Posted May 22 Share Posted May 22 (edited) This tutorial is one of the more advanced ones, so I suggest you have read at least as far as the models tutorial. We will need the HxD Hex Editor, you might remember how we used it to duplicate original materials from the game and use them under different names. In this tutorial we will do something similar, but a little more advanced. Suppose you want to change the color of the sea water in the game, or even the radar, because now it is no longer based on images, but rather a 3D model (a kind of vector). To do this we will have to modify the material used in these models. First, find the material you want to edit, let's suppose you want to edit the color of some element of the minimap, like the grass. Her Material Instance is located in SanAndreas\Radar: Now right-click on it and click Save Packages, select a save location, and click ok. This will save the .uasset and .uexp without extracting. Now extract the material as well by right clicking on it and clicking Export. In the folder you exported you should see these two files: By opening the .txt we will easily find a color parameter: We have the RGB there in float form, which goes from 0 to 1 instead of 0 to 255. We see that the R for Red is 0.016807, let's save this number, minimize the .txt. Now go to the folder where you selected Save Packages, you will see that there is the .uasset and .uexp file, you can delete the .uasset, it is not important in this case. Open the .uexp in the HxD Hex Editor: Now let's search for the value of Red, remember? 0.016807. (For some reason, it seems that when you install HxD in certain languages like Portuguese, it exchanges dots for commas. So in this case you should actually look for 0,016807, if the program is in English you probably don't need to do this Go to Find or press Ctrl + F. By default it is set to search for text, as in the models tutorial, but we need to search for the color float, use the little arrows up there and select Floating point number. Now paste the value of R in the search field (remembering to use a comma instead of a period, depending on your language) and click search all. We found it! You can see the float value of this selection in the sidebar: It is almost never the exact value there, it usually has a few more numbers, but it is normal. Now that we have found the Red, let's check if the Green is the same? Select the 4 bytes to the right of what you found (every two characters together are one byte) and check in the sidebar: 0,078! If we go into the notepad and check the value of Green: Same value! So the next 4 bytes should be Blue and the 4 bytes after it should be the value of Alpha (which in this case is 1). Now, how do we change these values? Simple, in the sidebar, under Single (float32), you can enter whatever value you want, use this site to convert normal RGB colors to float. We will use the values in RGB Normalized Decimal: Choose your color, in my case I'm going to change the grass to a strong red, we see there that the value of Red has to be 0.921, so in my Hex Editor I'm going to select the 4 bytes corresponding to the Red value and change the value to 0.921: It will be in red where you changed it, now let's change the next 4 bytes that correspond to Green, in my case, 0.019. Notice that when you press enter, the value is never exactly the same as you typed, it approximates, this is normal. Now I will edit blue, and I guess I don't need to explain, right? See how it looks at the end: Now save the file, delete the .pak and compile the mod in the same path as the original files and test in-game. It works! Notice that not all the grasses on the map have changed, but that is because the grass has various materials (from 01_ to 0_3). Tips: At least with the radar materials, the color offset will always be the same in Hex! If you see in the images, the colors are between offset 00000110 and 00000120, you can simply go straight to edit there in the same place in any material of the mini-map (there are some that don't, like MI_HiddenZone). But don't try to copy a file with one color and rename it to replace another! It gets buggy, do it manually for each one, you can copy the values of the offsets mentioned above in each file, it works fine. If you are going to make a color mod for the mini-map, make sure you also edit MI_Hiddenzone, because it controls the colors of the hidden parts of the map. If you want you can use as a base the one that comes in GTA 5's radar mod. Next Tutorial: Soon Back to the Tutorials Index Edited May 22 by ThePedro004 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now