Jump to content

Complete Transport and Logistics Deployment - CTLD


Recommended Posts

Unfortunately not. Off the top of my head the easiest way is to pre place (or spawn) the units on the deck.

 

I should have some time tomorrow evening to take a quick look. I'll see if I can knock up a snippet that'll work.

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

New version of the CTLD Script v.1.35 - 1.5 Compatible!

 

Make sure you have the new MIST 4.0.57 !

 

Change log:

  • Changed default AA System for Blue back to the HAWK and KUB for Red
  • Ships can now be used as a pickup zone by adding the ship UNIT NAME to the ctld.pickupZone list
  • Added an extra option to the pickupZone configuration to store the current number of groups available in a zone in a flag. You can use this flag number and value in triggers
  • Added Mission Editor function ctld.unloadTransport so you can unload a transport using a DO SCRIPT as long as the transport is on the ground
  • Added Mission Editor function ctld.changeRemainingGroupsForPickupZone so you can add or remove the remaining number of groups at a zone.

 

 

When upgrading a 1.2 mission to 1.5:

  • Remove and Re-add the beacon.ogg and beaconsilent.ogg using a Sound to country Action
  • Make sure you have the latest mist loaded as a DO SCRIPT before CTLD's DO SCRIPT. You must not use "On Mission Start" or "Initialization Script" as these are bugged
  • Double check your zone names and coalition match the new pickup and dropoff zones list. Option to set a zone for use by both sides for ease and most zones are active by default

 

Please see Readme and Github for latest code and how to use

Link:https://github.com/ciribob/DCS-CTLD

 

As always, please let me know if you have any issues or suggestions!

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 am having a similar issue with CTLD that I first experienced with CTTS. After dropping AI troops, they will not engage the enemy. In the case of CTLD, the troops will begin to move toward the enemy troops, but not only are they in single file, they stop as soon as the first shot is fired and will not engage or move any further. In my mission, the AI troops have to move up a slight incline to see and engage the enemy. As soon as the first AI troop reaches the crest, shots are fired and the AI troops stop moving as I noted, so the rest don't even see the enemy as yet.

 

In the case of CTTS, this problem was resolved by script written by Chump and posted below. I tried to replace the findnearestenemy script in CTLD with this code, but it didn't work (which I was afraid would be the case).

 

If anyone has any suggestions on how to improve the behavior of the AI troops, I would greatly appreciate it. I am trying get one of my missions updated from DCSW 1.0 to DCSW 1.5.

 

Thanks,

Paul

 

-- Find nearest enemy to coalition according to a reference position

function FindNearestEnemy(refpos, radius, groupside)
   local minDist = maxDistEnemy

if radius == 0 then
	minDist = 50
end

   local EnemyPos = nil
local destination = nil
local xdest = nil
local ydest = nil
local selected = nil
local group = nil
local groupName = nil
local units = nil
local leader = nil
local leaderpos = nil
local dist = nil
local RedList = coalition.getGroups(1, Group.Category.GROUND)
local BlueList = coalition.getGroups(2, Group.Category.GROUND)
local tbl = nil

if groupside == 2 then
	tbl = RedList
elseif groupside == 1 then
	tbl = BlueList
end

   for i = 1, #tbl do
	if tbl[i] ~= nil then
		groupName = tbl[i]:getName()
		group = Group.getByName(groupName)
		if group ~= nil then
			units = group:getUnits()
			if units ~= nil then
				for x = 1, #units do
					if units[x]:getLife() > 0 then
						leader = units[x]
						break
					end
				end
				if leader ~= nil then
					leaderpos = leader:getPoint()
					dist = GetDistance(refpos.x, refpos.z, leaderpos.x, leaderpos.z)
					if dist < minDist then
						minDist = dist
						EnemyPos = leaderpos
					end
				end
			end
		end
	end
end

if EnemyPos ~= nil then
	xdest = EnemyPos.x + math.random(100, 200) - math.random(100, 200)
	ydest = EnemyPos.z + math.random(100, 200) - math.random(100, 200)
else
	xdest = refpos.x + math.random(0, radius) - math.random(0, radius)
	ydest = refpos.z + math.random(0, radius) - math.random(0, radius)
end

