Dynamic AI Creator Artillery Support for JCOVE Lite

How to Add Artillery Support to your JCOVE or ArmA Mission

DAC 2.0 provides a way for both AI and players to call in an artillery strike. Figuring out how to add artillery support wasn’t inherantly obvious to me however. Read on to learn from my fumblings.

DAC Artillery Support for the Player

I’ll start with the simplest first. For a player to place a support call the following script is used:
[playerName,position,configurationNumber,artilleryRadius] spawn DAC_fCallArti;

Where position is the location of the artillery strike and configurationNumber corresponds to the configuration in the DAC_Config_Arti.sqf script.

I’m going to continue adding onto my previous JCOVE mission so I open it up in the editor and add 3 static desert L118 105mm Howitzers. These will be available for both player and DAC generated AI. I also add a game logic and name it “DAC_Arti_Logic”.

Next I need to edit the DAC_Config_Arti.sqf located in DAC\Configs. To keep things simple I copy and paste one of the existing configurations and name it case 9.

case 9:
_set0 = [10,2,0,0];
_set1 = [0,0,100,[],2,30];
_set2 = [100,1,100,100,4,1,0];
_set3 = [["vbs2_gb_l118_d",["vbs2_ammo_sh_105_HE"]]];
_set4 = [2,5,1];
_set5 = [10,30,1];
_set6 = [10,30,1];
_set7 = [0.1,0.5,1];
_set8 = [];
_set9 = [];

_set3 is where I specify the classname of the unit I inserted in the editor  “vbs2_gb_l118_d”, and which ammo type “vbs2_ammo_sh_105_HE” I want to use for my artillery strike. Both JCOVE classnames I got from http://www.jcove-lite.co.uk/ (registration required)

The other sets configure a host of options such as maximum number of strikes, whether the artillery is movable etc. Take a look at the DAC readme for more information.

Next I need a method to call the DAC_fCallArti script. The DAC demo uses the onMapSingleClick command called in the mission init.sqf so I copy the following lines of code from it to my mission init.sqf.

Demo_Rad = 30;
waituntil{DAC_Basic_Value == 1};
onMapSingleClick "_pos exec ""CallArti.sqs""";

Demo_Rad sets a global variable with the artillery strike radius, in this case 30 meters. The waituntil code pauses the execution of the script until DAC has been initialized. The onMapSingleClick code passes the map coordinates to a script called CallArti.sqs every time the player clicks on the map. I grab the CallArti.sqs script from the DAC demo mission and paste it into my mission folder. The CallArti.sqs scripts looks like this:

_pos = _this
[player,_pos,9,Demo_Rad] spawn DAC_fCallArti

_pos is the map coordinates passed from onMapSingleClick and 9 corresponds to case 9 that I setup in my DAC_Config_Arti.sqf above.

Now the player can call an artillery strike, next setting up artillery for DAC AI.



Morning Sweep v1_3 example mission used in this post.

DAC for ArmA includes documentation