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.
Added ability to drop "Sets" from 2 and up will be sets, else it will be like before.
Changed _PackCratesNearby to handle all cargo within the range instead of the nearest.
Fixed a bug.
When dropping crates, while choosing "Drop and build" The first drop will put the crate into a crate that can be loaded but a second later, that crate will be cleaned up due to build. This makes sure that the crates are not in the "load crates" list.
Changed the naming from Get only to Get
and the order is Get, Get and load
Instead of Get and load, and Get only.
Changed the order on Pack and load, Pack and remove, pack only to
Pack, Pack and load, Pack and remove.
Same goes for Drop and build, Drop only to Drop, Drop and build.
It purely subjective what one would like, so I leave it up to you. If you like it this way or the first version, you decide, then disregard this change.