mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Update Anti Air and Naval Layouts
- Break down the remaining Anti Air Layouts. Now each layout.miz only contains 1 layout - Added a python script which can fix the orientation of a layout - Fix layout orientation. Now all aa layouts are oriented to the north. - Add small change so that whole carrier group will be rotated correctly with the BRC closes #2215
This commit is contained in:
parent
7acc418489
commit
f20d0effe9
13
.vscode/launch.json
vendored
13
.vscode/launch.json
vendored
@ -51,6 +51,17 @@
|
||||
"PYTHONPATH": ".;./pydcs"
|
||||
},
|
||||
"preLaunchTask": "Prepare Environment"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Fix Layout orientation",
|
||||
"type": "python",
|
||||
"request": "launch",
|
||||
"program": "resources\\tools\\fix_layout_orientation.py",
|
||||
"console": "integratedTerminal",
|
||||
"env": {
|
||||
"PYTHONPATH": ".;./pydcs"
|
||||
},
|
||||
"args": ["resources/layouts/anti_air/S-300_Site.miz"]
|
||||
},
|
||||
]
|
||||
}
|
||||
@ -417,7 +417,8 @@ class GenericCarrierGenerator(GroundObjectGenerator):
|
||||
if self.game.theater.is_in_sea(point):
|
||||
group.points[0].speed = carrier_speed.meters_per_second
|
||||
group.add_waypoint(point, carrier_speed.kph)
|
||||
return brc
|
||||
# Rotate the whole ground object to the new course
|
||||
self.ground_object.rotate(brc)
|
||||
return None
|
||||
|
||||
def tacan_callsign(self) -> str:
|
||||
|
||||
@ -6,4 +6,4 @@ units:
|
||||
- SAM NASAMS SR MPQ64F1
|
||||
- SAM NASAMS LN AIM-120B
|
||||
layouts:
|
||||
- NASAMS Site
|
||||
- 4 Launcher Circle
|
||||
@ -6,4 +6,4 @@ units:
|
||||
- SAM NASAMS SR MPQ64F1
|
||||
- SAM NASAMS LN AIM-120C
|
||||
layouts:
|
||||
- NASAMS Site
|
||||
- 4 Launcher Circle
|
||||
@ -6,4 +6,4 @@ units:
|
||||
- SAM SA-11 Buk "Gadfly" C2
|
||||
- SAM SA-17 Buk M1-2 LN 9A310M1-2
|
||||
layouts:
|
||||
- SA-17 Grizzly Battery
|
||||
- 4 Launcher Site
|
||||
@ -5,4 +5,4 @@ units:
|
||||
- SAM SA-6 Kub "Straight Flush" STR
|
||||
- SAM SA-6 Kub "Gainful" TEL
|
||||
layouts:
|
||||
- SA-6 Kub Site
|
||||
- 4 Launcher Circle
|
||||
BIN
resources/layouts/anti_air/4_Launcher_Circle.miz
Normal file
BIN
resources/layouts/anti_air/4_Launcher_Circle.miz
Normal file
Binary file not shown.
32
resources/layouts/anti_air/4_Launcher_Circle.yaml
Normal file
32
resources/layouts/anti_air/4_Launcher_Circle.yaml
Normal file
@ -0,0 +1,32 @@
|
||||
name: 4 Launcher Circle
|
||||
tasks:
|
||||
- SHORAD
|
||||
- MERAD
|
||||
groups:
|
||||
- SAM:
|
||||
- name: Search Radar
|
||||
unit_count:
|
||||
- 1
|
||||
unit_classes:
|
||||
- SearchRadar
|
||||
- SearchTrackRadar
|
||||
- name: Command Post
|
||||
optional: true
|
||||
fill: false # Do not fill with faction possible units
|
||||
unit_count:
|
||||
- 1
|
||||
unit_classes:
|
||||
- CommandPost
|
||||
- name: Launcher
|
||||
unit_count:
|
||||
- 4
|
||||
unit_classes:
|
||||
- Launcher
|
||||
- TELAR
|
||||
- name: Logistics
|
||||
optional: true
|
||||
unit_count:
|
||||
- 1
|
||||
- 2
|
||||
unit_classes:
|
||||
- Logistics
|
||||
Binary file not shown.
@ -1,21 +0,0 @@
|
||||
name: AAA Mobile
|
||||
description: A standard AAA template
|
||||
generic: true # This Layout will be used to generate ForceGroups
|
||||
tasks:
|
||||
- AAA
|
||||
groups:
|
||||
- AAA: # Group Name
|
||||
- name: AAA Mobile 0 # Sub group which will be merged into the group
|
||||
unit_count:
|
||||
- 2
|
||||
- 6
|
||||
unit_classes:
|
||||
- AAA
|
||||
- name: AAA Mobile 1 # Sub group which will be merged into the group
|
||||
optional: true
|
||||
unit_count:
|
||||
- 1
|
||||
- 2
|
||||
unit_classes:
|
||||
- Logistics
|
||||
layout_file: resources/layouts/anti_air/AAA.miz
|
||||
@ -5,22 +5,22 @@ tasks:
|
||||
- AAA
|
||||
groups:
|
||||
- AAA:
|
||||
- name: AAA Radar Site 0
|
||||
- name: AAA Site Radar
|
||||
unit_count:
|
||||
- 1
|
||||
unit_classes:
|
||||
- SearchRadar
|
||||
- name: AAA Radar Site 1
|
||||
- name: AAA Site
|
||||
unit_count:
|
||||
- 2
|
||||
- 6
|
||||
unit_classes:
|
||||
- AAA
|
||||
- name: AAA Radar Site 2
|
||||
- name: AAA Site Logistics
|
||||
optional: true
|
||||
unit_count:
|
||||
- 1
|
||||
- 2
|
||||
unit_classes:
|
||||
- Logistics
|
||||
layout_file: resources/layouts/anti_air/AAA.miz
|
||||
layout_file: resources/layouts/anti_air/AAA_Site.miz
|
||||
BIN
resources/layouts/anti_air/AAA_Site.miz
Normal file
BIN
resources/layouts/anti_air/AAA_Site.miz
Normal file
Binary file not shown.
@ -5,17 +5,16 @@ tasks:
|
||||
- AAA
|
||||
groups:
|
||||
- AAA:
|
||||
- name: AAA Site 0
|
||||
- name: AAA Site
|
||||
unit_count:
|
||||
- 2
|
||||
- 6
|
||||
unit_classes:
|
||||
- AAA
|
||||
- name: AAA Site 1
|
||||
- name: AAA Site Logistics
|
||||
optional: true
|
||||
unit_count:
|
||||
- 1
|
||||
- 2
|
||||
unit_classes:
|
||||
- Logistics
|
||||
layout_file: resources/layouts/anti_air/AAA.miz
|
||||
BIN
resources/layouts/anti_air/Cold_War_Flak_Site.miz
Normal file
BIN
resources/layouts/anti_air/Cold_War_Flak_Site.miz
Normal file
Binary file not shown.
@ -34,4 +34,3 @@ groups:
|
||||
- 2
|
||||
unit_classes:
|
||||
- Logistics
|
||||
layout_file: resources/layouts/anti_air/flak.miz
|
||||
|
||||
BIN
resources/layouts/anti_air/Early-Warning_Radar.miz
Normal file
BIN
resources/layouts/anti_air/Early-Warning_Radar.miz
Normal file
Binary file not shown.
@ -12,4 +12,3 @@ groups:
|
||||
fallback_classes:
|
||||
- SearchRadar
|
||||
- SearchTrackRadar
|
||||
layout_file: resources/layouts/anti_air/legacy_ground_templates.miz
|
||||
|
||||
BIN
resources/layouts/anti_air/Flak_Site.miz
Normal file
BIN
resources/layouts/anti_air/Flak_Site.miz
Normal file
Binary file not shown.
@ -48,4 +48,3 @@ groups:
|
||||
- 4
|
||||
unit_types:
|
||||
- Blitz_36-6700A
|
||||
layout_file: resources/layouts/anti_air/legacy_ground_templates.miz
|
||||
|
||||
BIN
resources/layouts/anti_air/Freya_EWR_Site.miz
Normal file
BIN
resources/layouts/anti_air/Freya_EWR_Site.miz
Normal file
Binary file not shown.
@ -48,4 +48,3 @@ groups:
|
||||
- 3
|
||||
unit_types:
|
||||
- soldier_mauser98
|
||||
layout_file: resources/layouts/anti_air/legacy_ground_templates.miz
|
||||
|
||||
Binary file not shown.
@ -1,21 +0,0 @@
|
||||
name: NASAMS Site
|
||||
tasks:
|
||||
- MERAD
|
||||
groups:
|
||||
- NASAMS:
|
||||
- name: SR
|
||||
unit_count:
|
||||
- 1
|
||||
unit_types:
|
||||
- NASAMS_Radar_MPQ64F1
|
||||
- name: CC
|
||||
unit_count:
|
||||
- 1
|
||||
unit_types:
|
||||
- NASAMS_Command_Post
|
||||
- name: LN
|
||||
unit_count:
|
||||
- 4
|
||||
unit_types:
|
||||
- NASAMS_LN_B
|
||||
- NASAMS_LN_C
|
||||
BIN
resources/layouts/anti_air/Patriot_Battery.miz
Normal file
BIN
resources/layouts/anti_air/Patriot_Battery.miz
Normal file
Binary file not shown.
@ -49,4 +49,3 @@ groups:
|
||||
- 2
|
||||
unit_classes:
|
||||
- SHORAD
|
||||
layout_file: resources/layouts/anti_air/legacy_ground_templates.miz
|
||||
|
||||
Binary file not shown.
@ -1,21 +0,0 @@
|
||||
name: SA-17 Grizzly Battery
|
||||
tasks:
|
||||
- MERAD
|
||||
groups:
|
||||
- SA-17:
|
||||
- name: SA-17 Grizzly Battery 0
|
||||
unit_count:
|
||||
- 1
|
||||
unit_types:
|
||||
- SA-11 Buk SR 9S18M1
|
||||
- name: SA-17 Grizzly Battery 1
|
||||
unit_count:
|
||||
- 1
|
||||
unit_types:
|
||||
- SA-11 Buk CC 9S470M1
|
||||
- name: SA-17 Grizzly Battery 2
|
||||
unit_count:
|
||||
- 3
|
||||
unit_types:
|
||||
- SA-17 Buk M1-2 LN 9A310M1-2
|
||||
layout_file: resources/layouts/anti_air/legacy_ground_templates.miz
|
||||
BIN
resources/layouts/anti_air/SA-5_S-200_Site.miz
Normal file
BIN
resources/layouts/anti_air/SA-5_S-200_Site.miz
Normal file
Binary file not shown.
@ -24,4 +24,3 @@ groups:
|
||||
- 6
|
||||
unit_types:
|
||||
- S-200_Launcher
|
||||
layout_file: resources/layouts/anti_air/legacy_ground_templates.miz
|
||||
|
||||
@ -1,16 +0,0 @@
|
||||
name: SA-6 Kub Site
|
||||
tasks:
|
||||
- MERAD
|
||||
groups:
|
||||
- SA-6:
|
||||
- name: SA-6 Kub Site 0
|
||||
unit_count:
|
||||
- 1
|
||||
unit_types:
|
||||
- Kub 1S91 str
|
||||
- name: SA-6 Kub Site 1
|
||||
unit_count:
|
||||
- 4
|
||||
unit_types:
|
||||
- Kub 2P25 ln
|
||||
layout_file: resources/layouts/anti_air/legacy_ground_templates.miz
|
||||
BIN
resources/layouts/anti_air/WW2_Ally_Flak_Site.miz
Normal file
BIN
resources/layouts/anti_air/WW2_Ally_Flak_Site.miz
Normal file
Binary file not shown.
@ -38,4 +38,3 @@ groups:
|
||||
- 1
|
||||
unit_types:
|
||||
- Bedford_MWD
|
||||
layout_file: resources/layouts/anti_air/legacy_ground_templates.miz
|
||||
|
||||
BIN
resources/layouts/anti_air/WW2_Flak_Site.miz
Normal file
BIN
resources/layouts/anti_air/WW2_Flak_Site.miz
Normal file
Binary file not shown.
@ -13,4 +13,3 @@ groups:
|
||||
- 1
|
||||
unit_types:
|
||||
- Blitz_36-6700A
|
||||
layout_file: resources/layouts/anti_air/legacy_ground_templates.miz
|
||||
|
||||
Binary file not shown.
Binary file not shown.
BIN
resources/layouts/naval/Carrier_Group.miz
Normal file
BIN
resources/layouts/naval/Carrier_Group.miz
Normal file
Binary file not shown.
@ -15,4 +15,3 @@ groups:
|
||||
- 4
|
||||
unit_classes:
|
||||
- Destroyer
|
||||
layout_file: resources/layouts/naval/legacy_naval_templates.miz
|
||||
|
||||
BIN
resources/layouts/naval/Carrier_Strike_Group_8.miz
Normal file
BIN
resources/layouts/naval/Carrier_Strike_Group_8.miz
Normal file
Binary file not shown.
@ -20,4 +20,3 @@ groups:
|
||||
- 1
|
||||
unit_types:
|
||||
- TICONDEROG
|
||||
layout_file: resources/layouts/naval/legacy_naval_templates.miz
|
||||
|
||||
BIN
resources/layouts/naval/LHA_Group.miz
Normal file
BIN
resources/layouts/naval/LHA_Group.miz
Normal file
Binary file not shown.
@ -15,4 +15,3 @@ groups:
|
||||
- 2
|
||||
unit_classes:
|
||||
- Destroyer
|
||||
layout_file: resources/layouts/naval/legacy_naval_templates.miz
|
||||
|
||||
BIN
resources/layouts/naval/Naval-Group.miz
Normal file
BIN
resources/layouts/naval/Naval-Group.miz
Normal file
Binary file not shown.
@ -20,4 +20,3 @@ groups:
|
||||
- 1
|
||||
unit_classes:
|
||||
- Cruiser
|
||||
layout_file: resources/layouts/naval/naval.miz
|
||||
|
||||
BIN
resources/layouts/naval/Naval-Two-Ship.miz
Normal file
BIN
resources/layouts/naval/Naval-Two-Ship.miz
Normal file
Binary file not shown.
@ -14,4 +14,3 @@ groups:
|
||||
- Boat
|
||||
- Submarine
|
||||
- LandingShip
|
||||
layout_file: resources/layouts/naval/naval.miz
|
||||
|
||||
BIN
resources/layouts/naval/WW2-LST.miz
Normal file
BIN
resources/layouts/naval/WW2-LST.miz
Normal file
Binary file not shown.
@ -14,4 +14,3 @@ groups:
|
||||
- 3
|
||||
unit_types:
|
||||
- LST_Mk2
|
||||
layout_file: resources/layouts/naval/legacy_naval_templates.miz
|
||||
|
||||
Binary file not shown.
Binary file not shown.
63
resources/tools/fix_layout_orientation.py
Normal file
63
resources/tools/fix_layout_orientation.py
Normal file
@ -0,0 +1,63 @@
|
||||
# Script to update a layout.miz which is not created with an orientation of Heading=0
|
||||
# It loads the miz as and reorientates all objects
|
||||
|
||||
|
||||
# Requirement: Only ONE Group has to be within the miz file.
|
||||
# Load miz
|
||||
# Determine Center and current heading (use first unit for that)
|
||||
# Rotate everything around the center with the difference to heading 0
|
||||
# Save the miz
|
||||
|
||||
import argparse
|
||||
import itertools
|
||||
from typing import Any
|
||||
|
||||
import dcs
|
||||
|
||||
from game.point_with_heading import PointWithHeading
|
||||
from game.utils import Heading
|
||||
|
||||
|
||||
def fix_orientation(miz_file: str) -> None:
|
||||
mission = dcs.Mission()
|
||||
mission.load_file(miz_file)
|
||||
groups = []
|
||||
# Load all units from the miz
|
||||
for country in itertools.chain(
|
||||
mission.coalition["red"].countries.values(),
|
||||
mission.coalition["blue"].countries.values(),
|
||||
):
|
||||
for dcs_group in itertools.chain(
|
||||
mission.country(country.name).vehicle_group,
|
||||
mission.country(country.name).ship_group,
|
||||
mission.country(country.name).static_group,
|
||||
):
|
||||
groups.append(dcs_group)
|
||||
|
||||
# Get the center which will be used as origin for the rotation
|
||||
center_unit = groups[0].units[0]
|
||||
|
||||
# Calculate the rotation
|
||||
rotation = Heading.from_degrees(360 - int(center_unit.heading))
|
||||
|
||||
# Rotate all units
|
||||
for group in groups:
|
||||
for unit in group.units:
|
||||
unit.position = PointWithHeading.from_point(
|
||||
unit.position, Heading.from_degrees(int(unit.heading)) + rotation
|
||||
)
|
||||
unit.heading = unit.position.heading.degrees
|
||||
unit.position.rotate(center_unit.position, rotation)
|
||||
group.points[0].position = group.units[0].position
|
||||
# Save the miz
|
||||
mission.save()
|
||||
|
||||
|
||||
def main() -> None:
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("mission", type=str, help="The mission which will be fixed")
|
||||
args = parser.parse_args()
|
||||
fix_orientation(args.mission)
|
||||
|
||||
|
||||
main()
|
||||
Loading…
x
Reference in New Issue
Block a user