Jump to content

Complete Transport and Logistics Deployment - CTLD


Recommended Posts

CTLD not working for aircraft in same group

 

CTLD does not seem to work correctly for aircraft in the same group. Although all aircraft get the menus, they only work for the lead aircraft of the group.

Is there any work around for this ,(other than having all client escort heli's as a separate group), or is it to do with the group bug in the mission scripting engine?

 

Disregard, just found a post from 1 year ago regarding the same thing. Separate client groups it is then :)


Edited by FubarBundy
looked back throught the thread.... very old bug! :(
Link to comment
Share on other sites

Thanks for this amazing script. I am using it in almost all my MP missions and it is working great.

One suggestion for improvement later, if possible: it would be great to define the number of extracted personnel per aircraft group. Mi-8 would be able to take 15 people for example but gazelle only 2.

Link to comment
Share on other sites

  • 3 weeks later...
Thanks for this amazing script. I am using it in almost all my MP missions and it is working great.

One suggestion for improvement later, if possible: it would be great to define the number of extracted personnel per aircraft group. Mi-8 would be able to take 15 people for example but gazelle only 2.

 

Sorry for the slow reply! Just saw this. Its on the list but it'll probably be a while before I get round to CTLD as my time is a little short at the moment. Sorry! :)

Scripts: Complete Transport And Logistics Deployment - CTLD / CTLD Examples - Lots of example of how to use CTLD

CSAR Script - Downed Pilot Rescue / Dedicated Server Script - Automatically launch DCS Multiplayer server at startup

Range Scoring Script - Get scores and counts hits on targets for gunnery or bombs / SimpleSlotBlock - Multiplayer dynamic Slot Blocking Script

 

Projects: DCS-SimpleRadio Standalone - DCS Radio Integration for All Aircraft - NO TeamSpeak Required! :)

DCS-SimpleRadio Troubleshooting Post / DCS-SimpleRadio Free Support Channel on Discord

Link to comment
Share on other sites

  • 2 weeks later...
Hi Ciribob,

I have 1 Issue whit CTLD...

 

I use Mist 4.3.73 and CTLD...

 

I can do evry things whit CTLD but when i try to take HmmV Jtac I have this message from DCS

 

Do you have suggestions?

 

Thanks for reporting.

 

I've just had a quick look and I don't think that error is coming from CTLD as looking at the stack trace its from OnEvent which CTLD doesnt use.

 

Could you post the last bit of your dcs.log with the error and also try my sample mission from GitHub? If the sample mission works OK then it'll be another script causing it, if not I'll have to search for a CTLD bug :)

Scripts: Complete Transport And Logistics Deployment - CTLD / CTLD Examples - Lots of example of how to use CTLD

CSAR Script - Downed Pilot Rescue / Dedicated Server Script - Automatically launch DCS Multiplayer server at startup

Range Scoring Script - Get scores and counts hits on targets for gunnery or bombs / SimpleSlotBlock - Multiplayer dynamic Slot Blocking Script

 

Projects: DCS-SimpleRadio Standalone - DCS Radio Integration for All Aircraft - NO TeamSpeak Required! :)

DCS-SimpleRadio Troubleshooting Post / DCS-SimpleRadio Free Support Channel on Discord

Link to comment
Share on other sites

Here is my last crash log.

 

I usa in this mission Auto-script https://forums.eagle.ru/showthread.php?t=116968

 

THX!!

 

Thanks! Might be that script with the error then as that line in CTLD doesnt have a function and CTLD doesnt use events so its definitely not coming from CTLD.

 

Maybe try the mission without any scripts but CTLD and see if it works to be sure? Then add them back one by one until it breaks again to narrow it down. :)

Scripts: Complete Transport And Logistics Deployment - CTLD / CTLD Examples - Lots of example of how to use CTLD

CSAR Script - Downed Pilot Rescue / Dedicated Server Script - Automatically launch DCS Multiplayer server at startup

Range Scoring Script - Get scores and counts hits on targets for gunnery or bombs / SimpleSlotBlock - Multiplayer dynamic Slot Blocking Script

 

