Implemented a list of units which will be removed from Pretense ground assault groups due to pathfinding problems. The units will just remain still instead of advancing. Also added one tank to each group and increased the maximum size of the groups to 5. Removed artillery units from the groups, similarly due to pathfinding problems.

This commit is contained in:
MetalStormGhost 2023-10-03 13:56:43 +03:00
parent cf9538f7df
commit 39c80cb974

View File

@ -91,7 +91,11 @@ if TYPE_CHECKING:
FARP_FRONTLINE_DISTANCE = 10000
AA_CP_MIN_DISTANCE = 40000
PRETENSE_GROUND_UNIT_GROUP_SIZE = 4
PRETENSE_GROUND_UNIT_GROUP_SIZE = 5
PRETENSE_GROUND_UNITS_TO_REMOVE_FROM_ASSAULT = [
vehicles.Armor.Stug_III,
vehicles.Artillery.Grad_URAL,
]
class PretenseGroundObjectGenerator(GroundObjectGenerator):
@ -131,6 +135,12 @@ class PretenseGroundObjectGenerator(GroundObjectGenerator):
)
of_class = list({u for u in faction_units if u.unit_class is unit_class})
# Remove units from list with known pathfinding issues in Pretense missions
for unit_to_remove in PRETENSE_GROUND_UNITS_TO_REMOVE_FROM_ASSAULT:
for groundunittype_to_remove in GroundUnitType.for_dcs_type(unit_to_remove):
if groundunittype_to_remove in of_class:
of_class.remove(groundunittype_to_remove)
if len(of_class) > 0:
return random.choice(of_class)
else:
@ -200,6 +210,14 @@ class PretenseGroundObjectGenerator(GroundObjectGenerator):
group_name = f"{cp_name_trimmed}-{group_role}-{group.id}"
group.name = group_name
self.generate_ground_unit_of_class(
UnitClass.TANK,
group,
vehicle_units,
cp_name_trimmed,
group_role,
PRETENSE_GROUND_UNIT_GROUP_SIZE - 4,
)
self.generate_ground_unit_of_class(
UnitClass.TANK,
group,
@ -232,14 +250,6 @@ class PretenseGroundObjectGenerator(GroundObjectGenerator):
group_role,
PRETENSE_GROUND_UNIT_GROUP_SIZE,
)
self.generate_ground_unit_of_class(
UnitClass.ARTILLERY,
group,
vehicle_units,
cp_name_trimmed,
group_role,
PRETENSE_GROUND_UNIT_GROUP_SIZE,
)
self.generate_ground_unit_of_class(
UnitClass.RECON,
group,