Have you ever been irritated by stupid far from optimal AI controlling the tank and being destroyed by one RPG shot in the rear? Only because it didn't bother to rotate the hull to that AT soldier? Or because it was firing at a harmless rifleman instead of taking care of enemy APC? Well, this script is for you.
- Vehicles assess the threat/value of the targets and fire at the most dangerous/valueable target it range. It will prefer AT rifleman over autorifleman, tank over MRAP etc. Threat and value calculations use the type of target, distance and ammo types available (for tanks only). For example: AT rifleman 700m away is a more valuable target for the tank than MRAP-HMG at the same distance, but only if the tank has HE rounds. Otherwise it will prefer to fire AP round at MRAP, as the infantry unit is unreachable with current weapons. But AT rifleman still remains more dangerous than MRAP.
- Tanks will use appropriate rounds (if available) for different types of targets: HE for infantry and static weapons, HEAT for lightly armored targets (MRAPs, trucks), AP for heavily armored (tanks, APCs etc).
- Tanks will identify groups of infantry and use HE rounds agains them. A group is 3+ men in 15m radius. By default the tanks will not spend HE rounds on a single infantry unit (unless it's a high-threat AT soldier).
- If the vehicle is a tracked vehicle (tank, tracked APC etc), it rotates the hull to face the most dangerous target.
- If the threat is too high (for example an AT soldier at a close range), the moving vehicle will stop immediately, rotate the hull and fire. When the immediate threat is eliminated, it will proceed with the previous move order. This will presumably save the vehicle in situations when a hit is inevitable and the best decision is to stop and take the hit to the frontal armor rather than continue moving and take the hit to the side/rear.
Extract into the ArmA 3 Directory, by default this is located in:
32-Bit - C:\Program Files\Steam/Steamapps\Common\ArmA 3\
64-Bit - C:\Program Files (x86)\Steam/Steamapps\Common\ArmA 3\
After extraction it should look like this:
You can also use the "Arma 3 Alpha" folder in your "My Documents" folder. Your folder setup could than look like for example this:
When present place the "userconfig" folder into your game install folder, usually:
"C:\Program Files (x86)\Steam\steamapps\common\Arma 3".
You may already have "userconfig" folder from other addons and/or mods in which case it is safe to merge the contents from this archive.
You'll also need to add a Launch Parameter to Steam, in order to do so right-click on ArmA 3 Alpha and click Properties and then Set Launch Options. In the window that opens enter in -mod=@your_mod_folder_name
For using multiple mods you would then do so like this:
You can also use -nosplash to get rid of the splash art and intro videos.
And of course you can also enable and disable community made addons and mods through the in-game Options Expansions menu if you do not want to mess with startup parameters!
When the above information still does not provide you with enough to learn how to install custom addons and mods you can always ask in our Guide On Installing Mods
Some of the use cases below assume that the vehicle is in the player's group and the player can issue direct commands to the vehicle's crew, which is not always the case. If it's not then some of the options won't be available: for example, changing default round type.
Smart behaviour is activated automatically if the vehicle has an AI crew. This includes the vehicles created with the crew inside, or empty vehicles occupied after the mission start etc. Smart behaviour is activated for all factions and all groups: AI groups, vehicles in the player's group and High Command.
If either gunner, driver or commander is a human player, the smart behaviour is suspended and manual control is assumed. If the human player is replaced by AI at any moment, the smart behaviour is re-enabled.
Vehicle commander's behaviour must be either Stealth, Aware or Combat. To disable 'smart' behaviour set the commander to Relaxed. This is just a sort of 'switch' for dynamically enabling or disabling the smart behaviour during the mission, until I implement a separate action menu.
To disable hull rotation but keep picking priority targets issue a Stop order (Action menu 1-6). The vehicle will go into Waiting state.
To resume full 'smart' behaviour, including hull rotation, issue a Move order at the vehicle's current location: the vehicle will not actually move but will go into Ready state.
If you don't want the tank to halt after encountering an immediate threat, set the commander's behaviour to Stealth. It will continue to execute its move order regardless.
For tanks there is such thing as 'default round type'. Tanks start with AP as the default. Tanks will have default round loaded unless they fire at a different type of target. If you manually give the tank commander to 'Reload HE-T`, the HE round will become default. Having HE as default makes the tanks fire HE rounds at single infantry units (not only groups). So if you expect armored targets around, its a good idea to have AP as default, as the tanks will have AP loaded and won't waste time reloading the round. If, however, you want the tanks to use cannon against every soldier they see, make HE default.
Manually ordering the tank to target an infantry unit (action menu 2-x) will make him use HE round against assigned target, even if it's not a group of infantry.
It does not cheat and it uses line of sight calculations and perceived position of the targets. So the tanks will not fire at and rotate to the targets they don't know about.
Only tracked vehicles rotate the hull.
Target assignment works best with MBTs (Slammer, Varsuk) as they switch targets immediately. With APCs and MRAPs there can be a delay before they leave that poor rifleman alone and target an AT soldier.
Real Armor Mod or a similar one is highly recommended.
I haven't found a way so far to override default behaviour in ATTACK (Engaging) mode, so when Engaging the vehicle will not stop, rotate etc.
Currently 'smart' behaviour covers all ground vehicles that have weapons, from all factions, found in game. There is no separate config file to include/exclude particular vehicles/types/factions for now. It will be implemented later though.
The vehicles list is hardcoded for now, which means that addon doesn't cover modded vehicles that have non-standard types and names.
Credits & thanks:
This script could not be made without the help of my wife Natalie. She kindly didn't interfere in exchange for my promise to mention her in the credits.
Do whatever you want with this script. Even claim it your own if you really need to.
- Fixed: commander stuck watching the same direction forever after has been given doTarget order.
- Fixed: 'lazy' target switching. Will now immediately switch to more valueable target.
- Fixed: setup.sqf non starting for vehicles with non-standard names (modded). Should now work for any vehicle that has weapons (list of weapons is still hardcoded though).
- Fixed: small fixes here and there.
- Added: vehicle commander (or gunner, if no commander) will 'scan the horizon' for targets when idle. Commander will use his optics independently of gunner's main turret.
- includes public key.
- Hardcoded unit classes replaced with dynamic threat assessment based on available weapons: both target and our vehicle (a 'sniper' infantry class that has aquired AT launcher will be given threat value as an AT rifleman). Should now work with modded vehicles with non-standard names, as long as they belong to standard base classes (Man, Car, Tank etc) and use standard weapons names.
- Tanks will fire HE rounds at helicopters.
- Added signature.
- Fixed multiplayer bugs (locality shifts). Now works properly in multiplayer and on dedicated server.
- Small bugfixes
- Improvements to targeting algorithm.
- Tanks load appropriate rounds for different target types.
- Tanks identify groups of infantry and use HE against them.
- Distributed in a form of addon now.
- Smart behaviour is now determined by the commander's combat mode, not driver's. This way tank's driver can be set to RELAXED (to stick to roads while moving) without disabling hull rotatation and target aquisition.
- Fixed: doesn't require human player in faction any more for the script to work.
- Added compatibility with High Command.
- Small fixes
- Initial release
- BI forums