Tankbuster 1746 Posted June 24, 2016 In my coop mission, the AI CUP RU mortar guys never fire at the blufor players. I assumed this is because they don't know how to use the artillery computer. At the moment, spawning an occasional check to see if the opfor mortar guy knowsabout anyone and if so, doing a doartilleryfire on them. I can see that the opfor mortar guy knowsabout the blufor and have even revealed the knowaboutscore to 4 but he never fires. I've even tried something as basic opfor_mortar_dude doArtilleryFire [[position alpha_1], "8Rnd_82mm_Mo_shells", 3] where alpha_1 is me, but he just never fires. Share this post Link to post Share on other sites
kylania 568 Posted June 24, 2016 opfor_mortar_dude doArtilleryFire [position alpha_1, "8Rnd_82mm_Mo_shells", 3]; The first parameter is an Array, such as a position. In the demo it was [3000, 120, 1000]. The command position returns an array so you just had an extra [ ] in there. You should have seen a black background script error talking about 3 arguments expected, received 1? Share this post Link to post Share on other sites
Tankbuster 1746 Posted June 24, 2016 Oh, yes. My original post had a transcription error. The actual code I used was opfor_mortar_dude doArtilleryFire [(position alpha_1), "8Rnd_82mm_Mo_shells", 3] I typed the wrong brackets when I was writing it into the forum. :) Apologies for misleading! Share this post Link to post Share on other sites
Grumpy Old Man 3545 Posted June 24, 2016 AI firing artillery just fine, as long as they have line of sight from the artillery piece to the target (weird, but for whatever reason it works that way). Using the doArtilleryFire command for indirect fire solutions requires the artillery piece to fulfill a few conditions. I'm not exactly sure how the engine is handling this, but having inRangeOfArtillery return true and getArtilleryETA return a number above 0 should make doArtilleryFire work. Cheers Share this post Link to post Share on other sites
Tankbuster 1746 Posted June 24, 2016 Are you saying that just putting down a static and a gunner in it is enough? Share this post Link to post Share on other sites
Grumpy Old Man 3545 Posted June 24, 2016 Yes, as long as there's a direct line of sight between the static and the target and the gunner knows enough about the target to consider it a threat (knowsabout >= 0.7 I guess). At least that's how it was back when I tried it, been a while. You could toss in a reveal when the target is within a certain range to make things happen though. Cheers Share this post Link to post Share on other sites
Tankbuster 1746 Posted June 24, 2016 Yes, as long as there's a direct line of sight between the static and the target and the gunner knows enough about the target to consider it a threat (knowsabout >= 0.7 I guess). At least that's how it was back when I tried it, been a while. You could toss in a reveal when the target is within a certain range to make things happen though. Cheers Actually that's something I can plug into the mission right away and observe. Thank you! Share this post Link to post Share on other sites
kylania 568 Posted June 24, 2016 There's also the virtual artillery modules you can setup using the Combat Support system. Those will spawn in arty pieces when needed to fire. Share this post Link to post Share on other sites
Tankbuster 1746 Posted June 25, 2016 I'm not having any joy with this. First I set the spottime and spottime of these guys to 1, hoping they'd be more aggressive, but they don't fire. So I tried to help them along a bit. { [_x, [0.17,0.17,0.60,0.40,1,1,0.40,0.50,1,0.50], false,0] call tky_fnc_tc_setskill; // ^^^ mortar gunners have best spotdistance and spottime [_x] spawn // mortar gunner helper { private ["_nearblufors", "_mygunner"]; _mygunner = _this select 0; while {alive _mygunner} do { sleep 20; _nearblufors = (position _mygunner) nearEntities ["CUP_Creatures_Military_BAF_Soldier_Base", 500]; if ((count _nearblufors) > 0) then { diag_log format ["*** mortar guys told to fire!"]; _mygunner doArtilleryFire [(position (selectRandom _nearblufors)), "8Rnd_82mm_Mo_shells", 3 ]; }; }; }; } foreach mortar_gunners; I get the debug in the server rpt, but no firing mortars (i watched them using another player and NSS freecam) Share this post Link to post Share on other sites
Grumpy Old Man 3545 Posted June 25, 2016 Try putting the ETA and inRange checks I mentioned earlier in front of the doArtilleryFire command and see if they return valid values. Tried the line of sight firing, with one manned mk6 and an opfor squad on the other side of a runway, the gunner refused to fire. Worked in an earlier version of arma, gonna goof around with it some more. Cheers Share this post Link to post Share on other sites
Rydygier 1309 Posted June 25, 2016 Well, in this test mission, I made some time ago to test basics of this command, all seem to work fine for me (gunner will fire a single round by your command via Juliet radio channel (0-0-0), at your position (damage is disabled); hint shows constantly expected ETA, distance, if you're in range and if mortar has ammo; sidechats show ETA after shot is fired and will mark expected "boom" moment) - maybe this will be helpful anyhow to find the difference, that explains, why it works for me. In the past versions there was some problems with this command/arty firing in general IIRC, for example this thing. In some of my projects I'm using own FFE script for handling autonomous AI arty fire and noted some A3 versions ago, sometimes indeed properly executed script isn't followed by actual arty fire despite all conditions met. Script is complex though, so reason could be hidden somewhere within it, but failed to find any, so perhaps indeed the command not always works as should, and I have feeling, it may have something to do with not always reliable (in)range calculations of arty computer as in the linked gameplay recording. Didn't tested, if it still occurs on 1.60 though. EDIT: perhaps the first thing to check would be replacing CUP mortar with vanilla and check, if that makes any difference. 1 Share this post Link to post Share on other sites
Tankbuster 1746 Posted June 25, 2016 { [_x, [0.17,0.17,0.60,0.40,1,1,0.40,0.50,1,0.50], false,0] call tky_fnc_tc_setskill; // ^^^ mortar gunners have best spotdistance and spottime [_x] spawn // mortar gunner helper { private ["_nearblufors", "_mygunner", "_artytarget", "_iroa", "_aeta", "_amags"]; _mygunner = _this select 0; while {alive _mygunner} do { sleep 10; _nearblufors = (position _mygunner) nearEntities ["CUP_Creatures_Military_BAF_Soldier_Base", 700]; if ((count _nearblufors) > 0) then { _artytarget = (selectRandom _nearblufors); _iroa = (position _artytarget) inRangeOfArtillery [[_mygunner], "8Rnd_82mm_Mo_shells"]; _aeta = (vehicle _mygunner) getArtilleryETA [position _artytarget, "8Rnd_82mm_Mo_shells"]; _amags = getArtilleryAmmo [(vehicle _mygunner)]; diag_log format ["*** mortar guys told to fire!, is inrange %1 and ETA %2 has %3", _iroa, _aeta, _amags ]; _mygunner doArtilleryFire [(position _artytarget), "8Rnd_82mm_Mo_shells", 3 ]; }; }; }; } foreach mortar_gunners; Gives 2016/06/25, 17:15:24 "*** mortar guys told to fire!, is inrange true and ETA 28.3857 has ["8Rnd_82mm_Mo_shells","8Rnd_82mm_Mo_Flare_white","8Rnd_82mm_Mo_Smoke_white"]" 2016/06/25, 17:15:24 "*** mortar guys told to fire!, is inrange true and ETA 28.3829 has ["8Rnd_82mm_Mo_shells","8Rnd_82mm_Mo_Flare_white","8Rnd_82mm_Mo_Smoke_white"]" 2016/06/25, 17:15:34 "*** mortar guys told to fire!, is inrange true and ETA 28.3857 has ["8Rnd_82mm_Mo_shells","8Rnd_82mm_Mo_Flare_white","8Rnd_82mm_Mo_Smoke_white"]" 2016/06/25, 17:15:34 "*** mortar guys told to fire!, is inrange true and ETA 28.3829 has ["8Rnd_82mm_Mo_shells","8Rnd_82mm_Mo_Flare_white","8Rnd_82mm_Mo_Smoke_white"]" And the mortar guys are seen to turn to face the target the moment the debug appears, but they don't fire. :( Share this post Link to post Share on other sites
Tankbuster 1746 Posted June 25, 2016 EDIT: perhaps the first thing to check would be replacing CUP mortar with vanilla and check, if that makes any difference. Yep. There you go! Spawning the "CUP_O_2b14_82mm_RU" Podnos and using createVehicleCrew is the problem here. Switching to "O_Mortar_01_F" and all of a sudden.... 82mm rain! Share this post Link to post Share on other sites