Jump to content

Complete Transport and Logistics Deployment - CTLD


Recommended Posts

  • 2 weeks later...

I just saw the advanced scripting part but can't figure out how to use the callbacks. Do you have an example for that? Currently I have a problem, my mission contains transporting a group of infantry to a specific location. But when the group is loaded into the helo (one of 6 possible helo units choosable by the players) and the helo crashes, I have no way to spawn a new group, end the mission, or somehow react to this. Maybe I can use the callback functions to handle this? But for this I have to understand them :D

"Sieh nur, wie majestätisch du durch die Luft segelst. Wie ein Adler. Ein fetter Adler."

http://www.space-view.net

Link to comment
Share on other sites

Find this bug report here, with some more details for those interested.(now with the bug report).

 

http://forums.eagle.ru/showthread.php?p=2668662&highlight=Destroy#post2668662

 

Any fix coming with the spawned units? This killls a lot of missions!

 

Spawn Bugs are now fixed in 1.5.4 BETA so should be in stable soon.

 

Real sling-load crates can now be destroyed and are also named correctly on the F6 Menu which is very exciting. When one more already reported bug is fixed then Sling load crates should be able to be used again in Multiplayer which is exciting. I'll do a little video this afternoon showing it all again.

 

I am not able to load FOB crates into the C-130/IL-76, how-ever the troop and vehicles functions work. Is this features currently disabled?

 

Thanks

 

Please can you post a small sample mission showing the issue? Are you sure your C-130 is close enough to the Logistics unit to load? Are you getting an error or just no F-10 Options?

 

 

I just saw the advanced scripting part but can't figure out how to use the callbacks. Do you have an example for that? Currently I have a problem, my mission contains transporting a group of infantry to a specific location. But when the group is loaded into the helo (one of 6 possible helo units choosable by the players) and the helo crashes, I have no way to spawn a new group, end the mission, or somehow react to this. Maybe I can use the callback functions to handle this? But for this I have to understand them :D

 

The sample in the documentation here:

 

https://github.com/ciribob/DCS-CTLD#advanced-scripting

 

If you add as a DO SCRIPT will output a message so you can see each callback being used.

 

The part below that describes what the callback variable will contain for each different type.

 

For the issue you describe I would:

 

Add an event handler for Unit dead or pilot ejected (you'll have to fill in the logic)

 

var handler = {}

function handler.eventHandler:onEvent(_event)

 if _event == nil or _event.initiator == nil then
     env.info("CTLD null event")
     return -- ignore
  elseif world.event.S_EVENT_EJECTION == _event.id 
or _event.id == 8 
or  _event.id == 9 then
-- unit ejected or unit dead or pilot dead

    -- Check if the unit was carrying troops
-- if they were, respawn them :)
-- reset variable indicating which unit was carrying troops
 
  end

end

--register in DCS
world.addEventHandler( handler.eventHandler)

-- CTLD callback
ctld.addCallback(function(_args)

   trigger.action.outText(_args.action,10)

if _args.action == "load_troops" then
-- Check Group etc...
end

end)



 

Add a callback and check if the action is "load_troops". If the group is the group you need to keep is loaded set a variable somewhere to indicate that is the case and which helicopter they're in.

 

If any of the events above trigger for the right unit (by checking the unit name or unit id), respawn the troops.

 

Hope that helps. As I say its a bit advanced so you'll need to be fairly confident with your LUA to get this working. :)

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

CiriBob,

 

Thank you for taking a second to answer my question. I don't have the option on the F-10 menu to load crates, only load/offload vehicles and check cargo status. The vehicles as well as the troop loading functions work fine. I am using the CTLD.lua stock with no changes.

 

Respectfully,

 

Also I placed the aircraft almost touching the logistics unit, but I don't think that effects the f-10 menu population.

Link to comment
Share on other sites

CiriBob,

 

Thank you for taking a second to answer my question. I don't have the option on the F-10 menu to load crates, only load/offload vehicles and check cargo status. The vehicles as well as the troop loading functions work fine. I am using the CTLD.lua stock with no changes.

 

Respectfully,

 

Also I placed the aircraft almost touching the logistics unit, but I don't think that effects the f-10 menu population.

 

Ah just change:

 

 

ctld.staticBugFix = false

 

At the top of the script and you'll be good to go.

 

As the bug has been fixed a while now I'm going to set this as the default again for the next release

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

Ciribob,

 

I wanted to know a couple of items:

 

1. is there a way to call the listRadioBeacons ADHOC. I want to add it as a triggered action for a unit called Atis when a Heli tunes to channel 117.00 and receives the list of beacons

2. the cratesInZone does not seem to count the sling load Items, is there a way to get that to work? it works fine if you are not sling loading but you are using a unit when loading on the heli, sling loading you are using a static object (cargo1) so I am not sure it is in the list of item to count.