local destination = {
	x = xdest,
	y = ydest,
}

   return destination
end

Link to comment
Share on other sites

I am having a similar issue with CTLD that I first experienced with CTTS. After dropping AI troops, they will not engage the enemy. In the case of CTLD, the troops will begin to move toward the enemy troops, but not only are they in single file, they stop as soon as the first shot is fired and will not engage or move any further. In my mission, the AI troops have to move up a slight incline to see and engage the enemy. As soon as the first AI troop reaches the crest, shots are fired and the AI troops stop moving as I noted, so the rest don't even see the enemy as yet.

 

In the case of CTTS, this problem was resolved by script written by Chump and posted below. I tried to replace the findnearestenemy script in CTLD with this code, but it didn't work (which I was afraid would be the case).

 

If anyone has any suggestions on how to improve the behavior of the AI troops, I would greatly appreciate it. I am trying get one of my missions updated from DCSW 1.0 to DCSW 1.5.

 

Thanks,

Paul

 

-- Find nearest enemy to coalition according to a reference position

function FindNearestEnemy(refpos, radius, groupside)
   local minDist = maxDistEnemy

if radius == 0 then
	minDist = 50
end

   local EnemyPos = nil
local destination = nil
local xdest = nil
local ydest = nil
local selected = nil
local group = nil
local groupName = nil
local units = nil
local leader = nil
local leaderpos = nil
local dist = nil
local RedList = coalition.getGroups(1, Group.Category.GROUND)
local BlueList = coalition.getGroups(2, Group.Category.GROUND)
local tbl = nil

if groupside == 2 then
	tbl = RedList
elseif groupside == 1 then
	tbl = BlueList
end

   for i = 1, #tbl do
	if tbl[i] ~= nil then
		groupName = tbl[i]:getName()
		group = Group.getByName(groupName)
		if group ~= nil then
			units = group:getUnits()
			if units ~= nil then
				for x = 1, #units do
					if units[x]:getLife() > 0 then
						leader = units[x]
						break
					end
				end
				if leader ~= nil then
					leaderpos = leader:getPoint()
					dist = GetDistance(refpos.x, refpos.z, leaderpos.x, leaderpos.z)
					if dist < minDist then
						minDist = dist
						EnemyPos = leaderpos
					end
				end
			end
		end
	end
end

if EnemyPos ~= nil then
	xdest = EnemyPos.x + math.random(100, 200) - math.random(100, 200)
	ydest = EnemyPos.z + math.random(100, 200) - math.random(100, 200)
else
	xdest = refpos.x + math.random(0, radius) - math.random(0, radius)
	ydest = refpos.z + math.random(0, radius) - math.random(0, radius)
end

local destination = {
	x = xdest,
	y = ydest,
}

   return destination
end

 

this is a DCS issue. WHen they got shot, they stop and start firing. If you want them to move forward in F10 view, put them in red condition... problem is they move and they got fired, and probably killed. So, you have to do this with other group covering.

 

i suggest you to use the firesupression script.

Link to comment
Share on other sites

Onother one!!!

 

Now, we have the automatic loading in a pick zone. THen we have the preload option. Now,

 

ctld.unloadTransport.

 

My intentions is to have also a ctld.loadtransport. so,any extractable unit will load into the tranpsort.

 

WHat i want to do is, witha single radio command ( i can do myself) activate a flag to load such transports. I guess it wont take you too long.

 

;)

 

REgards!!!!

Link to comment
Share on other sites

this is a DCS issue. WHen they got shot, they stop and start firing. If you want them to move forward in F10 view, put them in red condition... problem is they move and they got fired, and probably killed. So, you have to do this with other group covering.

 

i suggest you to use the firesupression script.

 

@ESAc_matador -- You could very well be correct, but I must say that the script written by Chump as posted did indeed resolve the issue, so I'm doubtful that it is strictly a DCS issue. Yes, lots of the AI troops do get killed, but it makes for a heck of a battle to watch. You just keep dropping fresh troops until the job is done.

 

I will try the firesupression script again, but the last time I tried it I was getting game crashes.

 

In any case, thanks for your response and suggestions.

 

Paul

Link to comment
Share on other sites