Projects: DCS-SimpleRadio Standalone - DCS Radio Integration for All Aircraft - NO TeamSpeak Required! :)

DCS-SimpleRadio Troubleshooting Post / DCS-SimpleRadio Free Support Channel on Discord

Link to comment
Share on other sites

  • 3 weeks later...

Hi Ciribob.

 

I have a question, I am expanding my C4SIR script for ground units. I want to make a lasing script but my approach will be different.

 

Via radio Menu F10 yo can load every single unit that are LOS from your lasing group.

I already did the most dificul part, new menus are displayed in the radio menu, with groups, and by selecting each group you can select specific units. Now I have all data, lasingunit, targetunit, groupunit.

 

What I cant find information, is how to make one unit to lase another one via script. I saw you have a ctld.unitlase, but I am unable to make it work.

 

Question.... which order should I give to a let say "jtacunit" to lase "targetunit". Could I use your ctld function mentioned if I put the parameters? I tryed but I dont see the marker at nigth.

 

Any lead?

 

this is what I wrote, an all parameters in red works.

 

function table_count(tt, item) -- To count doubles in a table
 local count
 count = 0
 for ii,xx in pairs(tt) do
   if item == xx then count = count + 1 end
 end
 return count
end

function table_unique(tt)-- to remove remove doubles in a table
           local newtable
           newtable = {}
           for ii,xx in ipairs(tt) do
           if(table_count(newtable, xx) == 0) then
           newtable[#newtable+1] = xx
           end
           end
           return newtable
           end
    
_path1 = missionCommands.addSubMenuForCoalition(coalition.side.BLUE,"Ground units", nil)
_path70 = missionCommands.addSubMenuForCoalition(coalition.side.BLUE,"Lasing", _path1)
_path71 = missionCommands.addSubMenuForCoalition(coalition.side.BLUE, "Targets",_path70)	

do
local redunits = mist.makeUnitTable({'[red][vehicle]'})
local bluelasinggroups = {'lasing1', 'lasing2'}

for k, v in pairs (bluelasinggroups) do	
local _lasinggroup = bluelasinggroups[k]	
k = _pathj
_pathj = missionCommands.addSubMenuForCoalition(coalition.side.BLUE, _lasinggroup, _path71) -- creating a Lasing unit group.


local _group = Group.getByName(_lasinggroup)
local _groupname = _group:getName()
[color="red"]local _jtacunit = _group:getUnit(1):getName()[/color]-- lider of the group



local LOSData = mist.getUnitsLOS({_jtacunit},2,redunits,2,10000)

local lasetargets = {}

	for k, v in pairs (LOSData) do
		local tabledata = LOSData[k]
		for j, w in pairs (tabledata.vis)do            
			local targetinLOS = tabledata.vis[j]
			lasetargets[#lasetargets+1] = targetinLOS
		end
	end
  	

   local lasetargetgrouptable = {} -- table with all units-groups    
       
	for k, v in pairs(lasetargets) do
		 local unit = lasetargets[k]
		 local unitname = unit:getGroup()
			lasetargetgrouptable[#lasetargetgrouptable+1] = unitname         
	end         



local tabletarget = table_unique(lasetargetgrouptable)    -- all duplicated groups removed	


	
	for o, p in pairs(tabletarget) do
           local group = tabletarget[o]
           [color="red"]local groupname = group:getName()[/color]		
           local targetgrouppos = mist.getLLString({units = mist.makeUnitTable{tostring('[g]'.. groupname)} , acc = 2,})
				
           local unitsingroups = group:getUnits()
	

		
		local tabletypes ={}			
		for i, j in pairs(unitsingroups) do    -- To see what is the higher threat... I 
				local unit=unitsingroups[i]
				local unitnames = unit:getTypeName(unit)
				tabletypes[#tabletypes+1] = unitnames
				tablesingletype = table_unique(tabletypes)
				
		end
		o = _pathU
		_pathU = missionCommands.addSubMenuForCoalition(coalition.side.BLUE,"Enemy LL-"..targetgrouppos.." type-"..table.concat(tablesingletype, ", "), _pathj)			
	   for i, j in pairs(unitsingroups) do    --  
				local unit=unitsingroups[i]
				local unittypenames = unit:getTypeName(unit)
				[color="red"]local enemyname = unit:getName()[/color]
				local unitpos = mist.getLLString({units = mist.makeUnitTable({enemyname}) , acc = 2,})
				
	[color="red"]codelaserused =1688[/color]
	  [color="Red"] missionCommands.addCommandForCoalition(coalition.side.BLUE, unitpos.."  "..unittypenames, _pathU, [/color][color="Red"]function () ctld.laseUnit(enemyname, _jtacunit, _groupname, codelaserused) end[/color], nil)
		end
	end
end
end


Edited by ESAc_matador
Link to comment
Share on other sites

Hi Ciribob.

 

I have a question, I am expanding my C4SIR script for ground units. I want to make a lasing script but my approach will be different.

 

Via radio Menu F10 yo can load every single unit that are LOS from your lasing group.

I already did the most dificul part, new menus are displayed in the radio menu, with groups, and by selecting each group you can select specific units. Now I have all data, lasingunit, targetunit, groupunit.

 

What I cant find information, is how to make one unit to lase another one via script. I saw you have a ctld.unitlase, but I am unable to make it work.

 

Question.... which order should I give to a let say "jtacunit" to lase "targetunit". Could I use your ctld function mentioned if I put the parameters? I tryed but I dont see the marker at nigth.

 

Any lead?

 

this is what I wrote, an all parameters in red works.

 

I'd look at these two functions: (link: https://github.com/ciribob/DCS-CTLD/blob/master/CTLD.lua#L4904 )

 


function ctld.laseUnit(_enemyUnit, _jtacUnit, _jtacGroupName, _laserCode)

   --cancelLase(jtacGroupName)

   local _spots = {}

   local _enemyVector = _enemyUnit:getPoint()
   local _enemyVectorUpdated = { x = _enemyVector.x, y = _enemyVector.y + 2.0, z = _enemyVector.z }

   local _oldLase = ctld.jtacLaserPoints[_jtacGroupName]
   local _oldIR = ctld.jtacIRPoints[_jtacGroupName]

   if _oldLase == nil or _oldIR == nil then

       -- create lase

       local _status, _result = pcall(function()
           _spots['irPoint'] = Spot.createInfraRed(_jtacUnit, { x = 0, y = 2.0, z = 0 }, _enemyVectorUpdated)
           _spots['laserPoint'] = Spot.createLaser(_jtacUnit, { x = 0, y = 2.0, z = 0 }, _enemyVectorUpdated, _laserCode)
           return _spots
       end)

       if not _status then
           env.error('ERROR: ' .. _result, false)
       else
           if _result.irPoint then

               --    env.info(jtacUnit:getName() .. ' placed IR Pointer on '..enemyUnit:getName())

               ctld.jtacIRPoints[_jtacGroupName] = _result.irPoint --store so we can remove after
           end
           if _result.laserPoint then

               --  env.info(jtacUnit:getName() .. ' is Lasing '..enemyUnit:getName()..'. CODE:'..laserCode)

               ctld.jtacLaserPoints[_jtacGroupName] = _result.laserPoint
           end
       end

   else

       -- update lase

       if _oldLase ~= nil then
           _oldLase:setPoint(_enemyVectorUpdated)
       end

       if _oldIR ~= nil then
           _oldIR:setPoint(_enemyVectorUpdated)
       end
   end
end

 

As between them you should be able to create a lase point and destroy one

 

Laser points don't move so you have to recreate and destroy to move them

 

Hope that helps!

Scripts: Complete Transport And Logistics Deployment - CTLD / CTLD Examples - Lots of example of how to use CTLD

CSAR Script - Downed Pilot Rescue / Dedicated Server Script - Automatically launch DCS Multiplayer server at startup

Range Scoring Script - Get scores and counts hits on targets for gunnery or bombs / SimpleSlotBlock - Multiplayer dynamic Slot Blocking Script

 

Projects: DCS-SimpleRadio Standalone - DCS Radio Integration for All Aircraft - NO TeamSpeak Required! :)

DCS-SimpleRadio Troubleshooting Post / DCS-SimpleRadio Free Support Channel on Discord

Link to comment
Share on other sites

I'd look at these two functions: (link: https://github.com/ciribob/DCS-CTLD/blob/master/CTLD.lua#L4904 )

 


function ctld.laseUnit(_enemyUnit, _jtacUnit, _jtacGroupName, _laserCode)

   --cancelLase(jtacGroupName)

   local _spots = {}

   local _enemyVector = _enemyUnit:getPoint()
   local _enemyVectorUpdated = { x = _enemyVector.x, y = _enemyVector.y + 2.0, z = _enemyVector.z }

   local _oldLase = ctld.jtacLaserPoints[_jtacGroupName]
   local _oldIR = ctld.jtacIRPoints[_jtacGroupName]

   if _oldLase == nil or _oldIR == nil then

       -- create lase

       local _status, _result = pcall(function()
           _spots['irPoint'] = Spot.createInfraRed(_jtacUnit, { x = 0, y = 2.0, z = 0 }, _enemyVectorUpdated)
           _spots['laserPoint'] = Spot.createLaser(_jtacUnit, { x = 0, y = 2.0, z = 0 }, _enemyVectorUpdated, _laserCode)
           return _spots
       end)

       if not _status then
           env.error('ERROR: ' .. _result, false)
       else
           if _result.irPoint then

               --    env.info(jtacUnit:getName() .. ' placed IR Pointer on '..enemyUnit:getName())

               ctld.jtacIRPoints[_jtacGroupName] = _result.irPoint --store so we can remove after
           end
           if _result.laserPoint then

               --  env.info(jtacUnit:getName() .. ' is Lasing '..enemyUnit:getName()..'. CODE:'..laserCode)

               ctld.jtacLaserPoints[_jtacGroupName] = _result.laserPoint
           end
       end

   else

       -- update lase

       if _oldLase ~= nil then
           _oldLase:setPoint(_enemyVectorUpdated)
       end

       if _oldIR ~= nil then
           _oldIR:setPoint(_enemyVectorUpdated)
       end
   end
end

 

As between them you should be able to create a lase point and destroy one

 

Laser points don't move so you have to recreate and destroy to move them

 

Hope that helps!

 

If you see my script, this is the function I am traying to use. Unsuccesfully, but let me ask you... this, _enemyUnit, _jtacUnit, _jtacGroupName, which format have?? I mean, string of the name? or getbyName(x) or what?

 

In my script, I did "jtac.getName()", "enemy.getName()" and so...

Link to comment
Share on other sites

If you see my script, this is the function I am traying to use. Unsuccesfully, but let me ask you... this, _enemyUnit, _jtacUnit, _jtacGroupName, which format have?? I mean, string of the name? or getbyName(x) or what?

 

In my script, I did "jtac.getName()", "enemy.getName()" and so...

 

Ah sorry I didn't read properly...

 

The function:

 

ctld.laseUnit(_enemyUnit, _jtacUnit, _jtacGroupName, _laserCode)

 

Requires an actual enemy unit object and a jtac unit object not just the name

 

You could do something like:

 

ctld.laseUnit(Unit.getByName("someEnemyName"), Unit.getByName("someJtacUnitName"), "jtactGroup", 1688)

 

Where you get the Units by name and then pass them into the function

 

Hope that helps :)


Edited by Ciribob

Scripts: Complete Transport And Logistics Deployment - CTLD / CTLD Examples - Lots of example of how to use CTLD

CSAR Script - Downed Pilot Rescue / Dedicated Server Script - Automatically launch DCS Multiplayer server at startup

Range Scoring Script - Get scores and counts hits on targets for gunnery or bombs / SimpleSlotBlock - Multiplayer dynamic Slot Blocking Script

 

Projects: DCS-SimpleRadio Standalone - DCS Radio Integration for All Aircraft - NO TeamSpeak Required! :)

DCS-SimpleRadio Troubleshooting Post / DCS-SimpleRadio Free Support Channel on Discord

Link to comment
Share on other sites

It works!!!

 

How to stop lasing without destroying the target? I tryed ctld.cancellase(Group.getByName(jtacgroup) and doesnt work.

 

Curious...

 

If you look closely at the function

 

ctld.cancelLase(_jtacGroupName)

 

It just requires the JTAC group name not the JTAC unit so

 


ctld.cancelLase("jtac1")

 

Will cancel it :)

Scripts: Complete Transport And Logistics Deployment - CTLD / CTLD Examples - Lots of example of how to use CTLD

CSAR Script - Downed Pilot Rescue / Dedicated Server Script - Automatically launch DCS Multiplayer server at startup

Range Scoring Script - Get scores and counts hits on targets for gunnery or bombs / SimpleSlotBlock - Multiplayer dynamic Slot Blocking Script

 

Projects: DCS-SimpleRadio Standalone - DCS Radio Integration for All Aircraft - NO TeamSpeak Required! :)

