Jump to content

Infantry Drop Script (CTTS.lua) Not Working Well in 1.2.12


Recommended Posts

Posted (edited)

I was in the middle of developing a new mission when DCSW 1.2.12 was released. Infantry drops using CTTS.lua worked as expected before the release, but with the new release, successful infantry drops did not work consistently. When attempting to drop troops in the drop zone, I would get a screen message saying troops were dropped, but they would not be drawn by DCSW and would not show up in F10 view. However, I could pick up and drop of troops at or near the FARP where the pick up zone is. My mission file was not edited between the prior build and release 1.2.12, so this behavior, whether a bug or not, was introduced with the new release. I did open and re-save the mission using the new build and still had the problem.

 

I will do more testing and post details and/or files, but I want to get this posted in the event others are seeing something similar and wish to comment.

 

Thanks,

Paul

Edited by pdmarsh
Posted

After a great deal of experimenting with different scenarios, what I discovered is that the simple act of destroying an enemy emplacement, e.g. SAM or AAA, precludes the spawning of friendly troops. If no emplacements have been destroyed, the troops will spawn. If only one emplacement gets destroyed, the troops will not spawn. I realize this sounds odd, but I tried quite a few different scenarios and it always boils down to whether or not an enemy emplacement has been destroyed.

 

I'll try to create a simple mission that displays this behavior and post it.

 

Paul

Posted

How to Reproduce the Issue

 

Steps to reproduce/demonstrate issue:

 

1. Open attached mission.

2. Enter mission as "Observer."

3. Allow UH-1H transports to land at pickzone.

4. Use options menu to release transports from pickzone (\F10\F2).

5. Track transports to first dropzone.

6. Observe that troops spawn as soon as transports land.

7. Exit and restart mission, entering as "Observer."

8. Allow CAS flight to enter orbit.

9. Use options menu to release CAS flight (\F10\F1).

10. Allow CAS flight to destroy SAM.

11. Release transports as noted above.

12. Observe that troops do not spawn after transports land in dropzone.

FailureToSpawn.miz

Posted

One of the scripting commands CTTS uses has changed in functionality, which is most likely a bug. Simply put coalition.getGroups() returns alive and dead groups (instead of just alive groups). CTTS 'gets stuck' when it tries to get the position of a unit that is dead.

  • Like 1

The right man in the wrong place makes all the difference in the world.

Current Projects:  Grayflag ServerScripting Wiki

Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread)

 SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum

Posted

@Grimes -- Thank you very much for taking time to find the source of this issue. After looking at some of the resources in you signature line, it appears there are other tools out there that do infantry pick-up and drop-off. They might be beyond my ability to implement right now, but I'll try to learn how. For now, I think I can simply delete the "Find nearest enemy..." section of CTTS.lua. I'm dropping infantry right in a hot zone, so as long as they react to incoming fire, they'll have no trouble knowing where the enemy is. We'll see how this works.

 

Thanks again. Your time is very much appreciated.

 

Paul

  • Like 1
Posted
@Grimes -- Thank you very much for taking time to find the source of this issue. After looking at some of the resources in you signature line, it appears there are other tools out there that do infantry pick-up and drop-off. They might be beyond my ability to implement right now, but I'll try to learn how. For now, I think I can simply delete the "Find nearest enemy..." section of CTTS.lua. I'm dropping infantry right in a hot zone, so as long as they react to incoming fire, they'll have no trouble knowing where the enemy is. We'll see how this works.

 

Thanks again. Your time is very much appreciated.

 

Paul

+1

Please, can You share modified working CTTS?

Thanks in advance.

antonio.

Posted
+1

Please, can You share modified working CTTS?

Thanks in advance.

antonio.

 

Hi Antonio -- Modifying CTTS.lua as I suggested did not work, I'm afraid. I'm going to try to apply other helicopter scripting tools that are available and see if I can get troop drop to work that way.

 

Paul