3. the countdroppedUnitsInZone seems to return double the number of unit s at the fob. if I drop 8 the count comes back as 16.

 

 

I am trying to redo the Airmobile Operations - frontline mission by angle so I will attach the mission with it set not to sling load there has been no modifications to your CTLD.

 

thanks in advance for taking a look at this one.

 

Falcon76

UH-1H Airmobile M04 - Frontline v1.08.miz

MSI Creator X299 - INTEL i9 - 10900X 3.7 GHZ - 32 GB Corsair Dominator DDR4 - EVGA GTX 1080 FTW AC2

Link to comment
Share on other sites

Troop transport with AI - Pickup and drop off incorrect

 

Firstly, thank you to all the authors of CTTS and CTLD for giving the choppers something useful to do.

 

This is my first look into the CTLD script, I am just trying to fix old missions which were using the CTTS script. At this stage I am only using the troop transport and beacon tools.

 

A scenario is:

 

  • I have two groups of 5 troops to pickup at two different pickup zones, I send an AI controlled flight of two Hueys to pick them up defined as transport1 and transport2, the pickup zones are defined as pickzone1 and pickzone2, the troops groups are defined as extract1 and extract2, their drop-off is defined as dropzone1.

 

Problem is:

 

  • When the hueys land at the first pickup point they extract the 5 troops (which also disappear) fine, then they fly to the second pickup point and land to try and extract the other 5 troops (they don't disappear, so I assume they don't pick them up), the Hueys then fly to the drop zone and one huey unloads 5 troops and his wingman unloads 10 troops for a total of 15 troops, WTH:shocking:.

This seams rather buggy or is this sort of they way it is meant to work, ie, if each chopper can carry 10 men each, can you only pick up one load of troops from 1 - 20 and then drop them off or could you have 20 pickup points and pick up one man at a time until you have 20 on board and then deliver them to the drop zone.

 

Thanks for any help

 

Regards, Ian.

Asus p877v-pro, Intel I7 3770k 4.2ghz, 32gb Ripjaw X ram, Nvidia RTX-2070 Super, Samsung 32" TV, Saitek x52 pro Joystick and Combat rudder pedals, TrackIR 5, Win8.1 x64 with SSD and SSHD protected by (Avast AV).

 

DCS Tech Support.

Link to comment
Share on other sites

Maddog,

 

I am not the expert in this script but looking at the code, 10 troops is the default amount of troops to be picked up defined by "ctld.numberOfTroops = 10 -- default number of troops to load on a transport heli or C-130" so if no troops are in the area of the pickup zone then ten troops will be put in the transport.

 

I have not looked at your mission yet but I think the function you want to control the number of troops and not use the default is ctld.spawnGroupAtTrigger("GroupSide", Number, "TriggerName", Radius). this also sets it as extractable.

secondly since the function to load and unload troops is the same ounce troops are on a transport you are not able to pick more troops until the one group is dropped off. this would require the original troop group to be removed from the pickedup table, storing that information in a variable getting the new troop information, type, number and adding those type to a new group. this would be a collection of both groups and then the second pickup group be deleted. this would have to be a separate routine from the pickup and drop off routines. This could be done but if would be an enhancement, I think. I like the idea and maybe Cribob can look into it.

 

I will see if I can't look at what you have later tonight right now have to tend to the family.

 

thanks

 

Falcon76

MSI Creator X299 - INTEL i9 - 10900X 3.7 GHZ - 32 GB Corsair Dominator DDR4 - EVGA GTX 1080 FTW AC2

Link to comment
Share on other sites

Entropysg,

 

I would suspect the group is not spawned with AI on. not able to test right at this minute but try spawning a set of mortar troops instead of the crate and see if they fire. I suspect they will, if I get a chance I will try to follow the code to see how unpacked unit are spawned and see if the ai is on of off.

 

thanks

 

Falcon76

MSI Creator X299 - INTEL i9 - 10900X 3.7 GHZ - 32 GB Corsair Dominator DDR4 - EVGA GTX 1080 FTW AC2

Link to comment
Share on other sites

Ciribob,

 

I wanted to know a couple of items:

 

1. is there a way to call the listRadioBeacons ADHOC. I want to add it as a triggered action for a unit called Atis when a Heli tunes to channel 117.00 and receives the list of beacons

2. the cratesInZone does not seem to count the sling load Items, is there a way to get that to work? it works fine if you are not sling loading but you are using a unit when loading on the heli, sling loading you are using a static object (cargo1) so I am not sure it is in the list of item to count.

3. the countdroppedUnitsInZone seems to return double the number of unit s at the fob. if I drop 8 the count comes back as 16.

 

 