DCS-SimpleRadio Troubleshooting Post / DCS-SimpleRadio Free Support Channel on Discord

Link to comment
Share on other sites

  • 2 weeks later...
It doesnt work for me...

 

Could It Be that laseunit() has the condición if _oldlase ==nil then... So when i cancel It manually It executed the condition anyway?

 

Sorry I missed this, and I don't quite understand.

 

If you call ctld.laseUnit multiple times for the same JTAC, you'll only have ONE lase that just moves to the new unit position every time you call it, no need to call cancel to do this.

 

The cancel lase is only needed if you want to stop lasing completely.

 

Hope that helps

Scripts: Complete Transport And Logistics Deployment - CTLD / CTLD Examples - Lots of example of how to use CTLD

CSAR Script - Downed Pilot Rescue / Dedicated Server Script - Automatically launch DCS Multiplayer server at startup

Range Scoring Script - Get scores and counts hits on targets for gunnery or bombs / SimpleSlotBlock - Multiplayer dynamic Slot Blocking Script

 

Projects: DCS-SimpleRadio Standalone - DCS Radio Integration for All Aircraft - NO TeamSpeak Required! :)

DCS-SimpleRadio Troubleshooting Post / DCS-SimpleRadio Free Support Channel on Discord

Link to comment
Share on other sites

