### Summary
- Added an optional CTLD group locale resolver for group-targeted menus and messages.
- Routed CTLD group menu/message localization through group-aware lookup while preserving `self.locale` as the default fallback.
- Added an optional cargo display formatter with group context for missions that need custom cargo labels.
- Added `MENU_CRATE_SINGLE` localization so single-crate menu labels use the localization table, matching multi-crate labels.
### Compatibility
Default behavior is unchanged unless a mission calls `SetGroupLocaleResolver` or `SetCargoDisplayFormatter`.
### Motivation
This allows missions with per-player or per-group language settings to localize CTLD menus and group messages without changing the global CTLD locale, This can be used to persist localization choice using the player name.
- **Changed** the pack menu layout so pack actions now open into dedicated `Pack`, `Pack and Load`, and `Pack and Remove` submenus.
- **Added** scanning for nearby packable units within each pack submenu.
- **Added** direct selection of individual nearby packable units from the pack menus.
- **Changed** the pack menu order so detected nearby units appear first, followed by the nearby bulk action and the scan action.
- **Added** nearby bulk actions in each pack submenu (`Pack nearby`, `Pack and Load nearby`, `Pack and Remove nearby`).
- **Changed** pack menu refresh behavior so nearby packable units are rebuilt after major logistics actions and after build completion.
- **Fixed** selected `Pack and Load` so it only loads the crates created by the chosen packed unit.
- **Fixed** selected `Pack and Remove` so it only removes the crates created by the chosen packed unit.
- **Changed** pre-pack event handling so before-pack callbacks receive the specific group being packed.
- **Added** localization for the new pack menu wording in English, German, French, and Spanish.
Fixed nil when unitVec2=unitcoord:GetVec2() returns nil.
Removed " self.UseC130LoadAndUnload and " when blocking the build if the cargo is inside the frame. Now it will block the build with or without UseC130LoadAndUnload set to true.
Removed C-130 from the Messaging Unloaded by ground crew.
Scheduler for batch building is now 0 to make each set build it's own with it's engineer. He will despawn after 30 seconds after build.
Shorter message for C-130 airdrop buildstarted.
- Added C-130 DynamicCargo auto-build adapter inside CTLD core.
- New CTLD options:
- `UseC130DynamicCargoAutoBuild = false` (default off)
- `C130DynamicCargoAutoBuildMergeSeconds = 10`
- Hooked C-130 set registration into CTLD `Get Crates` flow (buildable cargo only: `VEHICLE` / `FOB`).
- Added CTLD internal set/entry tracking for C-130 crates:
- map crate spawn -> dynamic cargo loaded/unloaded -> landed.
- Wired DynamicCargo event handling in CTLD:
- on loaded: map to the correct CTLD set entry.
- on unloaded: mark landed and create/rebind CTLD cargo proxy for build handoff.
- on removed before landed: mark set failed and clean it.
- Added set completion logic:
- build starts only when all crates in set are landed.
- helper infantry is spawned and CTLD engineer build path is used.
- Added merge window batching by owner:
- close drops from same C-130 can be processed together (one handoff window).
- Added scoped filtering in `_BuildCrates` for this path:
- prevents counting unrelated nearby crates during engineer auto-build.
- Added cleanup paths for completed/failed/stale sets and stop lifecycle cleanup.
- Added/updated docs in section `2.2` for:
- what the feature does,
- required settings,
- usage example,
- and the important note that this applies to CTLD `Get Crates` cargo (not C-130 Loadsheet cargo).
**Behavior note**
- Default behavior is unchanged unless `UseC130DynamicCargoAutoBuild` is enabled.
Added: function CTLD:AddStaticsCargoFromType(Name,TypeName,Mass,Stock,SubCategory,DontShowInMenu,Location,UnitTypes,Category,ShapeName,ResourceMap,DisplayName)
Added: function CTLD:CanGetTroops, this is a final check for outside hooks, if player have conditions.
Reworked cargo placement in the case of none ship.
Cargo will be placed and sizes are depended on the cargo type, this can be further tweaked under the function GetCrates. This is applied to all types of cargo and all type of units.
Removed "Get" from the menu if the UseC130LoadAndUnload is true, player choose now the amount of cargo, then they will spawn. Same is for the Chinook if GCLoading is enabled.
Increased the UH-60L_DAP crate limit to 2 and the weight limit to 3500.
C130basetype is now independent of UseC130LoadAndUnload true / false. It will always be cds_crate for the C-130, and players can change it to whatever.
Fixed bugs for load troops.
Added Mi-8 to the prevention method for ignoring what is inside when trying to build crates.
Removed return self if the player is trying to build stuff that is outside the helicopter or C-130, while he still have stuff inside. Cargo will be built but it will ignore what is inside.
Removed the menu "Others" if there is no sub category involved for that type. If user have crates subcat but not troops subcat, it won't show "others".
noticed a bug, I could load troops outside the zone when choosing amount. I could also load without the door was even checked.
Combined the troop drop to one message instead of multiple messages for each dropped group.
Fixed so the Engineer can remove all the items when he is building from an airdrop.
Added a function that I use, CanGetCrates, it's a check before getting it if the conditions are met.
Added small fixes where calling FindCratesNearBy would remove the units when it's called by the function RemoveCratesNearBy when it was checking the surroundings and it should ignore what is inside. In the case of C-130 and the CH-47.
Added how many crates are dropped when getting statics.
Expanded OnAfterTroopsRTB to accept chunk, ie the number of units which is returned.
Fixed a bug where units could still get items all though not in load zone.
Added CanGetCrates, it's a function where user can hook custom conditions.
Added CanGetUnits, same as the above.
Added CanBuildCrates, same as the first one.
Added:
OnAfrerGetCrates, Only triggers when player uses "Get"
Added:
OnAfterRemoveCratedNearBy, Only triggers when player actively uses Remove crates near by or remove units near by.
Added:
Partial load. currently, if a player land 3 crates (Farp) and want to partially load another farp, even though it can not fit, some want to load partially, this allows for it.
Player will be able to see what actually fits in the menu, but if they want, they can open the menu again, select the item, then it will say "Get" "Crates limit reached" and "Partially load"
Added:
AddStaticsCargo can now accept a last parms, UnitType, this parm will make the cargo only visible in the menu to that passed unitType.
Removed Get and Load from CH-47 for the statics if enableChinookGCLoading is enabled. This will make it less confusing, as it didn't allow players do load anything except Ground crew for statics.
Added
* UseC130LoadAndUnload toggle, false by default.
* C130basetype = "cds_crate" -- only for the C-130
* Extended AddCratesCargo & AddCratesCargoNoMove with another parms where we can force Typename for the static for the C-130, even though a parms passed before it with another shape. the last parms will still be forced only if the unit is C-130J. else, the last parms will not be used.
Example usage:
Foothold_ctld:AddCratesCargo("FARP",{"CTLD_TROOP_FOB"},CTLD_CARGO.Enum.FOB,3,1500,10, "FARP",nil,nil,nil,"Cargos","ammo_cargo",nil, "cds_crate")
Blocked the build of crates if still inside C-130J and CH-47F using 15 Meters for the C-130 and 5 meters for the CH-47.
ListCargo will now display what's inside besed on _GetUnitCapabilities / 2
** Manage Units, New menu only for the C-130J.
* New menu under CTLD. Get Units, Remove units nearby.
* Addunits function.
function CTLD:AddUnits(Name,Templates,Type,Stock,SubCategory,UnitTypes)
Example usage.
Foothold_ctld:AddUnits("Humvee",{"CTLD_CARGO_HMMWV"},CTLD_CARGO.Enum.VEHICLE,10, "ANTI TANK")
Those will be placed on a safe distance using same method as crates based on length and (idx-1)*2.5 + length.
* Added FSM, OnAfterUnitsSpawn. No internal, only Hook.
* Added 3 functions,
AddStockUnits
SetStockUnits
GetStockUnits
Added documents.