transport helos update

-UH-60L troop capacity set to 11
-bugfix: AI enemy planes/helicopters attacked invisible FARPS
-generator now produces an error log
-Syria scenario FARP support units invulnerable
-all red/blue coalition objects now swap sides for defense mode, including carriers and FARPs
-forces templates can include air units with customization for loadout, livery, and skill
-carrier and FARP parking for enemy helicopters
-parking now supports multiple airports per side
-improved AI flight orbits (now onside and perpendicular to closest enemy airport)
-enemy transport helicopters!  Random troop drops in enemy-occupied zones
-'APCs spawn infantry' now disables conflict zones as infinite troop pickup zones
-bug fix: add zone triggers can be added in wrong order
-Combined Joint Task Forces now supported
-disable pickup zone smoke option added
-Scenario briefing now viewable in generator
-defending vehicles disperse on attack (script option)
-AWACs escorts now weapons-free and engage enemy air threats
-briefing images added
-new Persian Gulf scenario
This commit is contained in:
spencer-ki
2022-02-19 12:44:10 -08:00
parent ad11fd7937
commit bdf5d95f48
24 changed files with 247 additions and 202 deletions

View File

@@ -75,7 +75,7 @@ class RotorOpsMission:
forces = {}
vehicles = []
attack_helos = []
transp_helos = []
transport_helos = []
attack_planes = []
fighter_planes = []
@@ -95,7 +95,7 @@ class RotorOpsMission:
if helicopter_group.task == 'CAS':
attack_helos.append(helicopter_group)
elif helicopter_group.task == 'Transport':
transp_helos.append(helicopter_group)
transport_helos.append(helicopter_group)
for plane_group in country_obj.plane_group:
if plane_group.task == 'CAS':
attack_planes.append(plane_group)
@@ -104,7 +104,7 @@ class RotorOpsMission:
forces["vehicles"] = vehicles
forces["attack_helos"] = attack_helos
forces["transp_helos"] = transp_helos
forces["transport_helos"] = transport_helos
forces["attack_planes"] = attack_planes
forces["fighter_planes"] = fighter_planes
@@ -119,13 +119,21 @@ class RotorOpsMission:
self.m.load_file(options["scenario_filename"])
if not self.m.country("Russia") or not self.m.country("USA"):
failure_msg = "You must include a USA and Russia unit in the scenario template. See the instructions in " + self.scenarios_dir
if not self.m.country("Combined Joint Task Forces Red") or not self.m.country("Combined Joint Task Forces Blue"):
failure_msg = "You must include a CombinedJointTaskForcesBlue and CombinedJointTaskForcesRed unit in the scenario template. See the instructions in " + self.scenarios_dir
return {"success": False, "failure_msg": failure_msg}
red_forces = self.getUnitsFromMiz(options["red_forces_filename"], "red")
blue_forces = self.getUnitsFromMiz(options["blue_forces_filename"], "blue")
# Add coalitions (we may be able to add CJTF here instead of requiring templates to have objects of those coalitions)
self.m.coalition.get("red").add_country(dcs.countries.Russia())
self.m.coalition.get("blue").add_country(dcs.countries.USA())
self.m.add_picture_blue(self.assets_dir + '/briefing1.png')
self.m.add_picture_blue(self.assets_dir + '/briefing2.png')
# add zones to target mission
zone_names = ["ALPHA", "BRAVO", "CHARLIE", "DELTA"]
@@ -157,18 +165,18 @@ class RotorOpsMission:
#Populate Red zones with ground units
for zone_name in red_zones:
if red_forces["vehicles"]:
self.addGroundGroups(red_zones[zone_name], self.m.country('Russia'), red_forces["vehicles"], options["red_quantity"])
self.addGroundGroups(red_zones[zone_name], self.m.country('Combined Joint Task Forces Red'), red_forces["vehicles"], options["red_quantity"])
#Add red FARPS
if options["zone_farps"] != "farp_never" and not options["defending"]:
RotorOpsGroups.VehicleTemplate.USA.zone_farp(self.m, self.m.country('USA'),
self.m.country('Russia'),
RotorOpsGroups.VehicleTemplate.CombinedJointTaskForcesBlue.zone_farp(self.m, self.m.country('Combined Joint Task Forces Blue'),
self.m.country('Combined Joint Task Forces Blue'),
red_zones[zone_name].position,
180, zone_name + " FARP", late_activation=True)
if options["zone_protect_sams"]:
self.m.vehicle_group(
self.m.country('Russia'),
self.m.country('Combined Joint Task Forces Red'),
"Static " + zone_name + " Protection SAM",
random.choice(RotorOpsUnits.e_zone_sams),
red_zones[zone_name].position,
@@ -182,18 +190,18 @@ class RotorOpsMission:
#Populate Blue zones with ground units
for zone_name in blue_zones:
if blue_forces["vehicles"]:
self.addGroundGroups(blue_zones[zone_name], self.m.country('USA'), blue_forces["vehicles"],
self.addGroundGroups(blue_zones[zone_name], self.m.country('Combined Joint Task Forces Blue'), blue_forces["vehicles"],
options["blue_quantity"])
#Add blue FARPS
if options["zone_farps"] != "farp_never" and options["defending"]:
RotorOpsGroups.VehicleTemplate.USA.zone_farp(self.m, self.m.country('USA'),
self.m.country('USA'),
RotorOpsGroups.VehicleTemplate.CombinedJointTaskForcesBlue.zone_farp(self.m, self.m.country('Combined Joint Task Forces Blue'),
self.m.country('Combined Joint Task Forces Blue'),
blue_zones[zone_name].position,
180, zone_name + " FARP", late_activation=True)
180, zone_name + " FARP", late_activation=False)
#add logistics sites
if options["crates"] and zone_name in self.staging_zones:
RotorOpsGroups.VehicleTemplate.USA.logistics_site(self.m, self.m.country('USA'),
RotorOpsGroups.VehicleTemplate.CombinedJointTaskForcesBlue.logistics_site(self.m, self.m.country('Combined Joint Task Forces Blue'),
blue_zones[zone_name].position,
180, zone_name)
@@ -203,7 +211,7 @@ class RotorOpsMission:
if options["zone_protect_sams"] and options["defending"]:
vg = self.m.vehicle_group(
self.m.country('USA'),
self.m.country('Combined Joint Task Forces Blue'),
"Static " + zone_name + " Protection SAM",
random.choice(RotorOpsUnits.e_zone_sams),
blue_zones[zone_name].position,
@@ -213,7 +221,6 @@ class RotorOpsMission:
)
#Add player slots
self.addPlayerHelos(options)
@@ -302,80 +309,81 @@ class RotorOpsMission:
for airport in red_airports:
self.m.terrain.airports[airport.name].set_blue()
usa = self.m.country("USA")
russia = self.m.country("Russia")
combinedJointTaskForcesBlue = self.m.country("Combined Joint Task Forces Blue")
combinedJointTaskForcesRed = self.m.country("Combined Joint Task Forces Red")
#Swap ships
blue_ships = usa.ship_group.copy()
red_ships = russia.ship_group.copy()
blue_ships = combinedJointTaskForcesBlue.ship_group.copy()
red_ships = combinedJointTaskForcesRed.ship_group.copy()
for group in blue_ships:
russia.add_ship_group(group)
usa.ship_group.remove(group)
group.points[0].tasks.append(dcs.task.OptROE(dcs.task.OptROE.Values.ReturnFire))
combinedJointTaskForcesRed.add_ship_group(group)
combinedJointTaskForcesBlue.ship_group.remove(group)
for group in red_ships:
usa.add_ship_group(group)
russia.ship_group.remove(group)
combinedJointTaskForcesBlue.add_ship_group(group)
combinedJointTaskForcesRed.ship_group.remove(group)
#Swap statics
blue_statics = usa.static_group.copy()
red_statics = russia.static_group.copy()
blue_statics = combinedJointTaskForcesBlue.static_group.copy()
red_statics = combinedJointTaskForcesRed.static_group.copy()
for group in blue_statics:
usa.static_group.remove(group)
russia.add_static_group(group)
combinedJointTaskForcesBlue.static_group.remove(group)
combinedJointTaskForcesRed.add_static_group(group)
for group in red_statics:
russia.static_group.remove(group)
usa.add_static_group(group)
combinedJointTaskForcesRed.static_group.remove(group)
combinedJointTaskForcesBlue.add_static_group(group)
#Swap vehicles
blue_vehicles = usa.vehicle_group.copy()
red_vehicles = russia.vehicle_group.copy()
blue_vehicles = combinedJointTaskForcesBlue.vehicle_group.copy()
red_vehicles = combinedJointTaskForcesRed.vehicle_group.copy()
for group in blue_vehicles:
usa.vehicle_group.remove(group)
russia.add_vehicle_group(group)
combinedJointTaskForcesBlue.vehicle_group.remove(group)
combinedJointTaskForcesRed.add_vehicle_group(group)
for group in red_vehicles:
russia.vehicle_group.remove(group)
usa.add_vehicle_group(group)
combinedJointTaskForcesRed.vehicle_group.remove(group)
combinedJointTaskForcesBlue.add_vehicle_group(group)
#Swap planes
blue_planes = usa.plane_group.copy()
red_planes = russia.plane_group.copy()
blue_planes = combinedJointTaskForcesBlue.plane_group.copy()
red_planes = combinedJointTaskForcesRed.plane_group.copy()
for group in blue_planes:
usa.plane_group.remove(group)
russia.add_plane_group(group)
combinedJointTaskForcesBlue.plane_group.remove(group)
combinedJointTaskForcesRed.add_plane_group(group)
for group in red_planes:
russia.plane_group.remove(group)
usa.add_plane_group(group)
combinedJointTaskForcesRed.plane_group.remove(group)
combinedJointTaskForcesBlue.add_plane_group(group)
# Swap helicopters
blue_helos = usa.helicopter_group.copy()
red_helos = russia.helicopter_group.copy()
blue_helos = combinedJointTaskForcesBlue.helicopter_group.copy()
red_helos = combinedJointTaskForcesRed.helicopter_group.copy()
for group in blue_helos:
usa.helicopter_group.remove(group)
russia.add_helicopter_group(group)
combinedJointTaskForcesBlue.helicopter_group.remove(group)
combinedJointTaskForcesRed.add_helicopter_group(group)
for group in red_helos:
russia.helicopter_group.remove(group)
usa.add_helicopter_group(group)
combinedJointTaskForcesRed.helicopter_group.remove(group)
combinedJointTaskForcesBlue.add_helicopter_group(group)
def addPlayerHelos(self, options):
@@ -385,13 +393,13 @@ class RotorOpsMission:
client_helos = [dcs.helicopters.helicopter_map[helicopter]]
#find friendly carriers and farps
carrier = self.m.country("USA").find_ship_group(name="HELO_CARRIER")
carrier = self.m.country("Combined Joint Task Forces Blue").find_ship_group(name="HELO_CARRIER")
if not carrier:
carrier = self.m.country("USA").find_ship_group(name="HELO_CARRIER_1")
carrier = self.m.country("Combined Joint Task Forces Blue").find_ship_group(name="HELO_CARRIER_1")
farp = self.m.country("USA").find_static_group("HELO_FARP")
farp = self.m.country("Combined Joint Task Forces Blue").find_static_group("HELO_FARP")
if not farp:
farp = self.m.country("USA").find_static_group("HELO_FARP_1")
farp = self.m.country("Combined Joint Task Forces Blue").find_static_group("HELO_FARP_1")
friendly_airports, primary_f_airport = self.getCoalitionAirports("blue")
@@ -402,10 +410,10 @@ class RotorOpsMission:
for helotype in client_helos:
if carrier:
fg = self.m.flight_group_from_unit(self.m.country('USA'), "CARRIER " + helotype.id, helotype, carrier,
fg = self.m.flight_group_from_unit(self.m.country('Combined Joint Task Forces Blue'), "CARRIER " + helotype.id, helotype, carrier,
dcs.task.CAS, group_size=group_size)
elif farp:
fg = self.m.flight_group_from_unit(self.m.country('USA'), "FARP " + helotype.id, helotype, farp,
fg = self.m.flight_group_from_unit(self.m.country('Combined Joint Task Forces Blue'), "FARP " + helotype.id, helotype, farp,
dcs.task.CAS, group_size=group_size)
#invisible farps need manual unit placement for multiple units
@@ -415,7 +423,7 @@ class RotorOpsMission:
fg.units[0].position = fg.units[0].position.point_from_heading(heading, 30)
heading += 90
else:
fg = self.m.flight_group_from_airport(self.m.country('USA'), primary_f_airport.name + " " + helotype.id, helotype,
fg = self.m.flight_group_from_airport(self.m.country('Combined Joint Task Forces Blue'), primary_f_airport.name + " " + helotype.id, helotype,
self.getParking(primary_f_airport, helotype), group_size=group_size)
fg.units[0].set_client()
fg.load_task_default_loadout(dcs.task.CAS)
@@ -445,19 +453,19 @@ class RotorOpsMission:
return dcs.mapping.Point(pt1[0], pt1[1]), heading, race_dist
def addFlights(self, options, red_forces, blue_forces):
usa = self.m.country(dcs.countries.USA.name)
russia = self.m.country(dcs.countries.Russia.name)
combinedJointTaskForcesBlue = self.m.country(dcs.countries.CombinedJointTaskForcesBlue.name)
combinedJointTaskForcesRed = self.m.country(dcs.countries.CombinedJointTaskForcesRed.name)
friendly_airports, primary_f_airport = self.getCoalitionAirports("blue")
enemy_airports, primary_e_airport = self.getCoalitionAirports("red")
#find enemy carriers and farps
carrier = self.m.country("Russia").find_ship_group(name="HELO_CARRIER")
carrier = self.m.country("Combined Joint Task Forces Red").find_ship_group(name="HELO_CARRIER")
if not carrier:
carrier = self.m.country("Russia").find_ship_group(name="HELO_CARRIER_1")
carrier = self.m.country("Combined Joint Task Forces Red").find_ship_group(name="HELO_CARRIER_1")
farp = self.m.country("Russia").find_static_group("HELO_FARP")
farp = self.m.country("Combined Joint Task Forces Red").find_static_group("HELO_FARP")
if not farp:
farp = self.m.country("Russia").find_static_group("HELO_FARP_1")
farp = self.m.country("Combined Joint Task Forces Red").find_static_group("HELO_FARP_1")
e_airport_heading = dcs.mapping.heading_between_points(
friendly_airports[0].position.x, friendly_airports[0].position.y, enemy_airports[0].position.x, primary_e_airport.position.y
@@ -467,73 +475,6 @@ class RotorOpsMission:
primary_f_airport.position.x, primary_f_airport.position.y, primary_f_airport.position.x, primary_f_airport.position.y
)
center_x, center_y = dcs.mapping.point_from_heading(primary_f_airport.position.x, primary_f_airport.position.y, e_airport_heading - 180, 5000)
center_pt = dcs.mapping.Point(center_x, center_y)
# add some objects to illustrate the bounds on the map
# RotorOpsGroups.VehicleTemplate.USA.zone_farp(self.m, self.m.country('USA'), self.m.country('Russia'),
# center_pt, 180, "CENTER", late_activation=True)
# orbit_rect = dcs.mapping.Rectangle(
# int(primary_f_airport.position.x), int(primary_f_airport.position.y - 100 * 1000), int(primary_f_airport.position.x - 100 * 1000),
# int(primary_f_airport.position.y))
# def pointFromHeading(point, heading, distance):
# pos = dcs.mapping.point_from_heading(point.x, point.y, heading, distance)
# return dcs.mapping.Point(pos[0], pos[1])
# flight_box = [
# pointFromHeading(center_pt, e_airport_heading - 90, 100000),
# pointFromHeading(center_pt, e_airport_heading - 180, 50000),
# pointFromHeading(center_pt, e_airport_heading + 90, 100000),
# pointFromHeading(center_pt, e_airport_heading + 0, 50000),
# ]
# flight_box = dcs.mapping.Rectangle(
# dcs.mapping.point_from_heading(center_pt.x, center_pt.y, 0, 50000),
# dcs.mapping.point_from_heading(center_pt.x, center_pt.y, 270, 100000),
# dcs.mapping.point_from_heading(center_pt.x, center_pt.y, 180, 50000),
# dcs.mapping.point_from_heading(center_pt.x, center_pt.y, 90, 10000),
# )
# flight_box = dcs.mapping.Rectangle(
# center_pt.y + 5000,
# center_pt.x - 10000,
# center_pt.y - 5000,
# center_pt.x + 10000,
# )
# for point in flight_box:
# #add some objects to illustrate the bounds on the map
# RotorOpsGroups.VehicleTemplate.USA.zone_farp(self.m, self.m.country('USA'), self.m.country('Russia'),
# point, 180, "CENTER", late_activation=True)
# flight_box = [
# dcs.mapping.point_from_heading(center_pt.x, center_pt.y, e_airport_heading - 90, 100000),
# dcs.mapping.point_from_heading(center_pt.x, center_pt.y, e_airport_heading - 180, 50000),
# dcs.mapping.point_from_heading(center_pt.x, center_pt.y, e_airport_heading + 90, 100000),
# dcs.mapping.point_from_heading(center_pt.x, center_pt.y, e_airport_heading + 0, 50000),
# ]
#
# a = int(min(flight_box.top, self.m.terrain.bounds.top))
# b = int(max(flight_box.left, self.m.terrain.bounds.left))
# c = int(max(flight_box.bottom, self.m.terrain.bounds.bottom))
# d = int(min(flight_box.right, self.m.terrain.bounds.right))
#
#
# orbit_rect = dcs.mapping.Rectangle(
# int(min(flight_box.top, self.m.terrain.bounds.top)),
# int(max(flight_box.left, self.m.terrain.bounds.left)),
# int(max(flight_box.bottom, self.m.terrain.bounds.bottom)),
# int(min(flight_box.right, self.m.terrain.bounds.right)),
# )
if options["f_awacs"]:
awacs_name = "AWACS"
@@ -541,7 +482,7 @@ class RotorOpsMission:
#pos, heading, race_dist = self.TrainingScenario.random_orbit(orbit_rect)
pos, heading, race_dist = self.TrainingScenario.perpRacetrack(e_airport_heading, primary_f_airport.position)
awacs = self.m.awacs_flight(
usa,
combinedJointTaskForcesBlue,
awacs_name,
plane_type=dcs.planes.E_3A,
airport=self.getParking(primary_f_airport, dcs.planes.E_3A, friendly_airports),
@@ -549,13 +490,29 @@ class RotorOpsMission:
race_distance=race_dist, heading=heading,
altitude=random.randrange(4000, 5500, 100), frequency=awacs_freq)
# AWACS Escort flight
source_plane = None
if blue_forces["fighter_planes"]:
source_group = random.choice(blue_forces["fighter_planes"])
source_plane = source_group.units[0]
plane_type = source_plane.unit_type
else:
plane_type = dcs.countries.CombinedJointTaskForcesBlue.Plane.F_15C
awacs_escort = self.m.escort_flight(
usa, "AWACS Escort",
dcs.countries.USA.Plane.F_15C,
airport=self.getParking(primary_f_airport, dcs.countries.USA.Plane.F_15C, friendly_airports),
combinedJointTaskForcesBlue, "AWACS Escort",
plane_type,
airport=self.getParking(primary_f_airport, plane_type, friendly_airports),
group_to_escort=awacs,
group_size=2)
awacs_escort.load_loadout(dcs.task.CAP)
awacs_escort.points[0].tasks.append(dcs.task.OptROE(dcs.task.OptROE.Values.WeaponFree))
if source_plane:
for unit in awacs_escort.units:
unit.pylons = source_plane.pylons
unit.livery_id = source_plane.livery_id
#add text to mission briefing with radio freq
briefing = self.m.description_text() + "\n\n" + awacs_name + " " + str(awacs_freq) + ".00 " + "\n"
@@ -571,7 +528,7 @@ class RotorOpsMission:
#pos, heading, race_dist = self.TrainingScenario.random_orbit(orbit_rect)
pos, heading, race_dist = self.TrainingScenario.perpRacetrack(e_airport_heading, primary_f_airport.position)
refuel_net = self.m.refuel_flight(
usa,
combinedJointTaskForcesBlue,
t1_name,
dcs.planes.KC130,
airport=self.getParking(primary_f_airport, dcs.planes.KC130, friendly_airports),
@@ -587,7 +544,7 @@ class RotorOpsMission:
#pos, heading, race_dist = self.TrainingScenario.random_orbit(orbit_rect)
pos, heading, race_dist = self.TrainingScenario.perpRacetrack(e_airport_heading, primary_f_airport.position)
refuel_rod = self.m.refuel_flight(
usa,
combinedJointTaskForcesBlue,
t2_name,
dcs.planes.KC_135,
airport=self.getParking(primary_f_airport, dcs.planes.KC_135, friendly_airports),
@@ -603,7 +560,7 @@ class RotorOpsMission:
self.m.set_description_text(briefing)
def zone_attack(fg, airport):
fg.set_skill(dcs.unit.Skill.Random)
fg.set_skill(dcs.unit.Skill.High)
fg.late_activation = True
if options["defending"]:
@@ -616,6 +573,9 @@ class RotorOpsMission:
fg.add_runway_waypoint(airport)
if airport:
fg.land_at(airport)
fg.points[0].tasks.append(dcs.task.OptReactOnThreat(dcs.task.OptReactOnThreat.Values.EvadeFire))
fg.points[0].tasks.append(dcs.task.OptROE(dcs.task.OptROE.Values.OpenFire))
@@ -637,7 +597,7 @@ class RotorOpsMission:
if carrier:
afg = self.m.flight_group_from_unit(
russia,
combinedJointTaskForcesRed,
"Enemy Attack Helicopters",
helo_type,
carrier,
@@ -648,7 +608,7 @@ class RotorOpsMission:
elif farp:
afg = self.m.flight_group_from_unit(
russia,
combinedJointTaskForcesRed,
"Enemy Attack Helicopters",
helo_type,
farp,
@@ -659,7 +619,7 @@ class RotorOpsMission:
elif airport:
afg = self.m.flight_group_from_airport(
russia,
combinedJointTaskForcesRed,
"Enemy Attack Helicopters",
helo_type,
airport=airport,
@@ -675,7 +635,6 @@ class RotorOpsMission:
for unit in afg.units:
unit.pylons = source_helo.pylons
unit.livery_id = source_helo.livery_id
unit.skill = source_helo.skill
@@ -695,7 +654,7 @@ class RotorOpsMission:
airport = self.getParking(primary_e_airport, plane_type, enemy_airports, group_size)
if airport:
afg = self.m.flight_group_from_airport(
russia, "Enemy Attack Planes", plane_type,
combinedJointTaskForcesRed, "Enemy Attack Planes", plane_type,
airport=airport,
maintask=dcs.task.CAS,
start_type=dcs.mission.StartType.Cold,
@@ -706,22 +665,35 @@ class RotorOpsMission:
for unit in afg.units:
unit.pylons = source_plane.pylons
unit.livery_id = source_plane.livery_id
unit.skill = source_plane.skill
if options["e_transport_helos"]:
group_size = 1
helo_type = dcs.helicopters.Mi_26
source_helo = None
if red_forces["transport_helos"]:
source_group = random.choice(red_forces["transport_helos"])
source_helo = source_group.units[0]
helo_type = source_helo.unit_type
group_size = len(source_group.units)
if group_size > 2:
group_size = 2
else:
group_size = 1
helo_type = random.choice(RotorOpsUnits.e_transport_helos)
airport = self.getParking(primary_e_airport, helo_type, enemy_airports, group_size)
if airport:
afg = self.m.flight_group_from_airport(
russia, "Enemy Transport Helicopters", helo_type,
combinedJointTaskForcesRed, "Enemy Transport Helicopters", helo_type,
airport=airport,
maintask=dcs.task.Transport,
start_type=dcs.mission.StartType.Cold,
group_size=group_size)
afg.late_activation = True
afg.units[0].skill = dcs.unit.Skill.Excellent
if source_helo:
for unit in afg.units:
unit.pylons = source_helo.pylons
unit.livery_id = source_helo.livery_id
def scriptTriggerSetup(self, options):
@@ -737,8 +709,8 @@ class RotorOpsMission:
trig.actions.append(dcs.action.DoScriptFile(self.scripts["Splash_Damage_2_0.lua"]))
trig.actions.append(dcs.action.DoScriptFile(self.scripts["CTLD.lua"]))
trig.actions.append(dcs.action.DoScriptFile(self.scripts["RotorOps.lua"]))
trig.actions.append(dcs.action.DoScript(dcs.action.String((
"--OPTIONS HERE!\n\n" +
script = ""
script = ("--OPTIONS HERE!\n\n" +
"RotorOps.CTLD_crates = " + lb("crates") + "\n\n" +
"RotorOps.CTLD_sound_effects = true\n\n" +
"RotorOps.force_offroad = " + lb("force_offroad") + "\n\n" +
@@ -746,7 +718,10 @@ class RotorOpsMission:
"RotorOps.zone_status_display = " + lb("game_display") + "\n\n" +
"RotorOps.inf_spawn_messages = " + lb("inf_spawn_msgs") + "\n\n" +
"RotorOps.inf_spawns_per_zone = " + lb("inf_spawn_qty") + "\n\n" +
"RotorOps.apcs_spawn_infantry = " + lb("apc_spawns_inf") + " \n\n"))))
"RotorOps.apcs_spawn_infantry = " + lb("apc_spawns_inf") + " \n\n")
if not options["smoke_pickup_zones"]:
script = script + 'RotorOps.pickup_zone_smoke = "none"\n\n'
trig.actions.append(dcs.action.DoScript(dcs.action.String((script))))
self.m.triggerrules.triggers.append(trig)
#Add the second trigger
@@ -783,15 +758,15 @@ class RotorOpsMission:
self.m.triggerrules.triggers.append(z_sams_trig)
#Zone FARPS always
if options["zone_farps"] == "farp_always" and not options["defending"] and index > 0:
if options["zone_farps"] == "farp_always" and not options["defending"]:
for index, zone_name in enumerate(self.conflict_zones):
if index > 0:
previous_zone = list(self.conflict_zones)[index - 1]
if not self.m.country("USA").find_group(previous_zone + " FARP Static"):
if not self.m.country("Combined Joint Task Forces Blue").find_group(previous_zone + " FARP Static"):
continue
z_farps_trig = dcs.triggers.TriggerOnce(comment="Activate " + previous_zone + " FARP")
z_farps_trig.rules.append(dcs.condition.FlagEquals(game_flag, index + 1))
z_farps_trig.actions.append(dcs.action.ActivateGroup(self.m.country("USA").find_group(previous_zone + " FARP Static").id))
z_farps_trig.actions.append(dcs.action.ActivateGroup(self.m.country("Combined Joint Task Forces Blue").find_group(previous_zone + " FARP Static").id))
#z_farps_trig.actions.append(dcs.action.SoundToAll(str(self.res_map['forward_base_established.ogg'])))
z_farps_trig.actions.append(dcs.action.DoScript(dcs.action.String(
"RotorOps.farpEstablished(" + str(index) + ")")))
@@ -799,18 +774,18 @@ class RotorOpsMission:
#Zone FARPS conditional on staged units remaining
if options["zone_farps"] == "farp_gunits":
if options["zone_farps"] == "farp_gunits" and not options["defending"]:
for index, zone_name in enumerate(self.conflict_zones):
if index > 0:
previous_zone = list(self.conflict_zones)[index - 1]
if not self.m.country("USA").find_group(previous_zone + " FARP Static"):
if not self.m.country("Combined Joint Task Forces Blue").find_group(previous_zone + " FARP Static"):
continue
z_farps_trig = dcs.triggers.TriggerOnce(comment= "Activate " + previous_zone + " FARP")
z_farps_trig.rules.append(dcs.condition.FlagEquals(game_flag, index + 1))
z_farps_trig.rules.append(dcs.condition.FlagIsMore(111, 20))
z_farps_trig.actions.append(dcs.action.DoScript(dcs.action.String("--The 100 flag indicates which zone is active. The 111 flag value is the percentage of staged units remaining")))
z_farps_trig.actions.append(
dcs.action.ActivateGroup(self.m.country("USA").find_group(previous_zone + " FARP Static").id))
dcs.action.ActivateGroup(self.m.country("Combined Joint Task Forces Blue").find_group(previous_zone + " FARP Static").id))
#z_farps_trig.actions.append(dcs.action.SoundToAll(str(self.res_map['forward_base_established.ogg'])))
z_farps_trig.actions.append(dcs.action.DoScript(dcs.action.String(
"RotorOps.farpEstablished(" + str(index) + ")")))