ciribob/DCS-CTLD

Unload / Extract Troops not working for consecutive pickups.

Closed this issue · 4 comments

In the "Troop Transport" menu, I click "Unload / Extract Troops", and it works fine to extract Group1. However, if I head to Group2 for pickup before dropping off Group1 in a dropoff zone, it doesn't work properly. Group2 is in a defined pickup zone, and there is not dropoff zone nearby. When I land next to Group2 and click "Unload / Extract Troops", I get a message saying "Dropped troops back to base" (but Group1 never spawns outside the helo), and Group2 does not get in the helo. Now if I do it again, Group2 does in fact hop in. Group1 is in the helo the whole time (even though it said they were unloaded), because when I head back to the dropoff zone and unload them, it works and I see them spawn.

A 2nd but similar issue is with the AI helos. I can send the helo to land in a pickup zone and Group1 automatically hops in, but if I send the helo to Group2 next, Group2 will not hop in. If I then send the helo back to a dropoff zone, Group1 will automatically hop out, and then upon returning back to Group2, they will hop on the helo as soon as it lands.

In addition, once I have loaded two groups into the helo and I return back to base where the dropoff zone is defined, I then unload them but only one group gets out (Group2). If you check cargo, you'll see two troops are still onboard, and if you unload them, Group2 disappears and another Group2 is spawned outside the helo. Group1 is lost, nowhere to be found.

What I consider "broken" is the ability to do multiple pickups before doing a dropoff. Thanks!

Hi GtfreeFlyer.. I saw your issue here and i'm willing to help, as you described the first point is not an issue is how ctld works.. the pickupzone only is needed for ai or when there are no troops already spawned.. so in the second group without a pickup zone you will get a "you already have troops on board" message.. let me know if you need help still with the rest

Thanks. Actually, I have been reworking the code to allow what I need. As of last night I now have it working but need to fix one thing. It currently allows me to take unlimited troops in the Helo, which is fun, but still needs to be fixed :)

I changed the _onboard table, such that it is now _onboard = {details, details, details,... }. It is a list, rather than table with keys. It was originally _onboard = {troops = nil, vehicles =nil}, where nil would get replaced with the details of the group that was picked up. This table format allows for only one group’s info to be stored.

Of course, elsewhere in the code wherever it calls _onboard, I have also changed the code so that it works with the new format of the table.

I hope to eventually merge my changes into the main code and then create a pull request. However right now I have mostly modified the code specific for my mission, therefore I’m a long way from the pull request. I have been commenting on each and every line that I have changed or added, to make it easier to implement into the main chunk once the pull request is submitted.

I can always send you what I have if you’d like to look through it and start to implement the changes ahead of time. I think allowing for multiple group pickups would be a great new addition for CTLD.

You can find me here, ED Forums, or in Discord.

Cheers!
-GTFreeFlyer-

A heli has a limited space, don't see a reason to pick up unlimited troops.. if you want to achieve for example if max is 8 and pick up 2 groups of 4 i'd agree but not unlimited..