Jump to content

Recommended Posts

Alright so I'm quite new to Arma 3, I mean 300 hours Isn't much If you're talking about Arma. Point Is, I am using EDEN Editor, I have 6 MG-42's lined up behind sandbags ready to shoot at zombos, but It's not really cool If an MG-42 not only shoots at short range, but also shoots semi-automatically. So how do I get my MG-42 Units to shoot full-auto at long distance?   

Share this post


Link to post
Share on other sites
On 3/4/2022 at 7:28 AM, SpunkAids said:

Alright so I'm quite new to Arma 3, I mean 300 hours Isn't much If you're talking about Arma. Point Is, I am using EDEN Editor, I have 6 MG-42's lined up behind sandbags ready to shoot at zombos, but It's not really cool If an MG-42 not only shoots at short range, but also shoots semi-automatically. So how do I get my MG-42 Units to shoot full-auto at long distance?   

found on the Forum:

 

Posted June 18, 2016

So. You have created an awesome weapon sound and want to hear how it sounds in full auto, like it's fired by other human players? Especially at distances? How the HELL do you get this stupid AI to fire a nice, long burst?
 
Well, you do it like this. Thanks to kju and jokoho482 I now have this little script that forces the AI to fire every X seconds.
 
What you need:
-find out the reloadTime parameter of the weapon you are modding, this says how much time passes until another bullet is fired when the trigger is held down
-a HOSTILE unit named "AI_Shooter"

 

Put this code into a file in your mission folder, name that file "let_ai_shoot.sqf".
 

In your mission create two repeatable radio triggers (alpha and bravo). You are going to use the first trigger to start the AI's firing, the 2nd trigger to stop it.
 

letAiShoot = true;
[] spawn { while {letAiShoot} do { //how many bullets should the AI fire? in this case its 10
_burstLength = 10; //what is the reloadTime of the weapon? find it in the weapon'S firemodes
_reloadTime = 0.056; for "_i" from 0 to _burstLength do { _currentWeapon = currentWeapon AI_Shooter; _weaponModes = getArray (configFile/"CfgWeapons"/_currentWeapon/"modes"); _desiredWeapon = _weaponModes select 0; AI_Shooter forceWeaponFire [_currentWeapon,_desiredWeapon]; // reloadTime here sleep
_reloadTime; AI_Shooter setWeaponReloadingTime [AI_Shooter,_currentWeapon,0]; AI_Shooter setVehicleAmmo 1; }; //how many seconds to wait until next burst?
sleep 2; }; }; //if you don't want the AI to aim at the player, just comment out this following block by using /* at the start and */ at the end of the block
[] spawn { while {letAiShoot} do { AI_Shooter reveal [player,4]; AI_Shooter commandTarget player; AI_Shooter doTarget player; AI_Shooter lookAt (getPos player); AI_Shooter doWatch (getPos player); sleep 0.05; }; };


In the alpha trigger you put: bamBamBam = [] execVM "let_ai_shoot.sqf"

In the bravo trigger you put: letAiShoot = 0;

 

Sometimes the default AI "shooting frequency" takes over, in that case you can just hide behind a wall or something since the AI won't shoot you if it can't see you BUT my forceWeaponFire command forces it to shoot anyway.


Maybe you can work something out with this.
Cheers Play3r

Share this post


Link to post
Share on other sites
On 3/5/2022 at 6:41 PM, Play3r said:

-find out the reloadTime parameter of the weapon you are modding, this says how much time passes until another bullet is fired when the trigger is held down

Example?

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×