Posted
Hi Antonio -- Modifying CTTS.lua as I suggested did not work, I'm afraid. I'm going to try to apply other helicopter scripting tools that are available and see if I can get troop drop to work that way.

 

Paul

Yes, I've noticed. I fly with the Mi-8 and this change does not work. However if I drop-off the troops (using CTTS) before the destruction of any ground vehicles, troops are visible in DCSW.

We stay tuned for future improvements. Thanks again.

antonio.

Posted
Yes, I've noticed. I fly with the Mi-8 and this change does not work. However if I drop-off the troops (using CTTS) before the destruction of any ground vehicles, troops are visible in DCSW.

We stay tuned for future improvements. Thanks again.

antonio.

 

Antonio -- I was able to make a very simple modification to CTTS.lua that resolved the problem for my mission, but it will undoubtedly break something else. In the first line below, I changed the coalition number from 1 to 2. This has the effect of stopping the script from looking for red coalition emplacements, and therefore it will not see dead ones either. I suspect that if there were a blue emplacement that was killed, the script would fail again. After testing, I believe these numbers must remain either 1 or 2 or the script fails completely.

 

Hope this helps until a better fix arrives.

 

Paul

 

local RedList = coalition.getGroups(2, nil) -- gets most recent grouplist

local BlueList = coalition.getGroups(2, nil)

Posted
Antonio -- I was able to make a very simple modification to CTTS.lua that resolved the problem for my mission, but it will undoubtedly break something else. In the first line below, I changed the coalition number from 1 to 2. This has the effect of stopping the script from looking for red coalition emplacements, and therefore it will not see dead ones either. I suspect that if there were a blue emplacement that was killed, the script would fail again. After testing, I believe these numbers must remain either 1 or 2 or the script fails completely.

 

Hope this helps until a better fix arrives.

 

Paul

 

local RedList = coalition.getGroups(2, nil) -- gets most recent grouplist

local BlueList = coalition.getGroups(2, nil)

 

Paul, I have by-passed the issue of the coalition in this way:

 

line 763 if groupside == 2 then becomes if groupside == 0 then

 

line 786 if groupside == 1 then becomes if groupside == 0 then

 

This works well in my red side missions. I can drop-off the troops (using CTTS) and they are always visible in DCSW. Please, try this changes for blu side, and report. Thanks.

 

antonio.

Posted
Paul, I have by-passed the issue of the coalition in this way:

 

line 763 if groupside == 2 then becomes if groupside == 0 then

 

line 786 if groupside == 1 then becomes if groupside == 0 then

 

This works well in my red side missions. I can drop-off the troops (using CTTS) and they are always visible in DCSW. Please, try this changes for blu side, and report. Thanks.

 

antonio.

 

@Antonio -- Your fix worked better than mine. Thanks.

 

Paul

Posted

After getting used to the Huey and CTTS playing nice together, it was a shame to have such issues with it after the DCS v1.2.12 updates rolled out.

 

My assumptions: 1) CTTS was meant for troop transport and logistics scripting (things on the ground), 2) dropped troops should head towards any enemy troops nearby, not just the first unit (leader), and 3) "nearest enemy" should mean just that

 

My modifications: FindNearestEnemy() in CTTS.lua (v1.04)

 

