mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
spamram for fa18; non-randomized groups vertical separation on spawn; argument to affect DCS folder selection
This commit is contained in:
parent
74c1861240
commit
f9c1dd980b
@ -2,6 +2,7 @@
|
||||
import os
|
||||
import sys
|
||||
import dcs
|
||||
import logging
|
||||
|
||||
import theater.caucasus
|
||||
import theater.persiangulf
|
||||
@ -14,11 +15,13 @@ import ui.corruptedsavemenu
|
||||
|
||||
from game.game import Game
|
||||
from theater import start_generator
|
||||
from userdata import persistency, logging
|
||||
from userdata import persistency, logging as logging_module
|
||||
|
||||
persistency.setup(sys.argv[1])
|
||||
logging.setup_version_string(sys.argv[2])
|
||||
dcs.planes.FlyingType.payload_dirs.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), "resources\\payloads"))
|
||||
dcs.planes.FlyingType.payload_dirs = [os.path.join(os.path.dirname(os.path.realpath(__file__)), "resources\\payloads")]
|
||||
|
||||
logging_module.setup_version_string(sys.argv[2])
|
||||
logging.info("Using {} as userdata folder".format(persistency.base_path()))
|
||||
|
||||
|
||||
def proceed_to_main_menu(game: Game):
|
||||
|
||||
@ -343,7 +343,7 @@ Payload will be used for operation of following type, "*" category will be used
|
||||
"""
|
||||
PLANE_PAYLOAD_OVERRIDES = {
|
||||
FA_18C_hornet: {
|
||||
"*": "AIM-9M*6, AIM-7M*2, FUEL*3",
|
||||
"*": "AIM-120*4,AIM-9*2,AIM-7*2,Fuel",
|
||||
},
|
||||
|
||||
Su_33: {
|
||||
|
||||
@ -37,14 +37,18 @@ TRANSPORT_LANDING_ALT = 1000
|
||||
DEFENCE_ENGAGEMENT_MAX_DISTANCE = 60000
|
||||
INTERCEPT_MAX_DISTANCE = 200000
|
||||
|
||||
GROUP_VERTICAL_OFFSET = 300
|
||||
|
||||
|
||||
class AircraftConflictGenerator:
|
||||
escort_targets = [] # type: typing.List[typing.Tuple[PlaneGroup, int]]
|
||||
vertical_offset = None # type: int
|
||||
|
||||
def __init__(self, mission: Mission, conflict: Conflict, settings: Settings):
|
||||
self.m = mission
|
||||
self.settings = settings
|
||||
self.conflict = conflict
|
||||
self.vertical_offset = 0
|
||||
self.escort_targets = []
|
||||
|
||||
def _start_type(self) -> StartType:
|
||||
@ -123,11 +127,12 @@ class AircraftConflictGenerator:
|
||||
assert count > 0
|
||||
assert unit is not None
|
||||
|
||||
self.vertical_offset += GROUP_VERTICAL_OFFSET
|
||||
if unit_type in helicopters.helicopter_map.values():
|
||||
alt = WARM_START_HELI_ALT + random.randint(50, 200)
|
||||
alt = WARM_START_HELI_ALT + self.vertical_offset
|
||||
speed = WARM_START_HELI_AIRSPEED
|
||||
else:
|
||||
alt = WARM_START_ALTITUDE + random.randint(50, 800)
|
||||
alt = WARM_START_ALTITUDE + self.vertical_offset
|
||||
speed = WARM_START_AIRSPEED
|
||||
|
||||
pos = Point(at.x + random.randint(100, 1000), at.y + random.randint(100, 1000))
|
||||
|
||||
@ -10,18 +10,17 @@ IGNORED_PATHS = [
|
||||
".git",
|
||||
".idea",
|
||||
".DS_Store",
|
||||
"submodules",
|
||||
|
||||
"build",
|
||||
"venv",
|
||||
]
|
||||
|
||||
VERSION = "1.3.2"
|
||||
VERSION = "1.3.3"
|
||||
|
||||
|
||||
def _mk_archieve():
|
||||
archieve = ZipFile("build/dcs_liberation_{}.zip".format(VERSION), "w")
|
||||
archieve.writestr("start.bat", "py.exe __init__.py \"%UserProfile%\" \"{}\"".format(VERSION))
|
||||
|
||||
for path, directories, files in os.walk("."):
|
||||
def _zip_dir(archieve, path):
|
||||
for path, directories, files in os.walk(path):
|
||||
is_ignored = False
|
||||
for ignored_path in IGNORED_PATHS:
|
||||
if ignored_path in path:
|
||||
@ -32,7 +31,22 @@ def _mk_archieve():
|
||||
continue
|
||||
|
||||
for file in files:
|
||||
if file in IGNORED_PATHS:
|
||||
continue
|
||||
archieve.write(os.path.join(path, file))
|
||||
|
||||
|
||||
def _mk_archieve():
|
||||
path = os.path.join("build", "dcs_liberation_{}.zip".format(VERSION))
|
||||
if os.path.exists(path):
|
||||
print("version already exists")
|
||||
return
|
||||
|
||||
archieve = ZipFile(path, "w")
|
||||
archieve.writestr("start.bat", "py.exe __init__.py \"%UserProfile%\" \"{}\"".format(VERSION))
|
||||
_zip_dir(archieve, ".")
|
||||
os.chdir("submodules\\dcs")
|
||||
_zip_dir(archieve, "dcs")
|
||||
|
||||
|
||||
_mk_archieve()
|
||||
@ -1 +1 @@
|
||||
Subproject commit c913af9c76897138373ca08b62c615d6a4edc708
|
||||
Subproject commit fae126689132d643d317252adfb03184042a0ded
|
||||
@ -30,7 +30,7 @@ def setup_version_string(str):
|
||||
_version_string = str
|
||||
|
||||
|
||||
if "-stdout" in sys.argv:
|
||||
if "--stdout" in sys.argv:
|
||||
logging.basicConfig(stream=sys.stdout, level=logging.INFO)
|
||||
else:
|
||||
log_stream = StringIO()
|
||||
|
||||
@ -2,6 +2,7 @@ import logging
|
||||
import typing
|
||||
import pickle
|
||||
import os
|
||||
import sys
|
||||
import shutil
|
||||
|
||||
_user_folder = None # type: str
|
||||
@ -17,7 +18,7 @@ def base_path() -> str:
|
||||
assert _user_folder
|
||||
|
||||
openbeta_path = os.path.join(_user_folder, "Saved Games", "DCS.openbeta")
|
||||
if os.path.exists(openbeta_path):
|
||||
if "--force-stable-DCS" not in sys.argv and os.path.exists(openbeta_path):
|
||||
return openbeta_path
|
||||
else:
|
||||
return os.path.join(_user_folder, "Saved Games", "DCS")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user