I am trying to redo the Airmobile Operations - frontline mission by angle so I will attach the mission with it set not to sling load there has been no modifications to your CTLD.

 

thanks in advance for taking a look at this one.

 

Falcon76

 

I'll check this Sunday hopefully, I've been meaning to do a new release for a while but the countInZone should with spawned crates, not sure about the ones already in a mission as the mission format has changed a lot.

 

For the Radio beacons you can call this function:

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

 

You'll need to call it like so:

 

ctld.listRadioBeacons({"helicargo1"})

 

Where "helicargo1" is the name of the player aircraft

 

I'll check 3 as well on the weekend

 

Firstly, thank you to all the authors of CTTS and CTLD for giving the choppers something useful to do.

 

This is my first look into the CTLD script, I am just trying to fix old missions which were using the CTTS script. At this stage I am only using the troop transport and beacon tools.

 

A scenario is:

 

  • I have two groups of 5 troops to pickup at two different pickup zones, I send an AI controlled flight of two Hueys to pick them up defined as transport1 and transport2, the pickup zones are defined as pickzone1 and pickzone2, the troops groups are defined as extract1 and extract2, their drop-off is defined as dropzone1.

 

Problem is:

 

  • When the hueys land at the first pickup point they extract the 5 troops (which also disappear) fine, then they fly to the second pickup point and land to try and extract the other 5 troops (they don't disappear, so I assume they don't pick them up), the Hueys then fly to the drop zone and one huey unloads 5 troops and his wingman unloads 10 troops for a total of 15 troops, WTH:shocking:.

This seams rather buggy or is this sort of they way it is meant to work, ie, if each chopper can carry 10 men each, can you only pick up one load of troops from 1 - 20 and then drop them off or could you have 20 pickup points and pick up one man at a time until you have 20 on board and then deliver them to the drop zone.

 

Thanks for any help

 

Regards, Ian.

 

15 sounds like the first 5 picked up OK, which is why they disappear, then at the second zone troops were loaded from a zone (default 10) into the second chopper.

 

I'd set the number of available troops in the zone to 0 then you know that the only troops that can be loaded are the ones you placed there:

 

Example of 5 troops in a zone here:

 

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

 

Just change the 5 to a 0.

 

 

 

Anyone got the mortars to work? When I deploy them I see seven or so tubes, but no crew to operate them, and they won't accept a fire command

 

Entropysg,

 

I would suspect the group is not spawned with AI on. not able to test right at this minute but try spawning a set of mortar troops instead of the crate and see if they fire. I suspect they will, if I get a chance I will try to follow the code to see how unpacked unit are spawned and see if the ai is on of off.

 

thanks

 

Falcon76

 

Is this Caucasus or Nevada? It might be that you now have to have at least one soldier part of a mortar group before they fire (they've always had invisible controllers) but I'll double check.

 

Maybe try with the editor first? Just place some mortars and see if they engage. Not sure why you can't control them either as I have set controllable to true for them. Can you control other dropped units like JTAC?

 

Apologies for the slow replies to you all

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

 

15 sounds like the first 5 picked up OK, which is why they disappear, then at the second zone troops were loaded from a zone (default 10) into the second chopper.

 

I'd set the number of available troops in the zone to 0 then you know that the only troops that can be loaded are the ones you placed there:

 

Example of 5 troops in a zone here:

 

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

 

Just change the 5 to a 0.

 

That did the trick, now works as I expected, thanks very much for that concise answer.

 

 

  • I had totally misenterpereted how the whole troop pickup/drop off system works.

Apologies for the slow replies to you all

Not a problem, keep up the fine work.

 

Regards, Ian.

Asus p877v-pro, Intel I7 3770k 4.2ghz, 32gb Ripjaw X ram, Nvidia RTX-2070 Super, Samsung 32" TV, Saitek x52 pro Joystick and Combat rudder pedals, TrackIR 5, Win8.1 x64 with SSD and SSHD protected by (Avast AV).

 

DCS Tech Support.

Link to comment
Share on other sites

Maddog,

 

I am not the expert in this script but looking at the code, 10 troops is the default amount of troops to be picked up defined by "ctld.numberOfTroops = 10 -- default number of troops to load on a transport heli or C-130" so if no troops are in the area of the pickup zone then ten troops will be put in the transport.

 

That was the problem, there was troops to pickup, but it didn't, and still put the default 10 in the second chopper anyway. (This was confusing me, because I hadn't realised that the system actually adds make believe soldiers onboard just by landing in a pickzone, I thought this setting of "ctld.numberOfTroops = 10" specified the amount of troops a chopper was allowed to carry, not how many troops it will load if you land in a pickzone)

 

Anyway, thanks for the reply, Ciribob has fixed it for me with a bit of info that has made it much clearer to me on how the system works.

 

Regards, Ian.