@ESAc_matador -- You could very well be correct, but I must say that the script written by Chump as posted did indeed resolve the issue, so I'm doubtful that it is strictly a DCS issue. Yes, lots of the AI troops do get killed, but it makes for a heck of a battle to watch. You just keep dropping fresh troops until the job is done.

 

I will try the firesupression script again, but the last time I tried it I was getting game crashes.

 

In any case, thanks for your response and suggestions.

 

Paul

 

Hi Paul,

 

Unfortunately that code above is just a longer version of my findNearestEnemy function and they'll give pretty much the same result but nice try! :)

 

The reason the troops stop is as ESAc_matador says, the troops will stop moving as soon as they come under fire which isn't controlled by the script. You can set their state to GREEN to force them to move but they'll just get mowed down.

 

You can change this line:

 

https://github.com/ciribob/DCS-CTLD/blob/master/CTLD.lua#L3263

 

To set the initial state to AI.Option.Ground.val.ALARM_STATE.GREEN rather than auto ( AI.Option.Ground.val.ALARM_STATE.AUTO) but then they wont engage when under fire but they will keep running like lemmings :smilewink:

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

Hi Paul,

 

Unfortunately that code above is just a longer version of my findNearestEnemy function and they'll give pretty much the same result but nice try! :)

 

The reason the troops stop is as ESAc_matador says, the troops will stop moving as soon as they come under fire which isn't controlled by the script. You can set their state to GREEN to force them to move but they'll just get mowed down.

 

You can change this line:

 

https://github.com/ciribob/DCS-CTLD/blob/master/CTLD.lua#L3263

 

 

To set the initial state to AI.Option.Ground.val.ALARM_STATE.GREEN rather than auto ( AI.Option.Ground.val.ALARM_STATE.AUTO) but then they wont engage when under fire but they will keep running like lemmings :smilewink:

 

Ups, sorry. You needed to put green state!.

Actually, it si more realistic, to stop moving. i dont see many armies attacking "a la Banzai" now a days... If you use the firesupreesion. It is very good for HUEYS giving cover from the air with door gunners or rockets.

 

If not, you have two groops, one shoot and the other advance, but then, it is difficult o do this and fly at the same time. Of course, we are talking about if you have the CA

Link to comment
Share on other sites

New version of the CTLD Script v.1.36 - 1.5 Compatible!

 

Make sure you have the new MIST 4.0.57 !

 

Change log:

  • Added ctld.loadTransport and ctld.unloadTransport Mission Editor Function
  • Added ctld.countDroppedGroupsInZone(_zone, _blueFlag, _redFlag) Mission Editor Function
  • Added ctld.countDroppedUnitsInZone(_zone, _blueFlag, _redFlag) Mission Editor Function

 

The countDroppedGroupsInZone and countDroppedUnitsInZone need to be run using a CONTINUOUS TRIGGER and will store the current number of extractable units or groups in the two flags specified.

 

When upgrading a 1.2 mission to 1.5:

  • Remove and Re-add the beacon.ogg and beaconsilent.ogg using a Sound to country Action
  • Make sure you have the latest mist loaded as a DO SCRIPT before CTLD's DO SCRIPT. You must not use "On Mission Start" or "Initialization Script" as these are bugged
  • Double check your zone names and coalition match the new pickup and dropoff zones list. Option to set a zone for use by both sides for ease and most zones are active by default

 

Please see Readme and Github for latest code and how to use

Link:https://github.com/ciribob/DCS-CTLD

 

As always, please let me know if you have any issues or suggestions!


Edited by Ciribob
  • Like 1

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

Hi Paul,

 

Unfortunately that code above is just a longer version of my findNearestEnemy function and they'll give pretty much the same result but nice try! :)

 

@Ciribob -- Thanks for the info. I did try setting the state to green as you suggested, but just as you said as well, the troops ran blindly into the kill zone and never returned fire. The next thing I did was change the formation from "Off Road" to "Cone" and that did the trick. The enemy is set to return fire, so enough of my troops get over the rise before the shooting starts and are able to take out the enemy.

 

