Customizing Weapon Settings
Following this tutorial, you can change the reload speed, firing rate, and magazine size for the weapon_rifle_springfield. Magazine size: 50, Reload speed: 0.5x (twice as slow), and firing rate: 3.5 (3.5 times faster).
First, create fxmanifest.lua with the following content:
fx_version "cerulean"
game "rdr3"
rdr3_warning "I acknowledge that this is a prerelease build of RedM, and I am aware my resources *will* become incompatible once RedM ships."
file 'weaponinfo_test.meta'
data_file 'WEAPONINFO_FILE_PATCH' 'weaponinfo_test.meta'
file 'weaponcomponent_test.meta'
data_file 'WEAPONCOMPONENTSINFO_FILE' 'weaponcomponent_test.meta'
Also, create two files:
weaponinfo_test.meta:
<?xml version="1.0" encoding="UTF-8"?>
<sss>
<CWeaponInfo>
<!-- Set value here -->
<Name>weapon_rifle_springfield</Name>
<!-- Weapon Magazine Size-->
<ClipInfos itemType="dyasubaa_0xde99e9ed">
<Item>
<Type>Magazine</Type>
<Size value="50" /> <!-- Set value here -->
<BulletsPerAnimLoop value="1" />
</Item>
</ClipInfos>
<!-- Weapon Reload -->
<WeaponReload type="CWeaponReload">
<ReloadTime value="-1" />
<VehicleReloadTime value="-1" />
<AnimReloadRate value="0.5" /> <!-- Set value here. Default: 1.0 -->
<SectionedReloadInfo />
<SectionedReloadInfoDual />
</WeaponReload>
<!-- Bullet speed flying. Matrix effect can be achieved with lower values :D -->
<Speed value="2000" />
<!-- Weaopon flags. It was manually configured by attempting and trying to achieve desired result. Checkout list of flags below.-->
<WeaponFlags>TwoHanded, AllowEarlyExitFromFireAnimAfterBulletFired, CanHipFire, CarriedInHand, Gun, AnimReload, CanFreeAim</WeaponFlags>
<!-- <WeaponFlags>Gun CanFreeAim AnimReload UsableOnFoot 0x72B9E864 Vehicle ForceEjectShellAfterFiring 0x75138DBF 0x82564383 Turret</WeaponFlags>
<WeaponFlags>CarriedInHand, Gun, CanLockonOnFoot, CanLockonInVehicle, CanFreeAim, TwoHanded, AnimReload, UsableInCover, UsableInVehicle, UseSectionedReload, UsableOnFoot, CanPerformArrest, DontBlendFireOutro, NoWheelStats, ktvicrua_0x0497cfae, pfhtvbfa_0x72b9e864, mbpfauja_0x0f00e598, OnlyFireOneShot, CanBeFiredLikeGun, OnlyAllowFiring, Vehicle, NonViolent, AllowCloseQuarterKills, AllowMeleeIntroAnim, ManualDetonation, SuppressGunshotEvent, AllowDriverLockOnToAmbientPeds, NoAutoRunWhenFiring, UseLeftHandIkWhenAiming, ForcesActionMode, CreatesAPotentialExplosionEventWhenFired, DisableStealth, IgnoreHelmets, TorsoIKForWeaponBlock, Unarmed, nqpnchea_0x82564383, qplkduda_0xdb7546e0, izwultja_0x087a39d7, smywzqua_0xb7db72ac, ffjiviaa_0x07f0cbca, zzqbnmcc_0xbdbbc7fe, ApplyVehicleDamageToEngine, BlockAmbientIdles, DisableFPSAimForScope, AttachFPSLeftHandIKToRight, AllowMeleeBlock, SwapToUnarmedWhenOutOfThrownAmmo, PlayOutOfAmmoAnim, DamageCausesDisputes, SkipVehiclePetrolTankDamage, gisenogc_0x1fce1778, DisableCrouch, ExclusivelyHolstered, bqlkqoha_0x895400e1, CanBeOffhandCarried, jlkqscbb_0xb241c6ea, wpircgea_0x70a9b652, xjfjmwea_0x352d6203, dvrdqnda_0xe7833781, fxopleia_0xd250dfdb, DropWhenLassoed, qfgglhja_0x3a829c54, xeqcqcaa_0x2610198c, rwutmjda_0x4411da0c, CannotInstantHolster, goaxxmja_0x282cf096, wthsbaua_0x60efb98c, allphuga_0x27895875, jbuvmeua_0x5fff57f6, ymigrtqb_0xb5506e4e, cnradqeb_0xd399b030, AllowILO, MeleeSmashable, ujdyudib_0xc6ee6dee, bcoctrsb_0x42bce923, xuepsdaa_0x255dcb79, ogtjhfca_0xaf408974, Shotgun, jfgpampa_0x5cac88b8, hdlluqra_0xc2b9b746, uxzzirka_0x8bc0aa13, Torch, MeleeThrown, ueicfoqa_0xe64f69a1, CanTwirl, siqrqfna_0x140ac63f, lpqxseaa_0xa93afc4b, MetalDetector, arsrskja_0x9aa4f395, lpespypa_0x4a515b55, dnxheula_0xa02bcf5b, UnequipDuringRagdoll, uqxjyvfa_0xfc80dbfc, vwyelbca_0x81ece712</WeaponFlags>
-->
</CWeaponInfo>
</sss>
weaponcomponent_test.meta:
<?xml version="1.0" encoding="utf-8"?>
<CWeaponComponentInfoBlob>
<Infos>
<Item type="CWeaponComponentInfo">
<Name>COMPONENT_RIFLE_SPRINGFIELD_GRIP</Name>
<UnlockHash />
<AttachBone />
<AccuracyModifier value="1.000000" />
<CameraFovModifier value="1.000000" />
<DamageModifier value="1.000000" />
<DegradationModifier value="1.000000" />
<FireRateModifier value="3.500000" /> <!-- Set value here. Default: 1.0 -->
<VfxOpacityModifier value="1.000000" />
<bShownOnWheel value="true" />
<CreateObject value="true" />
</Item>
<Item type="CWeaponComponentInfo">
<Name>COMPONENT_RIFLE_SPRINGFIELD_GRIP_IRONWOOD</Name>
<UnlockHash />
<AttachBone />
<AccuracyModifier value="1.000000" />
<CameraFovModifier value="1.000000" />
<DamageModifier value="1.000000" />
<DegradationModifier value="1.000000" />
<FireRateModifier value="3.500000" /> <!-- Set value here. Default: 1.0 -->
<VfxOpacityModifier value="1.000000" />
<bShownOnWheel value="true" />
<CreateObject value="true" />
</Item>
<Item type="CWeaponComponentInfo">
<Name>COMPONENT_RIFLE_SPRINGFIELD_GRIP_ENGRAVED</Name>
<UnlockHash />
<AttachBone />
<AccuracyModifier value="1.000000" />
<CameraFovModifier value="1.000000" />
<DamageModifier value="1.000000" />
<DegradationModifier value="1.000000" />
<FireRateModifier value="3.500000" /> <!-- Set value here. Default: 1.0 -->
<VfxOpacityModifier value="1.000000" />
<bShownOnWheel value="true" />
<CreateObject value="true" />
</Item>
<Item type="CWeaponComponentInfo">
<Name>COMPONENT_RIFLE_SPRINGFIELD_SIGHT_NARROW</Name>
<UnlockHash />
<AttachBone />
<AccuracyModifier value="1.000000" />
<CameraFovModifier value="1.000000" />
<DamageModifier value="1.000000" />
<DegradationModifier value="1.000000" />
<FireRateModifier value="3.500000" /> <!-- Set value here. Default: 1.0 -->
<VfxOpacityModifier value="1.000000" />
<bShownOnWheel value="true" />
<CreateObject value="true" />
</Item>
<Item type="CWeaponComponentInfo">
<Name>COMPONENT_RIFLE_SPRINGFIELD_SIGHT_WIDE</Name>
<UnlockHash />
<AttachBone />
<AccuracyModifier value="1.000000" />
<CameraFovModifier value="0.950000" />
<DamageModifier value="1.000000" />
<DegradationModifier value="1.000000" />
<FireRateModifier value="3.500000" /> <!-- Set value here. Default: 1.0 -->
<VfxOpacityModifier value="1.000000" />
<bShownOnWheel value="true" />
<CreateObject value="true" />
</Item>
<Item type="CWeaponComponentInfo">
<Name>COMPONENT_RIFLE_SPRINGFIELD_WRAP1</Name>
<UnlockHash />
<AttachBone />
<AccuracyModifier value="1.000000" />
<CameraFovModifier value="1.000000" />
<DamageModifier value="1.000000" />
<DegradationModifier value="0.900000" />
<FireRateModifier value="3.500000" /> <!-- Set value here. Default: 1.0 -->
<VfxOpacityModifier value="1.000000" />
<bShownOnWheel value="true" />
<CreateObject value="true" />
</Item>
<Item type="CWeaponComponentInfo">
<Name>COMPONENT_RIFLE_SPRINGFIELD_WRAP2</Name>
<UnlockHash />
<AttachBone />
<AccuracyModifier value="1.000000" />
<CameraFovModifier value="1.000000" />
<DamageModifier value="1.000000" />
<DegradationModifier value="0.900000" />
<FireRateModifier value="3.500000" /> <!-- Set value here. Default: 1.0 -->
<VfxOpacityModifier value="1.000000" />
<bShownOnWheel value="true" />
<CreateObject value="true" />
</Item>
<Item type="CWeaponComponentInfo">
<Name>COMPONENT_RIFLE_SPRINGFIELD_WRAP3</Name>
<UnlockHash />
<AttachBone />
<AccuracyModifier value="1.000000" />
<CameraFovModifier value="1.000000" />
<DamageModifier value="1.000000" />
<DegradationModifier value="0.900000" />
<FireRateModifier value="3.500000" /> <!-- Set value here. Default: 1.0 -->
<VfxOpacityModifier value="1.000000" />
<bShownOnWheel value="true" />
<CreateObject value="true" />
</Item>
<Item type="CWeaponComponentInfo">
<Name>COMPONENT_RIFLE_SPRINGFIELD_WRAP4</Name>
<UnlockHash />
<AttachBone />
<AccuracyModifier value="1.000000" />
<CameraFovModifier value="1.000000" />
<DamageModifier value="1.000000" />
<DegradationModifier value="0.900000" />
<FireRateModifier value="3.500000" /> <!-- Set value here. Default: 1.0 -->
<VfxOpacityModifier value="1.000000" />
<bShownOnWheel value="true" />
<CreateObject value="true" />
</Item>
<Item type="CWeaponComponentInfo">
<Name>COMPONENT_RIFLE_SPRINGFIELD_WRAP5</Name>
<UnlockHash />
<AttachBone />
<AccuracyModifier value="1.000000" />
<CameraFovModifier value="1.000000" />
<DamageModifier value="1.000000" />
<DegradationModifier value="0.900000" />
<FireRateModifier value="3.500000" /> <!-- Set value here. Default: 1.0 -->
<VfxOpacityModifier value="1.000000" />
<bShownOnWheel value="true" />
<CreateObject value="true" />
</Item>
<Item type="CWeaponComponentInfo">
<Name>COMPONENT_RIFLE_SPRINGFIELD_WRAP6</Name>
<UnlockHash />
<AttachBone />
<AccuracyModifier value="1.000000" />
<CameraFovModifier value="1.000000" />
<DamageModifier value="1.000000" />
<DegradationModifier value="0.900000" />
<FireRateModifier value="3.500000" /> <!-- Set value here. Default: 1.0 -->
<VfxOpacityModifier value="1.000000" />
<bShownOnWheel value="true" />
<CreateObject value="true" />
</Item>
</Infos>
</CWeaponComponentInfoBlob>
Customize the magazine size and reload speed in the first file, and the firing speed in the second file. Run your server and script and enter the game, check in the console (F8) that the files are successfully loaded:
And this is what our result looks like - a fully automatic weapon with 50 rounds in the magazine and reduced reload speed.
Additionally, you can replace the weapon model, and the result will look like this, but that’s not part of this tutorial.