Asus p877v-pro, Intel I7 3770k 4.2ghz, 32gb Ripjaw X ram, Nvidia RTX-2070 Super, Samsung 32" TV, Saitek x52 pro Joystick and Combat rudder pedals, TrackIR 5, Win8.1 x64 with SSD and SSHD protected by (Avast AV).

 

DCS Tech Support.

Link to comment
Share on other sites

New version of the CTLD Script v.1.62 - 1.5 and 1.2 Compatible!

 

Make sure you have the new MIST 4.1.61 !

 

Change log:

  • Real sling load crates are now destroyed when unpacked - This is very exciting!!
  • Simulated sling loads are now back to using the generator model rather than UAZ

 

The crash when destroying statics (when you load a crate) is now fixed in DCS so i've changed that back.

 

The real sling loads are now fully working in DCS 2.0 and 1.5 - A small bug can occur where you cant change the selected crate once dropped. If you unpack the crate you can change again but this bug should be fixed in the next DCS release as its fixed internally.

 

I really recommend you have a go with the real sling loads again, its good fun and I'm so happy the static sling load crate can now be destroyed!

 

BTW, I've tested Mortars, they do fire if given an order but they do take a while to setup and won't fire on their own.

 

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

 

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

 

Examples:http://forums.eagle.ru/showthread.php?p=2621619

 

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

 

*** FOR 1.5 or 2.0: Make sure all human players are in separate groups / flights ***

  • 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

Thanks Ciri, as a matter of interest, what version of MIST is included in the zip package?

 

Getting some weird errors with the 4.3.73 version.

Ah that zip has a very old Mist version. I'll try and tomorrow tonight with the latest mist to make sure it's all OK!

 

Could you post the error you get here?

 

Sorry for the trouble Midnight!

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 will put the whole log in the Dropbox but below is the crunch of it:

 

05915.074 ERROR   Lua::Config: Call error world.onEvent:[string "-- world events hook..."]:453: Group doesn't exist
stack traceback:
   [C]: ?
   [C]: in function 'getName'
   [string "-- world events hook..."]:453: in function <[string "-- world events hook..."]:313>.
05915.074 INFO    SCRIPTING: MISTDB| unitSpawnEvent
05915.074 INFO    SCRIPTING: MISTDB| Object is a Unit
06126.933 ERROR   DCS: Mission script error: : [string "C:\Users\VSAAF\AppData\Local\Temp\DCS.openalpha\/~mis00005384"]:977: Group doesn't exist

Midnite Signature.jpg

552334314_MidniteSignature.jpg.7c1678ea5639bd6d044b092eb97c300e.jpg

Link to comment
Share on other sites

I will put the whole log in the Dropbox but below is the crunch of it:

 

05915.074 ERROR   Lua::Config: Call error world.onEvent:[string "-- world events hook..."]:453: Group doesn't exist
stack traceback:
   [C]: ?
   [C]: in function 'getName'
   [string "-- world events hook..."]:453: in function <[string "-- world events hook..."]:313>.
05915.074 INFO    SCRIPTING: MISTDB| unitSpawnEvent
05915.074 INFO    SCRIPTING: MISTDB| Object is a Unit
06126.933 ERROR   DCS: Mission script error: : [string "C:\Users\VSAAF\AppData\Local\Temp\DCS.openalpha\/~mis00005384"]:977: Group doesn't exist

 

Just tested on this mission with the latest MIST and all seemed OK? Might be something else in the Mission causing it?

 

Mist Version 4.3.73

 

BTW mission is using Real sling-load crates again :)

test-mission - real slingload.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

  • 2 weeks later...
Do you set the internal weight of a transport heli when it extracts troops?

 

Unfortunately not as this command only works in single-player or for the server host only.

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

Hm, saw the trigger action "set internal cargo" and wondered, whether you do it in the script, otherwise I would have done that via that trigger. But then I also saw, that is only SP.

So many cool things (cargo weight, failures, ..) only in SP, wasted potential...

"Sieh nur, wie majestätisch du durch die Luft segelst. Wie ein Adler. Ein fetter Adler."

http://www.space-view.net

Link to comment
Share on other sites

Is there anyway we can give ownership to the units that CTLD people drop so that SLmod can give them credit when they shoot people down, I know blueflag does it but there code is obfuscated...... Cant learn from that.

 

 

I've done that through CTLD-Callbacks, I basically safe the groupname along with the pilots name/ucid once something is unpacked to a table. I then intercept Shot/Hit/Kill events and safe them to another table. Whenever I get a kill event on the Client side (as they dont appear on mission side) I transfer it to the Mission side by saving it to a file, load it on mission side and check if it correlates to an earlier hit, which has all necessary information saved. I do not use SLMod though, but so far I manage to safe scores for a player-deployed sam reliably.

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