Dangerzone Posted April 27, 2022 Posted April 27, 2022 (edited) Hi, I've been using Ciribob's CTLD script to haul a JTAC unit to an AO, and then deploy, where it will identify a target, laze and throw smoke. This has been great, however as missions progress I'm finding that it's quite restrictive as the script I have will only identify one target at a time, and more often than not will only engage the lesser of the threats while leaving the larger ones til last. I have an idea, but before I spend a bunch of time modifying CTLD to suit - I just wanted to check in to see whether or not there are alternative solutions available already first. My idea was to setup a F10 menu where you can identify the JTAC and get a list of all targets near him. (I'd do this by just getting a list of all enemy units in a radius of the JTAC). I can then allow the user to choose which unit they want to engage, and throw smoke on it. What I don't know how to do (or don't know if it's even possible), is to direct the JTAC to lase that selected target. (The smoke is a workaround unless someone can advise if selective lasing is possible)? Or - does anyone else know if there is a JTAC script I'm missing that will allow players to get a list of identified targets near a JTAC already? Cheers DZ Edited April 27, 2022 by Dangerzone
=475FG= Dawger Posted April 27, 2022 Posted April 27, 2022 (edited) When you build the mission you prefix the unit name with hpriority and a number and priority and a number and it will sort targeting priority accordingly. Emphasis on UNIT NAME here. This is a feature of CTLD. I use hpriority1,hpriority2,hpriority3,hpriority4 in my missions like this: hpriority1 - Long or Medium Range SAM radars hpriority2 - Short range SAMs hpriority3 - Radar guided guns hpriority4 - Other AAA Example SA-6 unit name would be hpriority1_SA6_SR1 Relevant CTLD code is below -- generate list order by distance & visible -- first check -- hpriority -- priority -- vehicle -- unit local _sort = function( a,b ) return a.dist < b.dist end table.sort(_unitList,_sort) -- sort list -- check for hpriority for _, _enemyUnit in ipairs(_unitList) do local _enemyName = _enemyUnit.unit:getName() if string.match(_enemyName, "hpriority") then return _enemyUnit.unit end end for _, _enemyUnit in ipairs(_unitList) do local _enemyName = _enemyUnit.unit:getName() if string.match(_enemyName, "priority") then return _enemyUnit.unit end end for _, _enemyUnit in ipairs(_unitList) do local _enemyName = _enemyUnit.unit:getName() if (_targetType == "vehicle" and ctld.isVehicle(_enemyUnit.unit)) or _targetType == "all" then return _enemyUnit.unit elseif (_targetType == "troop" and ctld.isInfantry(_enemyUnit.unit)) or _targetType == "all" then return _enemyUnit.unit end end return nil end Edited April 27, 2022 by =475FG= Dawger 1
Dangerzone Posted April 27, 2022 Author Posted April 27, 2022 (edited) 2 hours ago, =475FG= Dawger said: When you build the mission you prefix the unit name with hpriority and a number and priority and a number and it will sort targeting priority accordingly. Emphasis on UNIT NAME here. This is a feature of CTLD. I use hpriority1,hpriority2,hpriority3,hpriority4 in my missions like this: hpriority1 - Long or Medium Range SAM radars hpriority2 - Short range SAMs hpriority3 - Radar guided guns hpriority4 - Other AAA Example SA-6 unit name would be hpriority1_SA6_SR1 Relevant CTLD code is below -- generate list order by distance & visible -- first check -- hpriority -- priority -- vehicle -- unit local _sort = function( a,b ) return a.dist < b.dist end table.sort(_unitList,_sort) -- sort list -- check for hpriority for _, _enemyUnit in ipairs(_unitList) do local _enemyName = _enemyUnit.unit:getName() if string.match(_enemyName, "hpriority") then return _enemyUnit.unit end end for _, _enemyUnit in ipairs(_unitList) do local _enemyName = _enemyUnit.unit:getName() if string.match(_enemyName, "priority") then return _enemyUnit.unit end end for _, _enemyUnit in ipairs(_unitList) do local _enemyName = _enemyUnit.unit:getName() if (_targetType == "vehicle" and ctld.isVehicle(_enemyUnit.unit)) or _targetType == "all" then return _enemyUnit.unit elseif (_targetType == "troop" and ctld.isInfantry(_enemyUnit.unit)) or _targetType == "all" then return _enemyUnit.unit end end return nil end Wonderful! Thanks! That may help with the priority. I'm guessing no way still to get a full list and specify which unit you want from that list at this time? Edited April 27, 2022 by Dangerzone
=475FG= Dawger Posted April 28, 2022 Posted April 28, 2022 4 hours ago, Dangerzone said: Wonderful! Thanks! That may help with the priority. I'm guessing no way still to get a full list and specify which unit you want from that list at this time? Doing that would require some extra code in CTLD. It is already producing the target list so all you need to do is code the display and method of selecting and assigning it to the JTAC
Dangerzone Posted April 28, 2022 Author Posted April 28, 2022 Oh sweet. i see now... the lasing is done by CTLD, not natively by DCS with ctld.laseUnit(_enemyUnit, _jtacUnit, _jtacGroupName, _laserCode) That opens up a variety of options. Thank you!
Recommended Posts