OFPEC Forum

Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: trooper.ryan on 10 Feb 2008, 10:10:44

Title: AI only use secondary weapon (RPG)
Post by: trooper.ryan on 10 Feb 2008, 10:10:44
I've searched the forums to no avail, hopefully someone can point me in the right direction.

I've got a bunch of RPG soldiers that I want to only use the RPG launcher.

Even if I remove their primary weapons and switchweapon to the RPG7V, invariably they revert to holding no weapon.

Any idea how to convince them that they only have the RPG7V?

Cheers in advance.   :good:
Title: Re: AI only use secondary weapon (RPG)
Post by: Loyalguard on 13 Feb 2008, 17:58:27
Sorry it took so long to post a reply here...

...You mentioned you have tried the switchWeapon action, have you tried to selectWeapon Command (http://www.ofpec.com/COMREF/index.php?action=list&game=All&letter=s#284)?  If not, try it and see if that works.

...and just to be safe, make sure they also have ammo for the RPG7V in their inventory.
Title: Re: AI only use secondary weapon (RPG)
Post by: Wolfrug on 13 Feb 2008, 21:40:27
:( I tried this a bit earlier, but I didn't get it to work. I hoped someone else would answer but, yeah...sadly, if you give them only the launcher, they'll run around with empty hands, and only shoulder the launcher when they're about to fire. It seems to me the AI -never- use the "run with launcher on shoulder" animation that's new in ArmA, as far as I could tell at least. Even short movements prompted a complete shouldering-reshouldering action.  :dry:

If it's just for a cutscene or something, you can try using the playmove animation. Here're the animations (from the BIKI):

Quote
AmovPercMrunSlowWlnrDb   -   Run backward with launcher
AmovPercMrunSlowWlnrDbl   -   Run backward left with launcher
AmovPercMrunSlowWlnrDbr   -   Run backward right with launcher
AmovPercMrunSlowWlnrDf   -   Run forward with launcher
AmovPercMrunSlowWlnrDfl   -   Run forward left with launcher
AmovPercMrunSlowWlnrDfr   -   Run forward right with launcher
AmovPercMrunSlowWlnrDl   -   Run left with launcher
AmovPercMrunSlowWlnrDr   -   Run right with launcher

Sorry we couldn't help any more! :(

Wolfrug out.
Title: Re: AI only use secondary weapon (RPG)
Post by: Hellbender on 14 Feb 2008, 03:26:29
I have always thought this was one of the most annoying shortcomings of Arma (and OFP for that matter)!

The fact that you cannot, in some way, order a squad member to have his RPG or AT4 ready for those tanks you know are just on the other side of the hill, is strange i think! 

As for AI, I've messed with this myself to plan AI ambushes in towns, but eventually gave up.  :dunno:

Weird!
Title: Re: AI only use secondary weapon (RPG)
Post by: trooper.ryan on 01 Mar 2009, 06:23:45
I'm wondering if somehow we can set the AT weapon of a unit to be considered a primary weapon?

I have nfi idea about CfgWeapons but maybe you could define the AT weapon with #define WeaponSlotPrimary ?

Anyone know if you can modify CfgWeapons variables such as this on the fly, not in an addon?
Title: Re: AI only use secondary weapon (RPG)
Post by: Worldeater on 01 Mar 2009, 10:53:28
No chance. There is no way to modify CfgWeapons from the running game.
Title: Re: AI only use secondary weapon (RPG)
Post by: Spooner on 01 Mar 2009, 15:14:39
Even if you configged the AT4 to be a primaryWeapon (or created an alternative AT4 that was a primary weapon), you'd then just have it held like a rifle which would look terrible! I hope there would be a better solution...
Title: Re: AI only use secondary weapon (RPG)
Post by: Rommel92 on 01 Mar 2009, 22:47:37
...

My ArmA must be bugged, in any given firefight the RPG/AT soldiers always run with the launcher, and are always bloody using it, I can't get them to use their rifles without removing the AT.

 ???