jwllorens 43 Posted July 25, 2016 I've found it somewhat irritating how difficult it is in ArmA to get a vehicle turret, or an infantry for that matter, to aim a certain weapon at a position and fire. Does anyone have a working function for this? All I want is to make the vehicle turret aim at a position such that it will compensate for the ballistics of the projectile fired by a specific muzzle and for the velocity of the vehicle itself. I want to be able to call this function and have it override any behavior the AI in the turret is currently executing, such as targeting an enemy or seeking cover, ect. Even getting the AI to aim reliably at enemies is challenging, and seems downright impossible if you want them to aim at a noncombatant or three-dimensional world position. If not a function to do this, is there a function that will return ballistic information contained within the config file for a weapon/muzzle/projectile, and a function to aim a turret in an exact direction corresponding to a vector? I could dust off my engineering dynamics books and try my hand as some vector math to do all the work in between, to find the unit vector direction to aim the turret given config file ballistics information and a position, which could be fun. Share this post Link to post Share on other sites
Grumpy Old Man 3546 Posted July 25, 2016 tank dowatch targetpos; tank fire currentweapon tank; In case of the regular slammer replace currentweapon tank with "cannon_120mm". That's it. 1 Share this post Link to post Share on other sites
jwllorens 43 Posted July 25, 2016 tank dowatch targetpos; tank fire currentweapon tank; In case of the regular slammer replace currentweapon tank with "cannon_120mm". That's it. That works for the 120mm cannon, but doesn't seem to work for the LMG. It also doesn't seem to work for other smaller caliber guns such as the 40mm on the Marshall. The gunner doesn't seem to want to fire unless doWatch is called on an enemy. Also, I can't tell if doWatch is adjusting the aim for distance or tank movement, it doesn't seem to be. I'm also having trouble getting the doWatch to work if the turret is already targetting something and is in combat. I've tried setCombatMode, setBehaviour, disableAI. Certain combinations fix this problem, but then they render the "fire" command useless. fireAtTarget is more reliable, but the aim of the turret is always way off since fireAtTarget doesn't actually force the unit to aim and just fires the weapon wherever the muzzle is pointed. Share this post Link to post Share on other sites
theend3r 83 Posted July 25, 2016 Use doWatch and wait until the target is targeted, then use forceWeaponFire. Share this post Link to post Share on other sites