Mod/Replace one Rifle in HU2010

Post Reply
Average_Hunter_308
Posts: 2
Joined: 15 Nov 2023 03:46

Mod/Replace one Rifle in HU2010

#1 Post by Average_Hunter_308 » 15 Nov 2023 03:52

Hi all. Recently I got to play again HU2010 because for some reason the game didnt start in my older pc, then I remembered about HUpowerpack and downloaded it. The new weapons were really well made but I need help with creating/modifying an existing one. This is the thing. The Sauer 404 is by fsr my favourite rifle and I noticed the 6.5x55 model kinda resembles the shape of the weapon (except for the bolt safety and the front hand grip) I wanted to know how can I replace the caliber and texture of this weapon or If I need to, create a new one using the model. I have no idea of how to modify this game so any help is welcome. Thanks in advance
Adyusha
Posts: 10
Joined: 12 May 2022 18:55
Location: Russia

Re: Mod/Replace one Rifle in HU2010

#2 Post by Adyusha » 17 Nov 2023 13:32

Model
Unpack the base.scs archive into a separate folder. Go to the folder with weapon models: \models\weapons. Copy the 6x55bolt folder and rename it to 404sauer.

Materials
Open the folder with the 404sauer model and look for the weapon.pmd file there. Open it with any HEX editor. At the end of the file we find a line like: /automat/0a/12d39e.mat /automat/af/1cea5c.mat…These are the materials of the model. This model (6x55bolt) has twenty of them. That's quite a lot. But if you look more closely, you can see a pattern, namely:
/automat/0a/12d39e.mat
/automat/af/1cea5c.mat
/automat/57/ec9ab8.mat

Repeated five times, this is exactly the same as the types of camouflage in the game. Therefore, these are materials of weapons, and materials that do not repeat themselves are materials of hands (clothes in the game):
/automat/43/40319f.mat
/automat/1d/7e6ce4.mat
/automat/29/794879.mat
/automat/b9/434d38.mat
/automat/7b/2826b2.mat

In this example, we will not change them.

Creating copies of materials 12d39e.mat, 1cea5c.mat ,ec9ab8.mat. Rename:
12d39e.mat → 12d39x.mat
1cea5c.mat → 1cea5x.mat
ec9ab8.mat → ec9ab8x.mat

The last thing left to do with the materials is to register them in the weapon.pmd file. Open in the HEX editor and change the lines:
/automat/0a/12d39e.mat to /automat/0a/12d39x.mat
/automat/af/1cea5c.mat to /automat/af/1cea5x.mat
/automat/57/ec9ab8.mat to /automat/57/ec9abx.mat


Textures
We have specified the materials, now you need to specify the textures. This is done in two stages.
Firstly in the files .mat needs to specify the paths to .tobj files. The mat file has the following format:

Code: Select all

