Jump to content
Sign in to follow this  
jakkob4682

Getting the AI to fire without passing multiple arrays for the fire mission?

Recommended Posts

Without using the artillery module, is there a way to make the ai fire artillery using commandWatch/commandTarget/commandFire combinations? I've tried but can't seem to get it to work. Also can't get the artillery to work using a spawned module with something like

_art1 = createSide sideLogic;
_arty = _art1 createUnit [type, position, markers, placement, specia] ;
_art1 synchronizeObjectsAdd [_arty];
_FM = ["Immediate","HE",1,_roundCount];
[_art1,getPosATL _tgtPos,_FM] call BIS_ARTY_F_executeFireMission;

Share this post


Link to post
Share on other sites

That fire mission is all kinds of wrong, take a look at the wiki.

If you dont want to pre-place static battery's then use the virtual's:

http://community.bistudio.com/wiki/Artillery_Module#Virtual_Artillery

http://community.bistudio.com/wiki/Artillery_Module#Creating_fire_missions

Here is a arty template from one of my systems. It includes some stuff to talk back to the caller.

// Bluecom Interface , By Riouken


if (!isServer) exitWith {};


_pos = _this select 0;
_batt = _this select 1;
_ordtyp = _this select 2;
_rtoffire = _this select 3;
_roundcount = _this select 4;


_firemission = ["IMMEDIATE", _ordtyp, _rtoffire, _roundcount];


_artyveh = "Can_small" createVehicle [_pos select 0, _pos select 1,0];
_artytargetpos = getPosASL _artyveh;


_artyavalibile = [_batt, _firemission] call BIS_ARTY_F_Available;
_artyviable = [_batt, _firemission] call BIS_ARTY_F_StillViable;
_artyposinrange = [_batt, _artytargetpos, _ordtyp] call BIS_ARTY_F_PosInRange;




if ((_artyavalibile) and (_artyviable)) then {
   if (_artyposinrange) then {
       [_batt,_artytargetpos,_firemission] call BIS_ARTY_F_ExecuteTemplateMission;
   } else {

       [nil,bluecom,"loc",rHINT,"Bluecom, can not fire on that location"] call RE;
       [nil,bluecom2,"loc",rHINT,"Bluecom, can not fire on that location"] call RE;
   };

} else { 

   [nil,bluecom,"loc",rHINT,"Bluecom, Battery is not available"] call RE;
   [nil,bluecom2,"loc",rHINT,"Bluecom, Battery is not available"] call RE;


};


if (artybattery getVariable "ARTY_BADTARGET") then {

   [nil,bluecom,"loc",rHINT,"Can not target that!"] call RE;
   [nil,bluecom2,"loc",rHINT,"Can not target that!"] call RE;


};




waitUntil {_batt getVariable "ARTY_ONMISSION"};
[nil,bluecom,"loc",rHINT,"Bluecom, Artillery is prepairing to fire"] call RE;
[nil,bluecom2,"loc",rHINT,"Bluecom, Artillery is prepairing to fire"] call RE;


deleteVehicle _artyveh;


waitUntil {_batt getVariable "ARTY_SHOTCALLED"};
[nil,bluecom,"loc",rHINT,"Bluecom,  Artillery is firing!"] call RE;
[nil,bluecom2,"loc",rHINT,"Bluecom,  Artillery is firing!"] call RE;


waitUntil {_batt getVariable "ARTY_SPLASH"};
[nil,bluecom,"loc",rHINT,"Bluecom,  Artillery is splashing down!"] call RE;
[nil,bluecom2,"loc",rHINT,"Bluecom,  Artillery is splashing down!"] call RE;


waitUntil {_batt getVariable "ARTY_COMPLETE"};
[nil,bluecom,"loc",rHINT,"Bluecom, Artillery mission is complete!"] call RE;
[nil,bluecom2,"loc",rHINT,"Bluecom, Artillery mission is complete!"] call RE;

Share this post


Link to post
Share on other sites

I want to make a script that spawns the actual "BIS_ARTY_LOGIC" then if unit is typeOf "M119" synchronize it. So basically an auto synchronization script. On the other topic of what the post was originally about, does commandFire work to get them to only shoot one round if I want, for instance a spotting round? I know theres a ton of AI Artillery scripts out there but I want to know more for my own understanding rather than just using someone else's script. The only addon I know of that does this, is ECHO but theres no user input for that addon.

Share this post


Link to post
Share on other sites

Yeah bro, I just asked same question as you, not get solution yet.

That wiki page only told us how to use artillery module in AA2, but not in OA. In OA, there is already an action of "FireAtTarget" in menu as we can see when we sit in mortar, so I guess in OA the artillery might work in another way...

So, I think the most important thing is how to use the new artillery computer in OA, with script of course.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×