1 Commits

Author SHA1 Message Date
Ciaran Fisher
644b4dc2fe Added optional despawn timers to JTAC and to Troops 2019-01-12 10:52:25 +00:00
12 changed files with 890 additions and 2251 deletions

BIN
C-130-RadioFix.zip Normal file

Binary file not shown.

2079
CTLD.lua

File diff suppressed because it is too large Load Diff

BIN
Cargo Spawn Test.miz Normal file

Binary file not shown.

BIN
Il-76.zip Normal file

Binary file not shown.

BIN
Pickup-Dropoff-Demo.miz Normal file

Binary file not shown.

105
README.md
View File

@@ -101,20 +101,6 @@ You can also edit the CTLD.lua file to change some configuration options. Make s
## Setup in Mission Editor ## Setup in Mission Editor
### Test mission
You can use the `test-mission.miz` mission as a demonstration on how to use the CTLD script in a DCS mission.
This mission includes the CTLD script, a proper configuration, demonstration for some of the main features (including the "JTAC talk over the radio via SRS" functionality).
**Note to developers**: it's quite easy to set the loading of the CTLD script to dynamic, so you can make changes to the script, save it and simply reload the mission (left-shift + R) in the game to test the edits you made.
To do this, simply change the "Define loading mode" trigger (1) so that the condition reads "FLAG IS FALSE" (2), and edit the "DO SCRIPT" action (3) to replace the path with the path to the `CTLD.lua` file on your PC.
Optionaly, you can disable the STTS (text to speech over SRS) feature (4).
![dynamic_loading]
### Script Setup ### Script Setup
**This script requires MIST version 4.0.57 or above: https://github.com/mrSkortch/MissionScriptingTools** **This script requires MIST version 4.0.57 or above: https://github.com/mrSkortch/MissionScriptingTools**
@@ -144,12 +130,10 @@ To use the real cargo sling behaviour, set the ```ctld.slingLoad``` option to ``
-- ************************************************************************ -- ************************************************************************
ctld.staticBugFix = true -- When statics are destroyed, DCS Crashes. Set this to FALSE when this bug is fixed or if you want to use REAL sling loads :) ctld.staticBugFix = true -- When statics are destroyed, DCS Crashes. Set this to FALSE when this bug is fixed or if you want to use REAL sling loads :)
ctld.disableAllSmoke = false -- if true, all smoke is disabled at pickup and drop off zones regardless of settings below. Leave false to respect settings below ctld.disableAllSmoke = false -- if true, all smoke is diabled at pickup and drop off zones regardless of settings below. Leave false to respect settings below
ctld.hoverPickup = true -- if set to false you can load crates with the F10 menu instead of hovering...! ctld.hoverPickup = true -- if set to false you can load crates with the F10 menu instead of hovering...!
ctld.loadCrateFromMenu = false -- if set to true, you can load crates with the F10 menu OR hovering, in case of using choppers and planes for example.
ctld.enableCrates = true -- if false, Helis will not be able to spawn or unpack crates so will be normal CTTS ctld.enableCrates = true -- if false, Helis will not be able to spawn or unpack crates so will be normal CTTS
ctld.slingLoad = false -- if false, crates can be used WITHOUT slingloading, by hovering above the crate, simulating slingloading but not the weight... ctld.slingLoad = false -- if false, crates can be used WITHOUT slingloading, by hovering above the crate, simulating slingloading but not the weight...
-- There are some bug with Sling-loading that can cause crashes, if these occur set slingLoad to false -- There are some bug with Sling-loading that can cause crashes, if these occur set slingLoad to false
@@ -675,29 +659,19 @@ ctld.JTAC_LIMIT_BLUE = 10 -- max number of JTAC Crates for the BLUE Side
ctld.JTAC_dropEnabled = true -- allow JTAC Crate spawn from F10 menu ctld.JTAC_dropEnabled = true -- allow JTAC Crate spawn from F10 menu
ctld.JTAC_maxDistance = 10000 -- How far a JTAC can "see" in meters (with Line of Sight) ctld.JTAC_maxDistance = 4000 -- How far a JTAC can "see" in meters (with Line of Sight)
ctld.JTAC_smokeOn_RED = true -- enables automatic marking of target with smoke for RED forces ctld.JTAC_smokeOn_RED = true -- enables marking of target with smoke for RED forces
ctld.JTAC_smokeOn_BLUE = true -- enables automatic marking of target with smoke for BLUE forces ctld.JTAC_smokeOn_BLUE = true -- enables marking of target with smoke for BLUE forces
ctld.JTAC_smokeColour_RED = 4 -- RED side smoke colour -- Green = 0 , Red = 1, White = 2, Orange = 3, Blue = 4 ctld.JTAC_smokeColour_RED = 4 -- RED side smoke colour -- Green = 0 , Red = 1, White = 2, Orange = 3, Blue = 4
ctld.JTAC_smokeColour_BLUE = 1 -- BLUE side smoke colour -- Green = 0 , Red = 1, White = 2, Orange = 3, Blue = 4 ctld.JTAC_smokeColour_BLUE = 1 -- BLUE side smoke colour -- Green = 0 , Red = 1, White = 2, Orange = 3, Blue = 4
ctld.JTAC_smokeOffset_x = 0.0 -- distance in the X direction from target to smoke (meters) ctld.JTAC_jtacStatusF10 = false -- enables F10 JTAC Status menu
ctld.JTAC_smokeOffset_y = 2.0 -- distance in the Y direction from target to smoke (meters)
ctld.JTAC_smokeOffset_z = 0.0 -- distance in the z direction from target to smoke (meters)
ctld.JTAC_jtacStatusF10 = true -- enables F10 JTAC Status menu ctld.JTAC_location = false -- shows location of target in JTAC message
ctld.JTAC_location = true -- shows location of target in JTAC message ctld.JTAC_lock = "all" -- "vehicle" OR "troop" OR "all" forces JTAC to only lock vehicles or troops or all ground units
ctld.location_DMS = false -- shows coordinates as Degrees Minutes Seconds instead of Degrees Decimal minutes
ctld.JTAC_lock = "all" -- "vehicle" OR "troop" OR "all" forces JTAC to only lock vehicles or troops or all ground units
ctld.JTAC_allowStandbyMode = true -- Allow players to toggle lasing on/off
ctld.JTAC_laseSpotCorrections = true -- Allow players to toggle on/off the JTAC leading it's target, taking into account current wind conditions and the speed of the target (particularily useful against moving heavy armor)
ctld.JTAC_allowSmokeRequest = true -- Allow players to request a smoke on target (temporary)
ctld.JTAC_allow9Line = true -- Allow players to ask for a 9Line (individual) for a specific JTAC's target
``` ```
@@ -705,39 +679,19 @@ To make a unit deployed from a crate into a JTAC unit, add the type to the ```ct
The script allows a JTAC to mark and hold an IR and Laser point on a target allowing TGP's to lock onto the lase and ease of target location using NV Goggles. The script allows a JTAC to mark and hold an IR and Laser point on a target allowing TGP's to lock onto the lase and ease of target location using NV Goggles.
The JTAC will automatically switch targets when a target is destroyed or goes out of Line of Sight. Alternatively, a target list is available to chose from for each JTAC. The JTAC will automatically switch targets when a target is destroyed or goes out of Line of Sight.
The JTACs can be configured globally to target only vehicles or troops or all ground targets. The JTACs can be configured globally to target only vehicles or troops or all ground targets.
JTACs can also be asked to put smoke on target, give out 9-Lines, to toggle lasing on/off and compensate the laser spot position for target movement and local wind.
*** NOTE: LOS doesn't include buildings or tree's... Sorry! *** *** NOTE: LOS doesn't include buildings or tree's... Sorry! ***
The script can also be useful in daylight by enabling the JTAC to automatically mark enemy positions with Smoke. The JTAC will only move the smoke to the target every 5 minutes (to stop a huge trail of smoke markers) unless the target is destroyed, in which case the new target will be marked straight away with smoke. There is also an F10 menu to get the status of all JTACs, access the target lists and options for each JTAC (such as toggling lasing on/off or requesting a smoke manually). Do note that if a JTAC is down it won't report in or have it's own menu for targets and options. JTACs also do not overlap each other so the target lists do not include already lased targets. The script can also be useful in daylight by enabling the JTAC to mark enemy positions with Smoke. The JTAC will only move the smoke to the target every 5 minutes (to stop a huge trail of smoke markers) unless the target is destroyed, in which case the new target will be marked straight away with smoke. There is also an F10 menu option for units allowing the JTAC(s) to report their current status but if a JTAC is down it won't report in.
The automatic smokes will be offset from the target by the distances declared in the `ctld.JTAC_smokeOffset_*` constants. Requested smokes will be put close but not on target. To add JTACS to the mission using the editor place a JTAC unit on the map putting each JTAC in it's own group containing only itself and no
In practice, this is what the F10 radio menu for JTACs looks like :
![alt text](https://imgur.com/pfVldQ1.png "JTAC F10 Radio Menu")
You can see the "JTAC Status" command and the Selection Lists for each JTAC. Those look like :
![alt text](https://imgur.com/oDtajwv.png "Selection List for a JTAC")
Each target type within LOS of the JTAC and not already being lased (by any JTAC) is listed. Quantity is indicated. There is also the Action menu which looks like :
![alt text](https://imgur.com/nYWODLj.png "Action List for a JTAC")
This will allow you to act on the behavior of the JTAC or make requests. These items get updated every minute or so to reflect current configuration, same for the target list.
*** NOTE: Please be patient with the JTAC menu, wait at least 10 seconds between commands. If a spurious command is triggered, wait the same 10 seconds and try again. Sorry for this inconvenience. ***
To add JTACs or AFACs to the mission using the editor place a JTAC/AFAC unit on the map putting each JTAC/AFAC in it's own group containing only itself and no
other units. Name the group something easy to remember e.g. JTAC1 and make sure the JTAC units have a unique name which must other units. Name the group something easy to remember e.g. JTAC1 and make sure the JTAC units have a unique name which must
not be the same as the group name. The editor should do this for you but be careful if you copy and paste. not be the same as the group name. The editor should do this for you but be careful if you copy and paste.
Run the code below as a DO SCRIPT at the start of the mission, or after a delay if you prefer to activate a mission JTAC or AFAC. Run the code below as a DO SCRIPT at the start of the mission, or after a delay if you prefer to activate a mission JTAC.
**JTAC units deployed by unpacking a crate will automatically activate and begin searching for targets immediately.** **JTAC units deployed by unpacking a crate will automatically activate and begin searching for targets immediately.**
@@ -786,18 +740,6 @@ the mission but there can be a delay of up to 30 seconds after activation for th
You can also change the **name of a unit*** (unit, not group) to include "**hpriority**" to make it high priority for the JTAC, or "**priority**" to set it to be medium priority. JTAC's will prioritize targets within view by first marking hpriority targets, then priority targets, and finally all others. This works seemlessly with the all/vehicle/troop functionality as well. In this way you can have them lase SAMS, then AAA, then armor, or any other order you decide is preferable. You can also change the **name of a unit*** (unit, not group) to include "**hpriority**" to make it high priority for the JTAC, or "**priority**" to set it to be medium priority. JTAC's will prioritize targets within view by first marking hpriority targets, then priority targets, and finally all others. This works seemlessly with the all/vehicle/troop functionality as well. In this way you can have them lase SAMS, then AAA, then armor, or any other order you decide is preferable.
If the `DCS-SimpleTextToSpeech.lua` script is loaded (you'll find it [here](https://github.com/ciribob/DCS-SimpleTextToSpeech)), and configured (i.e. the `STTS.DIRECTORY`, `STTS.SRS_PORT` and optionaly the `STTS.GOOGLE_CREDENTIALS` variables are set), the JTAC can talk over SRS.
To do this, you can specify the _radio parameter when calling ctld.JTACAutoLase like in this example :
```lua
ctld.JTACAutoLase('JTAC1', 1688, true,"all", 4, { freq = "251.50", mod = "AM", name = "JTAC one" })
```
If you don't use the _radio parameter, CTLD will compute a FM frequency based on the laser designator code : 30Mhz + [second figure of the code] + [last two figures of the code] * 0.05.
For example, if the laser code is *1688*, the frequency will be *40.40Mhz*.
JTAC frequency is available through the "JTAC Status" radio menu
# In Game # In Game
## Troop Loading and Unloading ## Troop Loading and Unloading
@@ -820,7 +762,6 @@ Different Troop Groups can be loaded from a pickup zone. The ```ctld.loadableGro
-- at is RPG-16 -- at is RPG-16
-- aa is Stinger or Igla -- aa is Stinger or Igla
-- mortar is a 2B11 mortar unit -- mortar is a 2B11 mortar unit
-- jtac is a JTAC soldier, which will use JTACAutoLase
-- You must add a name to the group for it to work -- You must add a name to the group for it to work
-- You can also add an optional coalition side to limit the group to one side -- You can also add an optional coalition side to limit the group to one side
-- for the side - 2 is BLUE and 1 is RED -- for the side - 2 is BLUE and 1 is RED
@@ -834,26 +775,6 @@ ctld.loadableGroups = {
``` ```
The infantry groups have a weight, too. It is calculated based on the soldiers' roles, and the weight of their kit
- Every soldier weights between 90% and 120% of ctld.SOLDIER_WEIGHT, and they all carry a backpack and their helmet (ctld.KIT_WEIGHT)
- Standard grunts have a rifle and ammo (ctld.RIFLE_WEIGHT)
- AA soldiers have a MANPAD tube (ctld.MANPAD_WEIGHT)
- Anti-tank soldiers have a RPG and a rocket (ctld.RPG_WEIGHT)
- Machine gunners have the squad MG and 200 bullets (ctld.MG_WEIGHT)
- JTAC have the laser sight, radio and binoculars (ctld.JTAC_WEIGHT)
- Mortar servants carry their tube and a few rounds (ctld.MORTAR_WEIGHT)
```lua
ctld.SOLDIER_WEIGHT = 80 -- kg, will be randomized between 90% and 120%
ctld.KIT_WEIGHT = 20 -- kg
ctld.RIFLE_WEIGHT = 5 -- kg
ctld.MANPAD_WEIGHT = 18 -- kg
ctld.RPG_WEIGHT = 7.6 -- kg
ctld.MG_WEIGHT = 10 -- kg
ctld.MORTAR_WEIGHT = 26 -- kg
ctld.JTAC_WEIGHT = 15 -- kg
```
## Cargo Spawning and Sling Loading ## Cargo Spawning and Sling Loading
@@ -885,7 +806,7 @@ Once you've loaded the crate, fly to where you want to drop it and drop using th
Once on the ground unpack as normal using the CTLD Commands Menu - CTLD->CTLD Commands->Unpack Crate Once on the ground unpack as normal using the CTLD Commands Menu - CTLD->CTLD Commands->Unpack Crate
**Note: You can also set ```ctld.hoverPickup = false``` so you can load crates using the F10 menu instead of Hovering; or keep ```ctld.hoverPickup = true``` and set ```ctld.loadCrateFromMenu = true``` so you can load the crates by hovering OR from the F10 menu** **Note: You can also set ```ctld.hoverPickup = false``` so you can load crates using the F10 menu instead of Hovering. **
### Real Sling Loading ### Real Sling Loading
@@ -1060,5 +981,3 @@ Below is a complete list of all the "actions" plus the data that is sent through
* ```{unit = "Unit that did the action",crate = "Crate Details", spawnedGroup = "Group rearmed by crate", action = "rearm"}``` * ```{unit = "Unit that did the action",crate = "Crate Details", spawnedGroup = "Group rearmed by crate", action = "rearm"}```
* ```{unit = "Unit that did the action",crate = "Crate Details", spawnedGroup = "Group spawned by crate", action = "unpack"}``` * ```{unit = "Unit that did the action",crate = "Crate Details", spawnedGroup = "Group spawned by crate", action = "unpack"}```
* ```{unit = "Unit that did the action",crate = "Crate Details", spawnedGroup = "Group repaired by crate", action = "repair"}``` * ```{unit = "Unit that did the action",crate = "Crate Details", spawnedGroup = "Group repaired by crate", action = "repair"}```
[dynamic_loading]: trigger-dynamic-loading.png

957
mist.lua

File diff suppressed because it is too large Load Diff

BIN
test-fob.miz Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 79 KiB