There is one other thing I'm finding that might or might not be a setting in the CTLD.lua file. When I run the original version of this mission in DCSW 1.0, which uses CTTS.lua, Combined Arms is active and I can control the troops in the F10 map view. When I run the new version of this mission, which now uses CTLD.lua and mist.lua, CA is not active. I can't take control of anything. I did not change any other settings within the mission, such "Player can drive," so I'm not sure what has changed. When I click on the dropped troops, the screen that allows control does not appear. If you have any ideas on this, that would be appreciated as well.

 

In any case, thanks again. I really appreciate the assistance.

 

Paul

 

Edit: There must something else going on with regard to CA not related to CTLD. I just ran my mission on my main sim PC and all worked well. On the PC I used for updating the mission, CA related functionality was as described above. There is probably a setting somewhere that I am missing.

 

Edit 2: OK, I'm stupid. I was testing the mission as an observer, so CA functionality was not available to me. As a player or game master, groups and units can be controlled. All is well with the DCS world. :thumbup:


Edited by pdmarsh
Link to comment
Share on other sites

Thanks Ciribob!!

 

Regarding the ctld.loadTransport is it posible that the unit calle " tranport1" instead if pick up his group, it can pick up the nearest unit inside a zone?

 

It is better to not link infantry unitss with transport. Better to have the option open

 

No worries, the transport isnt linked to a group. If you call ctld.loadTransport it'll load the closest group or pickup a group from a pickup zone. It works exactly the same as if a player had tried to load a group into their own transport.

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

Excuse me for asking, I'm a .lua noob. I can't seem to get the CTLD script to work correctly under 1.2.16. It states the demo misison uses a newer version of the misison editor.

 

Does this influence the way the script works at all or is it compatible wiht 1.2.16?

[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

Excuse me for asking, I'm a .lua noob. I can't seem to get the CTLD script to work correctly under 1.2.16. It states the demo misison uses a newer version of the misison editor.

 

Does this influence the way the script works at all or is it compatible wiht 1.2.16?

 

This version is for 1.2 and the test mission should work fine in 1.2 as well

 

Hope that helps!

 

Link: https://github.com/ciribob/DCS-CTLD/archive/675f1f0d91c067886545cf107c922f0f63861964.zip

 

Just remember if you ever upgrade to 1.5 you need to update the MIST script and CTLD to the latest version here: https://github.com/ciribob/DCS-CTLD

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

Thanks Ciribob, I'll try it.

Just for my information as a mission design newb, the script codes you mention on the github page, they need to be typed in the DO SCRIPT window to work, correct?

[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

Thanks Ciribob, I'll try it.

Just for my information as a mission design newb, the script codes you mention on the github page, they need to be typed in the DO SCRIPT window to work, correct?

 

Yes correct.

 

You need to have MIST loaded first as a DO SCRIPT FILE, then CTLD as a DO SCRIPT FILE and then after that any scripts as DO SCRIPTS. Make sure to use the TIME MORE option so all the scripts load in the correct order.

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 got it to work, thanks for a very, very nice script there Ciribob. Managed to get 10 troops dropped off and got a Stinger crate to its destination. Hovering over the crate was hard bu I got it working.

 

One question I have, though not very important, we'd like to set our MANPAD unit, which we use as a human controlled JTAC, to invisible. It is at all possible to set such things to a unit using a LUA script?

[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

I'm thinkinf of a zone where the manpad unit will be dropped which then, upon a unit being dropped/spawned there to set to invisible.

[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

You mean the script? We did a test yesterday and were able to set-up a HAWK SAM site, drop troops and transport crate(s) to fabricate a MANPAD and HMMV unit.

[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

Sorry for the slow reply...

 

One question I have, though not very important, we'd like to set our MANPAD unit, which we use as a human controlled JTAC, to invisible. It is at all possible to set such things to a unit using a LUA script?

 

Glad you got it working, i'll have a look at this tonight.

 

The code to mark a unit as invisible is:

 


local _spawnedGroup = Group.getByName("Some name")

   local _setInvisible = {
       id = 'SetInvisible',
       params = {
           value = true
       }
   }


  local _controller = _spawnedGroup:getController()

  
   Controller.setCommand(_controller, _setImmortal)

 

But catching the units group name or getting the unit will require a bit of thought but I'll have a look.

 

 

Is this working in 1.5 by any chance?

 

 

Yes the latest version on GitHub will work fine in 1.5. :)

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

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...