material : "hu.dif_spec.nm_offs.env" {
texture[0] : "/models/weapons/6x55bolt/barrel.tobj"
normal map : "/models/weapons/6x55bolt/barrel_no.tobj"
texture[1] : "/material/environment/generic_reflection.tobj"
...
The lines we need are texture[0] and normal map. texture[1] is responsible for reflections on the model, we will not affect it. In our case, it is enough for us to replace 6x55bolt with 404sauer in all three .mat files.

After that, we proceed to editing all the .tobj files. The obj file editor or hexadecimal editor is used for the file type. This is due to the fact that the path length is recorded in the file.
In the .tobj files, we replace 6x55bolt with 404sauer.
The textures are in .dds format. They are located in the folder with the model. Now we can edit them and it will only affect our model.

Weapon Code
At this stage, we will add the weapon to the list of weapons in the game. To do this, we need to go to the /def folder and find the equipment.def file. Open it and see the sections with the description of the weapon. Find: def 6x55_bolt:weapon_bolt…Completely copy the entire section. We insert it anywhere between other sections (the order of sections determines the order of weapons in the list, in the game). We are editing the section taking into account our new model. We specify the paths and configure other parameters (caliber, number of cartridges, cartridge icon). I got the following:

Code: Select all

def 404_sauer_bolt:weapon_bolt {
	short:"@@df_404sauer_s@@"
	long:"@@df_404sauer_l@@"
	desc:"@@df_404sauer_desc@@"
	pba_main:"/models/weapons/404sauer"
	look:"6x55"
	icon:"/material/ui/icon/w_6x55_bolt.mother"
	glow:"/material/ui/icon/w_6x55_bolt_glow.mat"
	ammo_char:"M"
	ammo_count:"4"
	ammo:"/script/ammo/6_5x55.sii"
	smd_fire:"/sounds/weapons/ws_375_fire_v2.ogg"
	photopost_category:"bolt"
	load_once:"true"
	view_root:"< -1 272 2 >"
	zero_range:"120"
}
Attention! If you have completed all the steps up to this point, then you can already start the game and see the new weapon model in the list. To do this, move the base folder to the base.scs archive (without compression). It works, but there are still a few touches left.

Name and description
To change the name and description, you need to add the appropriate lines to the local.def file, which is located on the path \script\en

Showroom
To change the texture in the showroom, you need to create copies of materials and change the paths in the _weapon.pmd file. The file is located in models\weapons\404sauer\showroom. In the files .mat replace 6x55bolt with 404sauer.
We went through this stage with the main model, this is a similar process.

Icon
Icons are listed in the lines:

Code: Select all

icon:"/material/ui/icon/w_6x55_bolt.mat"
glow:"/material/ui/icon/w_6x55_bolt_glow.mat"
Here you need to specify the path to the .mat files. Everything is done as described above in the item “materials". You can use a 3d editor to render png images of weapons.

Sounds
The sound of the shot can be changed by specifying in the line snd_fire: the path to the sound file. This is an ogg format file.
"Amat Victoria Curam"
[ external image ]
Average_Hunter_308
Posts: 2
Joined: 15 Nov 2023 03:46

Re: Mod/Replace one Rifle in HU2010

#3 Post by Average_Hunter_308 » 18 Nov 2023 07:18

Alright Ive managed to add the new weapon give it a name and a description also a new ammo was created now my only problem is texturing it. No matter how many times I modify the texture the weapon still looks as the 6.5x55. I need help to find what little word I need to change in order to see the modified texture on the rifle
Adyusha
Posts: 10
Joined: 12 May 2022 18:55
Location: Russia

Re: Mod/Replace one Rifle in HU2010

#4 Post by Adyusha » 18 Nov 2023 11:51

Could you provide the files of your mod? Everything works for me. I checked it by repeating all the steps.
Here is the archive - Archive
There is no localization file and ammunition in the archive, but the texture is edited without problems
"Amat Victoria Curam"
[ external image ]
Average_Hunter_308
Posts: 2
Joined: 15 Nov 2023 03:46

Re: Mod/Replace one Rifle in HU2010

#5 Post by Average_Hunter_308 » 18 Nov 2023 12:38

Just noticed I havent changed a file in the material folders. Apreciate it 👍
Pranav
Posts: 3
Joined: 24 Nov 2023 09:02

Re: Mod/Replace one Rifle in HU2010

#6 Post by Pranav » 27 Nov 2023 16:38

Average_Hunter_308 wrote: 18 Nov 2023 07:18 Alright Ive managed to add the new weapon give it a name and a description also a new ammo was created now my only problem is texturing it. No matter how many times I modify the texture the weapon still looks as the 6.5x55. I need help to find what little word I need to change in order to see the modified texture on the rifle
Congratulations on the new weapon and ammo! Texture difficulties can be challenging. Check your code for file paths that point to the right texture for the new weapon. Check that the texture files are properly formatted and located in the correct directory. Have a coding!
Post Reply

Return to “Hunting Unlimited Series”

Who is online

Users browsing this forum: No registered users and 0 guests