This is what does not work... I have the order via F10menu, I ll make some new trys.

 

When finished, this proyect I am working with is a perfect complement to CTLD.

 

You all see!

 

What doesn't work?

 

Cancel doesn't actually stop the lase?

 

Or calling LaseUnit again doesn't switch it to a new target?

 

Glad to hear you're working on something, good luck :)

Scripts: Complete Transport And Logistics Deployment - CTLD / CTLD Examples - Lots of example of how to use CTLD

CSAR Script - Downed Pilot Rescue / Dedicated Server Script - Automatically launch DCS Multiplayer server at startup

Range Scoring Script - Get scores and counts hits on targets for gunnery or bombs / SimpleSlotBlock - Multiplayer dynamic Slot Blocking Script

 

Projects: DCS-SimpleRadio Standalone - DCS Radio Integration for All Aircraft - NO TeamSpeak Required! :)

DCS-SimpleRadio Troubleshooting Post / DCS-SimpleRadio Free Support Channel on Discord

Link to comment
Share on other sites

Ctld.unitlase () works perfect. but if the unit is destroyed, the laser does not disssapear.

 

Also, and most important, ctld.cancellase () does not work...

 

Take into account, I am using my own script, previously loading the CTLD, and then using such functions, but it is strange, i can create the laser spot, but I cannot destroy it using ctld.ancellase (group)

