version 1.1a

CHANGELOG:

- Fixed an error in the process of selecting the most advantageous target.

version 1.1

CHANGELOG

- Added an optional possibility to activate and deactivate script by defining and un-defining a global variable ;

- Added an optional possibility to selectively disable script control for up to 12 pieces of artillery;

- Projectiles dispersion and salvos drift again adjusted;

- Improved tracking of moving targets;

- fixed bug: AI did not take amendment for prevent "friendly fire" in "FO mode";

- fixed other minor bugs.

DETAILS OF CHANGES:

To set addon to run at certain point of the mission:

1. RydART_Manual define a variable at the beginning of the mission (for example in the init of any unit)
2. At a certain point of the mission to define with any value (via another script, a trigger, waypoint etc.) variable RydART_Start.

To turn addon off at certain point of the mission:

1. define variables and RydART_Start RydART_Manual at the beginning of the mission (for example in the init of any unit)

2. at certain point of the mission to define with any value (via a script, a trigger or whatever else) variable RydART_Start as "nil" (RydART_Start = nil). Addon scripts will turn off at the end of their ongoing cycle.

To remove given artillery piece from the control of addon should give it one of the following names (field "name" in unit window in editor or via command "setVehicleVarName"): NoFAWa, NoFAWb, NoFAWc, and so on till NoFAWl (available 12 names). 

Default value of RydART_Disp (shell dispersion multiplier) variable is now 0.4.

version 1.1 Beta

CHANGELOG: 

- Improved method of selecting and assigning targets;

- Improved tracking of moving targets;

- Projectiles dispersion and salvos drift was adjusted;

- Added additional optional variables that enable introduction of separate FO units and test shots before main salvo, also regulation of accuracy growth as a result of amendments provided by the spotters

(paskage contains also 1.0 version in "old" folder)

DETAILS OF CHANGES AND NEW OPTIONAL "CUSTOMIZE" VARIABLES:

Currently, there is a greater chance that unit, that is considered to be the most valuable become a target. Currently, it is also important, whether it is an enemy artillery unit (highest priority), how fast it moves (the slower the better) and whether in in close proximity (in salvo impact range), there are other groups or buildings or enemy weaponry (this idea was taken from thread "ECHO fire director"- thanks to valuable information about this from Evil_Echo). Artillery should now be more deadly.

It is now possible set if batteries have to communicate on assignment objectives:

If RydART_Monogamy variable is defined with any value (is not "nil"), one enemy group will become a target for only one battery at a time.

Changed the method of calculation amendment to the target motion vector so that it is less sensitive to rapid changes of direction and more consistent with the real displacement. It now takes 20 seconds to calculate this. 

Using a simple simulation of Gaussian distribution and changes in formulas adjusted projectiles dispersion  and salvo drift so now, hopefully, these values should be more... "toned down". Also WNDF (see below) for MRLS is now 2.5 and for GRAD 3.5.

Also introduced possibility of replacing default system in which anyone can provide to allied batteries information about potential targets. If RydART_FO variable is not "nil (has defined value) then only certain units will be "questioned" whether they see potential targets. FO this type must meet following conditions:

