This refers to what I think is the problem:
http://www.ofpec.com/yabbse/index.php?board=6;action=display;threadid=13357I stupidly didn't check whether I'd said it in that thread but an AI machine gunner firing on an indestructible soft target will complete his 20s of fire time before he switches onto a second indestructible soft target that he's been ordered to engage.
Saw the thread on this on the BIS forum yesterday so have thought about it a bit. My guess is the target you're using is a fairly high armour value (to promote bucketloads of fire). If there's a more easily killable one, that would solve the problem - first round that's on target - boom - no more target - grenadier ceases fire - job's a good 'un.
For small arms fire, I was thinking of an array of killable targets that the firers would work through without too much script control.
As you've demonstrated, the usual approach to this idea is to tell the firers where to fire and then try to control that. Turning it on it's head, if you used 'high threat' enemy-sided killable targets the firers will sort themselves out. It would be up to you to tell the manoeuvre element of the group to 'hold fire' so they will move without distraction.
Final thought - onMapSingleClick has the only instance of 'selected group members' function, right? To make the script more universal, could you not extract that and pass it to the script so you decide who you want to put down the covering fire as well as where; and who is holding fire ready to move?Plan B required! From the script, SetBehaviour and SetCombatMode will be applied to the whole group, not just individual units. Only you can do that through the F-keys. You also need to use Alt-Click on the map to prevent the selected units from moving to the point you specify (it's a 'Watch' command by default). Looks like it's back to civvy targets and unit-specific DoFires (which could work from the selected units array).
In the British context, Section Battle Drill No.4 is 'winning the firefight' - usually the whole section fire to regain the advantage and give the section commander time to plot his next move. It is therefore not unrealistic for the whole section to DoStop and give covering fire by default, then you leisurely select who you want to hold fire and manoeuvre.
I suppose I still can't quite see how it's intended to function in-game (unless it is purely for effect) because semi-skilled AI are going to deal with any real threats anyway, if you let them. If it's a more deliberate attack: ordering 'hold fire', revealing targets, selected units 'open fire', other units 'follow me' is not dramatically more involved than remembering how to initiate scripted covering fire.