Link to comment
Share on other sites

Ctld.unitlase () works perfect. but if the unit is destroyed, the laser does not disssapear.

 

Also, and most important, ctld.cancellase () does not work...

 

Take into account, I am using my own script, previously loading the CTLD, and then using such functions, but it is strange, i can create the laser spot, but I cannot destroy it using ctld.ancellase (group)

 

Ok the laser won't automatically disappear when a unit is destroyed as once a laser is created, it just stays where it is as its not tied to any unit. You have to manually update and remove it.

 

Cancel Lase should work, are you sure you using the name of the JTAC Group Name (not unit name or an actual group)?

 

I.e

 

Lase something:

 

ctld.laseUnit(Unit.getByName("someEnemyUNITName"), Unit.getByName("someJtacUNITName"), "JTAC_GROUP_NAME", 1688)

then cancel it with

ctld.cancelLase("JTAC_GROUP_NAME")

Scripts: Complete Transport And Logistics Deployment - CTLD / CTLD Examples - Lots of example of how to use CTLD

CSAR Script - Downed Pilot Rescue / Dedicated Server Script - Automatically launch DCS Multiplayer server at startup

Range Scoring Script - Get scores and counts hits on targets for gunnery or bombs / SimpleSlotBlock - Multiplayer dynamic Slot Blocking Script

 

