Add new weapons to GTA 4 without replacing? (original) (raw)

I was dead tired yesterday. This is what I have done so far more clearly. I went into my GTA IV directory through openIV and looked into the ZolikaPatch.ini (in config text section).

I scroll through seeing options inside the file that can be enabled/disabled with corresponding values 1 and 0.

I see two options:

"IncreaseWeaponLimit=0 ; increase weaponinfo.xml to 256 weapons (after ANYWEAPON, the weapon names are ADDONWEAPON_(number)) (patch 5 and up only) "

and

"IncreaseWTDLimit=0; increase the amount of WTDs that can be in the game files"

I enable both with value 1.

I head into common/data. I make the new addonweapon stats within the base game's weaponinfo.xml. I switched the "unused0" slot I wrote for my G18 (an empty weapon slot seen in the trainer menu) into silenced pistol with stats.

My G18 has its own new separate animation I took from the one handed animation mod, I just renamed one of the custom gun animations to [email protected] and add it to pc/anim/anim.img.

I have the ak47 rifle remain a rifle with the new seperate ak74u as an smg in data slot but also using ASSAULT_RIFLE in the group stat. I made ak rifle an ak74m instead with replaced sounds so the ak74u maybe use the same sound.

I add the new separate wdr and wtd files. I edit the default.ide and animgrp.dat to make sure the new guns are recognized within the game for the trainer to spawn.

Example In default.ide:

###############################################################################
weap
###############################################################################

*downscroll

# sub-machineguns
w_uzi, w_uzi, gun@uzi, 1, 30, 0
w_mp5, w_mp5, gun@mp5k, 1, 30, 0
w_e2_p90, w_e2_p90, gun@p90, 1, 50, 0
w_e2_uzi, w_e2_uzi, gun@GOLD_UZI, 1, 50, 0 (just a note
w_g18, w_g18, gun@g18, 1, 30, 0 <---ADDONWEAPON_1
w_mac10, w_mac10, gun@uzi, 1, 30, 0 <---ADDONWEAPON_2
w_aks74u, w_aks74u, gun@ak47, 1, 50, 0 <---ADDONWEAPON_3)

*downscroll

end

###############################################################################
amat
###############################################################################

*downscroll

w_uzi,0,CM_WEAPONS_SMG
w_mp5,0,CM_WEAPONS_SMG
w_e2_p90,0,CM_WEAPONS_P90
w_e2_uzi,0,CM_WEAPONS_GOLD_UZI (note
w_g18,0,CM_WEAPONS_SMG <---ADDONWEAPON_1
w_mac10,0,CM_WEAPONS_SMG <---ADDONWEAPON_2
w_aks74u,0,CM_WEAPONS_AK47 <---ADDONWEAPON_3)
w_ak47,0,CM_WEAPONS_AK47

Example of animgrp.dat:

*downscroll

#-------------------------------------------------------------------
# Weapon groups
# o WeaponGroup( (Resident/Streaming), groupname )
#-------------------------------------------------------------------

*downscrol

WeaponGroup( Streaming, gun@uzi )
WeaponGroup( Streaming, gun@mp5k )
WeaponGroup( Streaming, gun@p90 )
WeaponGroup( Streaming, gun@GOLD_UZI ) (note
WeaponGroup( Streaming, gun@g18 ) <---ADDONWEAPON_1)
WeaponGroup( Streaming, gun@ak47 )

Addon weapons don't use any shooting sounds but still have impact and reload sound. The slienced pistol is very bugged and takes some trainer spawn and controller trickery to use,

no shot sound for that too but reload sound works. When i try to switch to another weapon it doesn't appear anymore and it gives it 9999 ammo.

Might try to copy and rename a deagle animation to see if that works for it. For some reason my G18 wasn't working at first when classified as a pistol, so I changed it to an smg for now.

The G18 was working before as an an auto pistol when I had it in the "unused0" slot I wrote in weaponinfo.xml. All addon weapons float mid air when throwing an empty ammo gun at the moment too.

Gonna read through this thread further as I go

Edited September 14, 2022 by sirebire999
:P