madrussian 347 Posted May 13, 2009 (edited) Anyone know what governs AI rate of fire at various ranges? By that I'm talking about how the AI will lower it's rate of fire for certain guns which are capable of a much higher rate of fire... but only when the range to the target is increased. For example, take an AI HMMWV armed w/ an M2 vs a Camel armed w/ a TwinVickers. Quick test in the editor reveals the following: 1. M2 opens up at full rate of fire as soon as the Camel is detected. 2. However, upon detection of the HMMWV, the Camel fires at a very low rate of fire, even though the TwinVickers is obviously capable of a much higher rate of fire. Weapons config for the M2: class M2 : MGun { scope = 1; displayName = $STR_DN_M2_MG; autoFire = 1; magazines[] = {"100Rnd_127x99_M2"}; sound[] = {"\ca\Weapons\Data\Sound\MachineGuns_M2HB_SS_v2", 3.16228, 1}; soundServo[] = {"", 0.0001, 1.0}; reloadTime = 0.11; magazineReloadTime = 10; dispersion = 0.002; canLock = 0; minRange = 1; minRangeProbab = 0.1; midRange = 400; midRangeProbab = 0.7; maxRange = 1200; maxRangeProbab = 0.04; aiDispersionCoefY = 7.0; aiDispersionCoefX = 7.0; maxLeadSpeed = 600; }; Hotfix for the M2: class M2 : Mgun { dispersion = 0.001; minRange = 1; minRangeProbab = 0.9; aiDispersionCoefY = 24; aiDispersionCoefX = 24; maxLeadSpeed = 100; }; Weapons config for the TwinVickers: class TwinVickers : MGun { scope = 2; displayName = $STR_DN_VICKERS; nameSound = "Mgun"; initSpeed = 740; reloadTime = 0.05; autoFire = 1; minRange = 1; minRangeProbab = 0.1; midRange = 400; midRangeProbab = 0.58; maxRange = 600; maxRangeProbab = 0.04; magazines[] = {"500Rnd_TwinVickers"}; canLock = 0; cursor = ""; cursorAim = ""; }; Hotfix for TwinVickers: class TwinVickers : Mgun { dispersion = 0.0013; maxLeadSpeed = 300; minRange = 1; minRangeProbab = 0.9; }; I see ranges and probabilities, but nothing I can note seemingly related to rate of fire at longer ranges. Both of these classes inherit from MGun, so it seems to me the key to this conundrum apparently lies within the code above? Can anyone help? Thanks! :xmas_o: Edited May 13, 2009 by MadRussian Share this post Link to post Share on other sites
.kju 3245 Posted May 13, 2009 aiRateOfFire = 0; aiRateOfFireDistance = 500; cfg ammo values. aiRateOfFire=0.100000; // delay between shots at given distanceaiRateOfFireDistance=200;// at shorter distance delay goes lineary to zero Both lines are working together : if distance from Target is >500 meters, the rate of fire will be 5 seconds between two "shots". If unit's closer from the target, the rate of fire will increase "lineary", until continuous firing. More here http://ofpc.de/wargames/e107_plugins/forum/forum_viewtopic.php?45.0#post_51 or here http://community.bistudio.com/wiki/CfgWeapons_Config_Reference Share this post Link to post Share on other sites
madrussian 347 Posted May 13, 2009 I see, it's an ammo thing. Will give this a go tonight. Much appreciated! :ok: Share this post Link to post Share on other sites