As Grimes mentioned (http://forums.eagle.ru/showpost.php?p=2257672&postcount=5), coalition.getGroups() will now return all groups/units dead and alive. My first change was to narrow down the returned groups to ground units only as ENO suggested here (http://forums.eagle.ru/showpost.php?p=2058688&postcount=10):

 

local RedList = coalition.getGroups(1, Group.Category.GROUND)
local BlueList = coalition.getGroups(2, Group.Category.GROUND)

My next change was to loop through the returned units array and check for the first one that has life, rather than always using the first index:

 

for x = 1, #units do
if units[x]:getLife() > 0 then
 leader = units[x]
 break
end
end

I then added a check to ensure that we have a valid "leader":

 

if leader ~= nil then

I found that it now skips the dead units and returns the coordinates to the first unit that has health for the group (it was actually the leader:getPoint() call that was throwing the error).

 

I also changed the logic to use the actual nearest enemy:

 

if dist < minDist then
minDist = dist
EnemyPos = leaderpos
end

I have attached the method snippet in case anyone wants to see the full LUA code for themselves.

 

This is my attempt at fixing my SP game, and in no way take credit for CTTS. I have sent a PM to geloxo and he may decide upon future updates for CTTS.

 

Please let me know if you see other issues in your SP games using CTTS. I have not done nearly enough flying lately to test every scenario, but this should get us visibly moving troops again!

FindNearestEnemy.lua

  • Like 2
Posted (edited)

@Chump -- Thank you very much for taking time to dig into this so thoroughly. I am anxious to try and apply your changes. Getting the dropped troops to head towards enemy troops will be a huge fix for my own little mission that I am scripting. I got around this by simply dropping troops smack in front of the enemy and letting them duke it out immediately.

 

I'm not sure yet, but I believe a fire suppression script that's out there is broken as well. When I try to use it (SuppressionFireScript.lua), DCS stops running and an error message comes up relating to a different script that stops working. I need to look into this further, but simply not using the fire suppression script resolves the issue.

 

Thanks again,

Paul

Edited by pdmarsh
Posted

Thanks again Chump. Your script works perfectly and, if I may say so, better than the original. The dropped troops now move much more reliably toward the enemy troops in the area. Before it seemed as if they were confused as to where to go.

 

Paul

Posted

Before my change, the RedListPos/BlueListPos arrays would get populated with each "leader" unit found, then randomly selected from so it might not actually be the closes unit to the group. I went ahead and implemented the finishing touches on the bubble sort, as this (I think) was the authors intent.

 

- Chris

  • Like 1
Posted
Before my change, the RedListPos/BlueListPos arrays would get populated with each "leader" unit found, then randomly selected from so it might not actually be the closes unit to the group. I went ahead and implemented the finishing touches on the bubble sort, as this (I think) was the authors intent.

 

- Chris

 

Chris, I ask again for your help. I regularly use CTTS and MEDEVAC scripts in the same mission. Now CTTS works really well (thanks again), while with MEDEVAC script I have some problems, because it activates the red smoke signal near of the damaged vehicle, for the recovery of the injured even if they are already dead. Not bad, a low pass to check and I step over. But I remember that before the red smoke signal was activated only if there were wounded to recover and not of the dead. Can you help me and inspect the script MEDEVAC? Thanks in advance.

antonio.

 

http://forums.eagle.ru/showthread.php?t=107303

Posted

joker62, I had a chance to look into this tonight. If I'm understanding you correctly, you want the smoke marker to disappear when the unit/group to medevac is dead? Remember, popping smoke in this game doesn't necessarily mean that the wounded will be alive long enough for the grenade filler to burn completely! There is no "stop" command to counter tigger.action.smoke() because it will burn (for darn right at 5 minutes by my test mission and this: http://forums.eagle.ru/showthread.php?t=111850, not sure if that is the smokeLifeC=5 in FireVehicle.lua) until depleted.

Posted
joker62, I had a chance to look into this tonight. If I'm understanding you correctly, you want the smoke marker to disappear when the unit/group to medevac is dead? Remember, popping smoke in this game doesn't necessarily mean that the wounded will be alive long enough for the grenade filler to burn completely! There is no "stop" command to counter tigger.action.smoke() because it will burn (for darn right at 5 minutes by my test mission and this: http://forums.eagle.ru/showthread.php?t=111850, not sure if that is the smokeLifeC=5 in FireVehicle.lua) until depleted.

Chris, thank you very much for quick response, you have been very kind. I'll give a look.

antonio.

  • 1 month later...
  • Recently Browsing   0 members

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