- Can not be assigned to any groups (the only member of their group) and must belong to one of the following types units: U.S. spotter (USMC_SoldierS_Spotter), RU spotter (RU_Soldier_Spotter), CDFspotter (CDF_Soldier_Spotter), INS officer (Ins_Soldier_CO),GUER scout (GUE_Soldier_Scout) OR must to have one of the following names: FOa, FOb, FOc, FOd, FOe, FOf (the name is defined in "name" field of unit window in the editor or via script command "setVehicleVarName"). Thus, on the battlefield, in this FO mode, in addition to units enumerated classes, with spotting targets will be able to deal up to six units of any kind and any non-civilian ("civ" and "civ_RU" excluded) faction. Additionally, with launch of a RydART_FO variable is changing method of bombardment. Salvos will be now divided into a test shot or shots (1 / 6 of salvo, rounded up) and main salvo, much more accurate thanks to the amendments after test shots. There is also possibility to set two-phased method of bombardment in normal mode, with no special FO units. To achieve this you should launch (define) variable RydART_2PhWithoutFO. By default multiplier of salvo drift in second phase of artillery fire of this kind is equal 0.2 + (random 0.2), but its non-random part can be changed by giving desired numerical value to the variable RydART_FOAccGain (eg. RydART_FOAccGain = 0.4 will set gain to value 0.4 + (random 0.2). Larger multiplier means a possibility of larger main salvo drift and thus a smaller accuracy gain from spotter's info.). RydART_OnePhase sets one-phased bombardment in FO mode if not "nil". 

Is still sometimes returns described on the forum this strange script behavior and moreover I had only day for test, so, for peace of mind, I described this version as "Beta".

version 1.0

- first release



-----


INTRODUCTION:

Purpose of the "Fire At Will" addon is to give in simplest way possible fully functional AI artillery to battlefield for those, who can't or simply refuse to learn script language but still want functional AI artillery in his Arma 2 missions. It was created because in my opinion it is illogical to force a player to learn sript language and to study BIS_ARTY Module commands and variables even if he wants just to set up some AI artillery in his missions, while such knowledge is not required for any other types of AI combat units, which are fully functional without any scripting.

Addon supports all generic Arma 2 artillery units (howitzers: M119, D30; mortars: M252, 2B14; rocket systems: GRAD and MRLS). Tested on singleplayer missions for Arma 2 1.10.

-----


USAGE:

To use the FAW primary, Addon version in yours missions: 1. set up some artillery batteries in editor; 2. play with addon. Technically you also probably can play this way any other mission, but it's not recommended due to unpredictable changes on the battlefield, that are likely to ruin mission designers concept. 

IMPORTANT NOTES: first: group of artillery must consist of the same kind of artillery units. Second: bombardment trajecory is calculated from position of leader such artillery group, so do not place leader far from rest of group.

To init FAW script version (in folder "source") place following in init field of any unit or activation field of trigger: nul=[] execVM "PrepArt.sqf";

-----


HOW IT WORKS:

Artillery of given side will shoot at enemy group (chosen with some kind of simply "temptation" system - targets become primarily probably more valuable enemy groups) with an amendment for its leader motion vector (determined three times, every five seconds, then averaged, so its take 10 additional seconds) if:

- it is in range;
- it is spotted by any soldier of same or allied faction (except for Arma 2 civilians ("CIV" and "CIV_RU" factions) still spotters and other units with binoculars or sniper rifles are valuable FOs because they see and identify the enemy as potential target at a much greater distance);
- it is not captive or defenseless (leader has no weapon, to not firing at harmless civilians even when they are hostile);
- it moves with speed lesser than 30 km/h because of keeping chance for hit on reasonable level;
- it is not more than 20 meters above ground (air units may become targets if are landed, or hover very low);
- there is not friendly units in "danger zone" radius (default (200 * (weapon nominal dispersion factor))meters from calculated impact position);weapon nominal dispersion factor (WNDF) = 1 for mortars, 1.8 for howitzers, 3.5 for MRLS and 4 for GRAD. 

If there is allied leader in "danger zone" battery try to correct impact coordinates in attempt to avoid friendly fire by moving impact point in direction of actual target position at the cost of the amendment to the motion vector, if still there is FF-danger, battery try to fire actual target position. If still there is FF-dager battery will call off fire mission an wait for next chance. This system is not bad, because while enemy is so close to friendlies is big chance, that he will stop (his moving vector will change dramatically) to open fire and his position may be in this situation best for effective bombardment. However "friendly fire" is still possible due to salvo drift (targeting error) and single rounds impact disperion or units movement);

Drift calculation is based on factors: distance from the target point, health status of battery leader, weather (worse weather means less predictable atmospheric conditions) and battery leader's aiming skill;Maximal drift is halfed when battery shoots to the same target as before;

Dispersion calculation is based on factors: distance from the target point, damage status of battery leader's vehicle (his artillery piece) or health status of battery leader if not mounted in any gun, weather and battery leader's overall skill (matters ordinates practice in proper setting and use of gun), kind of artillery;


Script needs some time to gather all necessary data from battlefield. Usually passes at least about a minute before they are fired first salvos on condition that enemy was spotted of course. I recommend optional debug markers mode for adjusting and testing purposes.

-----


OPTIONAL:

In fact there are also, pure optional, global variables allowing, within certain limits, to adjust functioning of artillery as needed by defining them in any units init field, triggers or waypoints activation field or in script:

