Jump to content
sasha013

Force AI to use RPG

Recommended Posts

Hi, is there any way to force AI to shoot RPGs on enemy infantry? 

 

I tried removing all the other weapons on the unit, with no avail. 

 

Thanks. 

 

Share this post


Link to post
Share on other sites

I've read through the wiki links, however I'm still not being successful.

 

So far the Init box for the RPG soldier (variable name "soldier1") is as follows: 

 

soldier1 selectWeapon "launch_RPG7_F"; soldier1 = this fireAtTarget [target1,"launch_RPG7_F"];

 

target1 is the infantry unit which is the designated target, as you'd immagine. 

 

I've also tried:

 

soldier1 selectWeapon "launch_RPG7_F"; soldier1 forceWeaponFire ["launch_RPG7_F","launch_RPG7_F"]; - to fire twice. 

 

 

Any help? Something I'm doing wrong/missing?

Share this post


Link to post
Share on other sites

I'm also interested in this. Some time ago, I tried to make the AI shoot flares when they spotted me during the night but I wasn't successful. They aimed at the invisible helipad above them just fine but they wouldn't shoot even with forceWeaponFire. :(

Share this post


Link to post
Share on other sites

Make sure the Ai have rpg anti personnel rounds. They won't shoot anti armour rounds at soldiers.

Share this post


Link to post
Share on other sites

Make sure the Ai have rpg anti personnel rounds. They won't shoot anti armour rounds at soldiers.

 

I tried this as well, again no success: changed to the RPG42 Rocket with a few RPG42_F rounds (not the HE ones), yet that didn't work either. It seems the RPG7_F is only an Anti-Tank Grenade, according the wiki assets: https://community.bistudio.com/wiki/Arma_3_CfgMagazines

Share this post


Link to post
Share on other sites

I was looking for something and i find your discussion, i use this line on a trigger that work perfectly with a RHS rpg7 :

rpg1 forceWeaponFire ["rhs_weap_rpg7", "rhs_rpg7_PG7VL_mag"]; rpg1 doFire car;

 

rpg1 is the name of the soldier with a rpg7, car is the name of the target, when your trigger is activated the guy will use the rpg7 on the car.

 

+ i add an other guy with a rpk named pk1 and the rpk suppress the same target

rpg1 forceWeaponFire ["rhs_weap_rpg7", "rhs_rpg7_PG7VL_mag"]; rpg1 doFire car; pk1 doSuppressiveFire car;

  • Like 1

Share this post


Link to post
Share on other sites

Just create a unit with a launcher only and 'doSuppressiveFire' whatever target unit you want.(he will shoot at the feet, so what I do is create a dummy unit, hide and disable simulation, a few feet above ground and rocket will shoot straight). Should fire at least couple rockets. Give him one if you want him to shoot one. 

Share this post


Link to post
Share on other sites

wow, incredible, this works! no script, no mod needed, thx a lot!

just put "hideObject tank" in the 'on act' of a trigger, set condition 'true', and name the target vehicle 'tank'. I didn't even need the 'doSuppressiveFire'. :)

Share this post


Link to post
Share on other sites
On 2/18/2019 at 2:47 PM, bcon117 said:

Just create a unit with a launcher only and 'doSuppressiveFire' whatever target unit you want.(he will shoot at the feet, so what I do is create a dummy unit, hide and disable simulation, a few feet above ground and rocket will shoot straight). Should fire at least couple rockets. Give him one if you want him to shoot one. 

 

doSuppressiveFire works with a position. There is no need to add fake units. You can add a vector with vectorAdd.

So:

0 = this spawn {sleep 3; _this selectWeapon secondaryWeapon _this;  _this doSuppressiveFire (getposASL someObject vectorAdd [0,0,1.5]}

will work for a RPG7 (ballistic rocket), but not a Titan missile (lack of target acquisition).

NOTE: selectWeapon is tricky and you can spill a lot of time trying to make it work with a visual result. I mean this command can be so instantaneous with a back selection on previous weapon, that it seems broken and useless. First step is usually to remove the primary and hangun weapons.

To illustrate, try both selection on RPG7 then Titan AT.

 

 

1 hour ago, R0bster said:

wow, incredible, this works! no script, no mod needed, thx a lot!
just put "hideObject tank" in the 'on act' of a trigger, set condition 'true', and name the target vehicle 'tank'. I didn't even need the 'doSuppressiveFire'. 🙂

 

hideObject on tank will work but it's weird but that works.

On the other hand, thermal rockets will work if your tank is engine on, which is the case at start. When you hide a tank, you can hear its engine. Furthermore, a hidden tank will return fire on enemy vehicles. You didn't disable the simulation. If you do it, you have to cope with engine off and no hot spots on tank....

Well, hiding of tank implies other consequences like counting for forces in presence.

  • Like 1

Share this post


Link to post
Share on other sites

thanks for the detailed answer. Good point, that's right.

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

×