From d271428f9d3bd2a8eee29b24f473743338f2aba6 Mon Sep 17 00:00:00 2001 From: MetalStormGhost Date: Wed, 20 Sep 2023 00:23:12 +0300 Subject: [PATCH] Implemented ground power trucks for ground spawns. Added settings to turn them off or on. --- game/missiongenerator/tgogenerator.py | 29 ++++++++++++++++++++++++--- game/settings/settings.py | 18 +++++++++++++++++ 2 files changed, 44 insertions(+), 3 deletions(-) diff --git a/game/missiongenerator/tgogenerator.py b/game/missiongenerator/tgogenerator.py index 326a1ded..7d69d863 100644 --- a/game/missiongenerator/tgogenerator.py +++ b/game/missiongenerator/tgogenerator.py @@ -913,10 +913,8 @@ class GroundSpawnRoadbaseGenerator: self.ground_spawns_roadbase.append((sg, ground_spawn[1])) - # tanker_type: Type[VehicleType] - # ammo_truck_type: Type[VehicleType] - tanker_type, ammo_truck_type = farp_truck_types_for_country(country.id) + power_truck_type = Unarmed.Ural_4320_APA_5D # Generate ammo truck/farp and fuel truck/stack for each pad if self.game.settings.ground_start_trucks_roadbase: @@ -961,6 +959,18 @@ class GroundSpawnRoadbaseGenerator: ).point_from_heading(ground_spawn[0].heading.degrees + 180, 10), heading=pad.heading + 180, ) + if self.game.settings.ground_start_ground_power_trucks_roadbase: + self.m.vehicle_group( + country=country, + name=(name + "_power"), + _type=power_truck_type, + position=pad.position.point_from_heading( + ground_spawn[0].heading.degrees + 90, 35 + ).point_from_heading(ground_spawn[0].heading.degrees + 180, 20), + group_size=1, + heading=pad.heading + 315, + move_formation=PointAction.OffRoad, + ) def generate(self) -> None: try: @@ -1020,6 +1030,7 @@ class GroundSpawnGenerator: # ammo_truck_type: Type[VehicleType] tanker_type, ammo_truck_type = farp_truck_types_for_country(country.id) + power_truck_type = Unarmed.Ural_4320_APA_5D # Generate a FARP Ammo and Fuel stack for each pad if self.game.settings.ground_start_trucks: @@ -1064,6 +1075,18 @@ class GroundSpawnGenerator: ), heading=pad.heading + 270, ) + if self.game.settings.ground_start_ground_power_trucks: + self.m.vehicle_group( + country=country, + name=(name + "_power"), + _type=power_truck_type, + position=pad.position.point_from_heading( + vtol_pad[0].heading.degrees - 185, 35 + ), + group_size=1, + heading=pad.heading + 45, + move_formation=PointAction.OffRoad, + ) def generate(self) -> None: try: diff --git a/game/settings/settings.py b/game/settings/settings.py index 6d0ba745..91321384 100644 --- a/game/settings/settings.py +++ b/game/settings/settings.py @@ -768,6 +768,24 @@ class Settings: default=False, detail=("Might have a negative performance impact."), ) + ground_start_ground_power_trucks: bool = boolean_option( + "Spawn ground power trucks at ground starts in airbases", + MISSION_GENERATOR_PAGE, + GAMEPLAY_SECTION, + default=True, + detail=( + "Needed to cold-start some aircraft types. Might have a performance impact." + ), + ) + ground_start_ground_power_trucks_roadbase: bool = boolean_option( + "Spawn ground power trucks at ground starts in roadbases", + MISSION_GENERATOR_PAGE, + GAMEPLAY_SECTION, + default=True, + detail=( + "Needed to cold-start some aircraft types. Might have a performance impact." + ), + ) # Performance perf_smoke_gen: bool = boolean_option(