Projects: DCS-SimpleRadio Standalone - DCS Radio Integration for All Aircraft - NO TeamSpeak Required! :)

DCS-SimpleRadio Troubleshooting Post / DCS-SimpleRadio Free Support Channel on Discord

Link to comment
Share on other sites

Supposingly...

 

I was doing it all rigth but let me check it again, i dont want to waste your time!!

 

Definitely works :)

 

See test mission. Spawn in in the air start huey and turn on NV goggles straight away.

 

You should see a laser start and then stop after 30 seconds. I guess its a naming issue. Hope this helps you :)

lasertest.miz

Scripts: Complete Transport And Logistics Deployment - CTLD / CTLD Examples - Lots of example of how to use CTLD

CSAR Script - Downed Pilot Rescue / Dedicated Server Script - Automatically launch DCS Multiplayer server at startup

Range Scoring Script - Get scores and counts hits on targets for gunnery or bombs / SimpleSlotBlock - Multiplayer dynamic Slot Blocking Script

 

Projects: DCS-SimpleRadio Standalone - DCS Radio Integration for All Aircraft - NO TeamSpeak Required! :)

DCS-SimpleRadio Troubleshooting Post / DCS-SimpleRadio Free Support Channel on Discord

Link to comment
Share on other sites

My mistake! I was misusing variable... So Cancellase didnt recognice the groupname later. I just put tostring(variable) and it is ok!!!!

 

So i finished my script! I ll publish it so we can tweak it!! Smoke, illum, lasing, CAS support and report of the enemies is now possible. You decide which one!

Link to comment
Share on other sites

  • 3 weeks later...

Hi Ciribob, I have a question.

 

I'd like to know if the HAWK SAM site is spawned as a group or if it is spawned as a seperate " groups" of single vehicles?

 

The reason for asking is that I'd like to use the CTLD script to "resupply" a FARP.

I found that when the group of vehicles that is already spawned at mission start, moves to the FARP and stops, the FARP is "activated" by which I mean you can refuel and rearm as well as the lights turn on.

 

Now, with the CTLD script I can designate a cargo drop zone and from there, switch a flag to use MIST to teleport the vehicles in the FARP vicinity.

 

What I need to try is to see if a spawned group of vehicles (M978, M818 and M1025) will allow a FARP to be "activated".

 

If so, would it be possible to add a function to the CTLD script to spawn said vehicle group in order to resupply a FARP?

 

 

With the MIST teleport function and the count crates in zone from CTLD I was able to teleport the FARP vehicles to the FARP by dropping cargo in a zone. After that, I was able to refuel and rearm at the FARP where previously, I was unable to do so.


Edited by Looney
additional information

[sIGPIC][/sIGPIC]

 

Commodore 64 | MOS6510 | VIC-II | SID6581 | DD 1541 | KCS Power Cartridge | 64Kb | 32Kb external | Arcade Turbo

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...