ThePedro004 Posted May 22 Share Posted May 22 (edited) In this tutorial you will learn how to change models and create custom materials for the game. This tutorial requires a little more attention and is more advanced than the previous ones, so I will expect you to at least know the basics of some 3D software to proceed. For this tutorial we will be using Blender 3D, HxD Hex Editor and Fmodel. The tutorial would also get very long if I stopped to explain each thing, so I will focus on the really important, at this point I hope you already know how to modify the game properly, I will not mention basic things anymore. The first thing to do is extract the model you want to replace using Umodel, in my case, I will replace a gun, the "SM_cuntgun" hunting rifle. After that, open the original model and the model you are going to replace in Blender and adjust the position and scale of the new model to match the model to be replaced. Delete the original model from the scene and export it as .fbx. Now open your project in Unreal Engine and create the same folder structure you took your original model from, in my case it is SanAndreas\Weapons. Now import your .fbx and all your textures in there. Now we have to rename things to the right name, start with the static mesh, which in my case is SM_cuntgun. Then rename one of the textures to the original texture name, I will rename the Material one, because it doesn't have a number in front like the others, it will use the texture that is already in the game! Now double click on the static mesh and look at the order of the materials, this is very important because it will help you know which material represents which texture, if you want, write this down on a notepad, luckily my model has the textures named the same as the materials. Now delete ALL the materials. Now create a Material Instance, with the name of the original Material Instance, in my case MI_countryside_rifle. Now open your static mesh again and drag your Material Instance into the first material slot, after all, this is the first texture in the load. REMEMBER: Your material instance has to be in the same folder as the original file! In my case it is in the same folder as the textures and the model, but with you it can be different! Always keep the correct structure! Now we must create custom materials, because the original model only has one, and the new model has several! To do this, we will do the following: Rename all the remaining textures to the same name as the first texture, just change the last letter of the name, it can be a number, in my case, I will change T_countryside_rifle_BC to T_countryside_rifl1_BC. The suffix remains the same for each texture map type. See below for the before and after: Before After You can change the name in another way but keep the same number of characters as the original texture name! Now create material instances for all the textures, for example, if we have the texture countryside_rifl3, create MI_countryside_rifl3. Do this for all textures: Now open the static mesh and drag each material to the correct order, based on the texture: Press save all and bake the files, our work is done in Unreal Engine. Take advantage and create a folder for your mod files, preferably already in the right structure to compile. Copy the cooked Unreal Engine files into this folder AND DELETE ALL THE "MI_" (Material Instances) FILES. We will not use them, they only served to tell the model where to look for the textures. Now let's make our custom materials, or rather, let's hack the original materials. Open FModel and go to the folder where the Material Instance from the original Model is located and click Export Data: Now go to the FModel\Output\Exports folder and copy the original file you just exported and paste it into your mod folder. This is the original game material, create copies of it with the same name as the textures, just as you did in unreal engine. You can even delete the original Material Instance, because the game already has it, right? You are just creating the others. Now pay close attention, this is the last step, do it correctly and carefully, otherwise you will have problems! Open the HxD Hex Editor and drag the .uasset from the first material into the program, in this case MI_countryside_rifl1.uasset: (In this bit of the tutorial, the software is in Portuguese, but don't worry, the instructions will match with the text displayed on your computer). Take it easy! Don't be scared, you don't need to understand anything there. We are just going to redirect the original material "MI_countryside_rifle" to "MI_countryside_rifl1". To do this, go to locate > replace, or press Ctrl + R, and a window will open in which you will enter the text to be replaced and what you want to replace it with! In our case, this is the material ending with rifl1, the original ending with rifle. So we will do this: And click replace all! Click ok in the window that appears and save the file. That's it, our custom material is created, now you just need to do this for the rest of them. The next material ends with rifl2, and so on! Now delete the .bak files that will appear in the mod folder, they are backups that HxD creates, but they are not necessary. Now you can compile the mod and test it ingame! This tutorial was very difficult to write, probably many people will get confused the first time they try it, so I ask you to read it very carefully before asking anything. There are probably easier ways to do this, if so, please let me know. Next Tutorial: How PBR Textures Work Back to the Tutorials Index Edited May 22 by ThePedro004 Indovercetti 1 Link to comment Share on other sites More sharing options...
kapilarny Posted August 1 Share Posted August 1 Hey bro, btw how can you replace characters models? For some reason can't find those in UModel. Link to comment Share on other sites More sharing options...
Indovercetti Posted August 18 Share Posted August 18 On 8/1/2022 at 9:52 PM, kapilarny said: Hey bro, btw how can you replace characters models? For some reason can't find those in UModel. use FModels, you Umodel sucks, Fmodel will show you far more files. Also you gotta install some additional microsoft software then only it will run 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