mirror of
https://github.com/Pax1601/DCSOlympus.git
synced 2025-10-29 16:56:34 +00:00
Added options for miss on purpose and scenic AAA
This commit is contained in:
77
scripts/python/addMissingUnits.py
Normal file
77
scripts/python/addMissingUnits.py
Normal file
@@ -0,0 +1,77 @@
|
||||
import sys
|
||||
import json
|
||||
import inspect
|
||||
import difflib
|
||||
from slpp import slpp as lua
|
||||
|
||||
SEARCH_FOLDER = "D:\\Eagle Dynamics\\DCS World OpenBeta"
|
||||
|
||||
sys.path.append("D:\\Documents\\dcs")
|
||||
|
||||
from dcs.vehicles import *
|
||||
from dcs.ships import *
|
||||
from dcs.planes import *
|
||||
from dcs.helicopters import *
|
||||
|
||||
# The database file on which to operate is the first standard argument of the call
|
||||
if len(sys.argv) > 1:
|
||||
if (sys.argv[1] == "aircraft"):
|
||||
filename = '..\\..\\client\\public\\databases\\units\\aircraftdatabase.json'
|
||||
units_map = plane_map
|
||||
elif (sys.argv[1] == "helicopter"):
|
||||
filename = '..\\..\\client\\public\\databases\\units\\helicopterdatabase.json'
|
||||
units_map = helicopter_map
|
||||
elif (sys.argv[1] == "groundunit"):
|
||||
filename = '..\\..\\client\\public\\databases\\units\\groundunitdatabase.json'
|
||||
units_map = vehicle_map
|
||||
elif (sys.argv[1] == "navyunit"):
|
||||
filename = '..\\..\\client\\public\\databases\\units\\navyunitdatabase.json'
|
||||
units_map = ship_map
|
||||
|
||||
# Loads the database
|
||||
with open(filename) as f:
|
||||
database = json.load(f)
|
||||
|
||||
for unit in units_map.values():
|
||||
if unit.id not in database:
|
||||
database[unit.id] = {
|
||||
"name": unit.id,
|
||||
"coalition": "",
|
||||
"era": "",
|
||||
"label": unit.name,
|
||||
"shortLabel": unit.name,
|
||||
"type": unit.__qualname__.split(".")[0],
|
||||
"enabled": True,
|
||||
"liveries": {}
|
||||
}
|
||||
print("Added missing unit " + unit.id)
|
||||
|
||||
to_remove = []
|
||||
to_change_case = {}
|
||||
for id in database:
|
||||
found = False
|
||||
for unit in units_map.values():
|
||||
if unit.id == id:
|
||||
found = True
|
||||
elif unit.id.lower() == id.lower() :
|
||||
to_change_case[unit.id] = database[id]
|
||||
|
||||
if not found:
|
||||
to_remove.append(id)
|
||||
|
||||
for id in to_remove:
|
||||
if database[id]["type"] == "SAM Site":
|
||||
print("Skipping " + id + ", it is a SAM Site")
|
||||
else:
|
||||
del database[id]
|
||||
print("Removed unit " + id)
|
||||
|
||||
for id in to_change_case:
|
||||
database[id] = to_change_case[id]
|
||||
print("Changed case of unit " + id)
|
||||
|
||||
# Dump everything in the database
|
||||
with open(filename, "w") as f:
|
||||
json.dump(database, f, indent=2)
|
||||
|
||||
print("Done!")
|
||||
@@ -1,21 +0,0 @@
|
||||
import sys
|
||||
import json
|
||||
import inspect
|
||||
import difflib
|
||||
from slpp import slpp as lua
|
||||
|
||||
SEARCH_FOLDER = "D:\\Eagle Dynamics\\DCS World OpenBeta"
|
||||
|
||||
sys.path.append("..\\..\\..\\dcs-master\\dcs-master")
|
||||
|
||||
from dcs.vehicles import *
|
||||
|
||||
with open("gundata.h", "w") as f:
|
||||
for unit in vehicle_map.values():
|
||||
if unit in Artillery.__dict__.values() or unit in Armor.__dict__.values() or unit in Infantry.__dict__.values():
|
||||
f.write('{"' + unit.id + '", {0.9, 860}}, \n')
|
||||
|
||||
# Done!
|
||||
print("Done!")
|
||||
|
||||
|
||||
@@ -1,109 +0,0 @@
|
||||
{"2B11 mortar", {0.9, 860}},
|
||||
{"SAU Gvozdika", {0.9, 860}},
|
||||
{"SAU Msta", {0.9, 860}},
|
||||
{"SAU Akatsia", {0.9, 860}},
|
||||
{"SAU 2-C9", {0.9, 860}},
|
||||
{"M-109", {0.9, 860}},
|
||||
{"SpGH_Dana", {0.9, 860}},
|
||||
{"AAV7", {0.9, 860}},
|
||||
{"BMD-1", {0.9, 860}},
|
||||
{"BMP-1", {0.9, 860}},
|
||||
{"BMP-2", {0.9, 860}},
|
||||
{"BMP-3", {0.9, 860}},
|
||||
{"BRDM-2", {0.9, 860}},
|
||||
{"BTR_D", {0.9, 860}},
|
||||
{"Cobra", {0.9, 860}},
|
||||
{"LAV-25", {0.9, 860}},
|
||||
{"M1043 HMMWV Armament", {0.9, 860}},
|
||||
{"M1045 HMMWV TOW", {0.9, 860}},
|
||||
{"M1126 Stryker ICV", {0.9, 860}},
|
||||
{"M-113", {0.9, 860}},
|
||||
{"M1134 Stryker ATGM", {0.9, 860}},
|
||||
{"M-2 Bradley", {0.9, 860}},
|
||||
{"MCV-80", {0.9, 860}},
|
||||
{"MTLB", {0.9, 860}},
|
||||
{"Marder", {0.9, 860}},
|
||||
{"TPZ", {0.9, 860}},
|
||||
{"Grad_FDDM", {0.9, 860}},
|
||||
{"Paratrooper RPG-16", {0.9, 860}},
|
||||
{"Paratrooper AKS-74", {0.9, 860}},
|
||||
{"Infantry AK Ins", {0.9, 860}},
|
||||
{"Soldier AK", {0.9, 860}},
|
||||
{"Infantry AK", {0.9, 860}},
|
||||
{"Soldier M249", {0.9, 860}},
|
||||
{"Soldier M4", {0.9, 860}},
|
||||
{"Soldier M4 GRG", {0.9, 860}},
|
||||
{"Soldier RPG", {0.9, 860}},
|
||||
{"MLRS FDDM", {0.9, 860}},
|
||||
{"Infantry AK ver2", {0.9, 860}},
|
||||
{"Infantry AK ver3", {0.9, 860}},
|
||||
{"Grad-URAL", {0.9, 860}},
|
||||
{"Uragan_BM-27", {0.9, 860}},
|
||||
{"Smerch", {0.9, 860}},
|
||||
{"Smerch_HE", {0.9, 860}},
|
||||
{"MLRS", {0.9, 860}},
|
||||
{"Challenger2", {0.9, 860}},
|
||||
{"Leclerc", {0.9, 860}},
|
||||
{"M-60", {0.9, 860}},
|
||||
{"M1128 Stryker MGS", {0.9, 860}},
|
||||
{"M-1 Abrams", {0.9, 860}},
|
||||
{"T-55", {0.9, 860}},
|
||||
{"T-72B", {0.9, 860}},
|
||||
{"T-80UD", {0.9, 860}},
|
||||
{"T-90", {0.9, 860}},
|
||||
{"Leopard1A3", {0.9, 860}},
|
||||
{"Merkava_Mk4", {0.9, 860}},
|
||||
{"JTAC", {0.9, 860}},
|
||||
{"Infantry Animated", {0.9, 860}},
|
||||
{"HL_DSHK", {0.9, 860}},
|
||||
{"HL_KORD", {0.9, 860}},
|
||||
{"tt_DSHK", {0.9, 860}},
|
||||
{"tt_KORD", {0.9, 860}},
|
||||
{"HL_B8M1", {0.9, 860}},
|
||||
{"tt_B8M1", {0.9, 860}},
|
||||
{"M4_Sherman", {0.9, 860}},
|
||||
{"M2A1_halftrack", {0.9, 860}},
|
||||
{"BTR-80", {0.9, 860}},
|
||||
{"T-72B3", {0.9, 860}},
|
||||
{"PT_76", {0.9, 860}},
|
||||
{"BTR-82A", {0.9, 860}},
|
||||
{"Chieftain_mk3", {0.9, 860}},
|
||||
{"Pz_IV_H", {0.9, 860}},
|
||||
{"Leopard-2A5", {0.9, 860}},
|
||||
{"Leopard-2", {0.9, 860}},
|
||||
{"leopard-2A4", {0.9, 860}},
|
||||
{"leopard-2A4_trs", {0.9, 860}},
|
||||
{"Sd_Kfz_251", {0.9, 860}},
|
||||
{"T155_Firtina", {0.9, 860}},
|
||||
{"VAB_Mephisto", {0.9, 860}},
|
||||
{"ZTZ96B", {0.9, 860}},
|
||||
{"ZBD04A", {0.9, 860}},
|
||||
{"PLZ05", {0.9, 860}},
|
||||
{"TYPE-59", {0.9, 860}},
|
||||
{"Tiger_I", {0.9, 860}},
|
||||
{"Tiger_II_H", {0.9, 860}},
|
||||
{"Pz_V_Panther_G", {0.9, 860}},
|
||||
{"Jagdpanther_G1", {0.9, 860}},
|
||||
{"JagdPz_IV", {0.9, 860}},
|
||||
{"Stug_IV", {0.9, 860}},
|
||||
{"SturmPzIV", {0.9, 860}},
|
||||
{"Wespe124", {0.9, 860}},
|
||||
{"Sd_Kfz_234_2_Puma", {0.9, 860}},
|
||||
{"soldier_mauser98", {0.9, 860}},
|
||||
{"Stug_III", {0.9, 860}},
|
||||
{"Elefant_SdKfz_184", {0.9, 860}},
|
||||
{"Pak40", {0.9, 860}},
|
||||
{"LeFH_18-40-105", {0.9, 860}},
|
||||
{"Cromwell_IV", {0.9, 860}},
|
||||
{"M4A4_Sherman_FF", {0.9, 860}},
|
||||
{"soldier_wwii_br_01", {0.9, 860}},
|
||||
{"Centaur_IV", {0.9, 860}},
|
||||
{"Churchill_VII", {0.9, 860}},
|
||||
{"Daimler_AC", {0.9, 860}},
|
||||
{"Tetrarch", {0.9, 860}},
|
||||
{"M12_GMC", {0.9, 860}},
|
||||
{"soldier_wwii_us", {0.9, 860}},
|
||||
{"M10_GMC", {0.9, 860}},
|
||||
{"M8_Greyhound", {0.9, 860}},
|
||||
{"M2A1-105", {0.9, 860}},
|
||||
{"M4_Tractor", {0.9, 860}},
|
||||
Reference in New Issue
Block a user