(all the following affects every AI battery on battlefield, regardless of its kind or side (means every AI controlled artillery unit; however if unit is set "playable" you can to "incarnate" his crew later,when script done with setting up batteries control (10-20 secons from start) and it will stay under script control, but it's not recommended too). Not possible in simply way to adjust batteries separately, its a main limitation of this addon)


RydART_Manual -   when defined with whatever value (means: if this variable is not "nil") automatic mode is off (script will not start autmatically with mission). Automatic mode is on by default; 

RydART_Start -    when defined and when manual mode is on it will start script;

RydART_AddAmmo -  number of magazines for all artillery units, will replace original ammuniton. When "nil", number is 9;

RydART_Ammo -     kind of ammo for all batteries when RydART_AddAmmo is used (possibly values are "HE", "WP, "SMOKE", "ILLUM","SADARM" or "LASER" (with quotes))) when "nil" kind of ammo become "HE". Do not choose kind, which is not supported by artillery piece (eg. "WP" when deployed MRLS, see below specifications);

RydART_Interval - Pause in seconds between salvos (how often script checks if battery is ready for new fire mission - battlefield bombardment density). If "nil", pause is, by default, 120 seconds;

RydART_SpawnM -   if "nil" artillery is firing in non-spawn mode (projectiles physically fly all its trajectory), if not "nil" spawn mode is activated (shells are spawned near impact point);

RydART_FMType -   type of fire missions. "IMMEDIATE" (default, when is "nil") or "TIMED";

RydART_Amount -   (intensity of fire) if type is "IMMEDIATE" this defining number of rounds fired per fire mission for each battery, if type is "TIMED" it defining duration of salvos in seconds. If "nil" - become 6; 

RydART_Rate -     definig a time gap between shots in salvo, default is 0 (batteries will fire their salvo as fast as they are able to); 

RydART_Disp -     multiplier of probable (not exact) maximal impact dispersion radius between single shots in salvo. Default is 0.25 (possible from 0 to inf.; lesser values = lesser dispersion);

RydART_Acc -      multiplier of maximal salvo drift radius (aiming error factor for whole salvo). Default is 2 (possible from 0 to inf.; lesser values = lesser drift);

RydART_Safe -     Minimal allowable distance (in meters) between position of any commander of allied groups and planned impact point. Default 200. NOTE: this value is always mutiplied by WNDF (see above) so for example for GRAD deafault final value will be equal 800 meters;

RydART_Mark -     if not "nil" debug map markers and "shells tracking tool" (ready after some (about 20) sec. from start; in non-spawn mode tool shows rounds on fly in 1500 meters radius from point clicked on map, in spawn mode shows projectiles only when they are about to splash. To off: left mouse button single click + "Alt" on map) are activated. Is "nil" by default;  

1.1 add:

RydART_Monogamy - if not "nil" "one target - one battery" mode is active; 

RydART_FO - if not "nil" FO mode is active;

RydART_2PhWithoutFO - if defined with whatever value (not "nil") Two-phased (test phase/main phase)) salvos are active without FO mode;

RydART_OnePhase - if not "nil" sets simply, one-phased salvos in FO mode; 

RydART_FOAccGain - sets non-random part of multiplier of main salvo drift (in phase two of salvo in two-step bombardment mode). Less value means more accurate impact. Default: 0.2 + (random 2). 



-----


DEBUG MARKERS:

In debug mode on map will appear and disappear some markers:

- Black square icon on every battery actual position with its name, like "RYD_BIS_ARTY_Logic_0 - "m252"";
- Black dot on planned impact position for every battery on firing mission;
- Blue circle around planned impact possition that indicates drift radius;
- Red dot on a blue circle that indicates central point of salvo impact with text specifying: drift radius in meters, dispersion radius in meters and type of artillery unit; for example: "70m/20m - "M119"";
- Red, half-transparent circle around red dot that indicates probable (approximate) radius of the dispersion salvo projectiles;
- there are also some auxilliary lines between dots;

There is also "tracking tool" that allow to see rounds on fly in 1500 meters radius (see note for RydART_Mark variable). Projectiles are marked by orange dots, and radius of tracking by "khaki" circle. This tool not always works properly (because of some refreshing issues), so should be considered as experimental.


-----


SPECIFICATIONS:

Some useful info such as minimal and maximal firing range and supported kinds of rounds for artillery:


Howitzers        : Range: 2375m - 5800m   ; Ammo: HE, WP, ILLUM, SADARM, LASER, SMOKE
Mortars          : Range: 100m  - 3700m   ; Ammo: HE, WP, ILLUM
Rocket artillery :

	    MRLS : Range: 4900m - 15550m  ; Ammo: HE
	    GRAD : Range: 3300m - 10100m  ; Ammo: HE



Enjoy being under fire & have a nice boom. 

Rydygier