894 Commits

Author SHA1 Message Date
Dan Albert
610a27c0e4 Copy initialization fix to AircraftType. 2021-06-23 12:50:07 -07:00
Dan Albert
d3d655da07 Fixed missed initialization of unit data on load.
We'd only load unit data if a name lookup was done and missed it on a
type lookup. Ideally we wouldn't need to do a type lookup here until the
ground unit templates are reworked we still do.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1299
2021-06-22 23:41:05 -07:00
Dan Albert
ca93f2baff Bump campaign version to account for DCS changes.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1308
2021-06-22 23:04:16 -07:00
Mike Jones
08b7aff0d8 Add gunfighter flag to aircraft data files. 2021-06-22 14:35:28 -07:00
Mike Jones
a75688f89c Add patrol configuration to unit data files.
This allows altitude/speed of AEW&C and tankers to be configured.
2021-06-22 14:35:28 -07:00
Dan Albert
e96210f48c Don't order transports for incapable factions.
If these orders can't be fulfilled for the faction it will prevent the
faction from ordering any non-reserve aircraft since transports are
given priority after reserve missions, and they'll never be fulfillable.
As such, no non-reserve aircraft will ever be purchased for factions
without transport aircraft.

Factions without transport aircraft are screwed in other ways, but this
will fix their air planning for campaigns that aren't dependent on
airlift.
2021-06-20 23:44:00 -07:00
Simon Clark
963ab38b2e Refactor the mod select changes, re-add accidentally deleted factions. 2021-06-21 01:16:48 +01:00
Simon Clark
11069cc219 Make mod selection nicer and deprecate MB-339.
Mod selection is now done via checkbox in the new game wizard.

The MB-339 is being turned into a paid module, and the free mod no longer works, so it's been removed.
2021-06-21 01:16:41 +01:00
Dan Albert
63af28b016 Develop is now 5.x. 2021-06-20 15:48:54 -07:00
Dan Albert
dc85644d71 Exclude weapon names and weights from comparisons.
Only the class ID matters, and the names sometimes change with new pydcs
updates.
2021-06-20 15:11:35 -07:00
Mike
bb2bf78e8a
Fix current_airlift_capacity always returning 0.
Squadron.aircraft is of type AircraftType, while TRANSPORT_CAPABLE is
a list of pydcs DcsUnitTypes. As a result, the intersection was always
empty causing the function to always return 0.
2021-06-20 13:56:00 -07:00
SnappyComebacks
5b31026e1c
Fix UI to obey max group sizes.
This also adds max group sizes for aircraft that need it but don't
according to DCS. Only the first tanker or AEW&C unit in a group can be
contacted by radio.
2021-06-20 13:32:00 -07:00
Khopa
28820f2e64 Squadrons : Allow unicode characters in squadrons names 2021-06-20 17:43:07 +02:00
Dan Albert
1e2522375b Increase squadron size and replenishment rate.
Given the current lack of control over the number of squadrons this
needs be be raised to make it have less of an impact.
2021-06-19 23:24:23 -07:00
Dan Albert
b130c9882a Remove max distance for AEW&C auto planning.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1259
2021-06-19 11:27:52 -07:00
Dan Albert
5f8b838652 Add new campaign minor version for Cyprus. 2021-06-19 11:18:31 -07:00
jsjlewis96
6cd711a1e2 Added option to disable AI pilot levelling 2021-06-19 03:03:50 -07:00
Marcel
0a874a28ef Fix group name for EWRs.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1246
2021-06-18 19:26:42 -07:00
Dan Albert
2dee702060 Persist name generator state to the save game.
This is a bit of an ugly hack but it's effectively what we would need
anyway. We could clean up the global replacement by making the name
generator _only_ a property of Game and plumbing it through to a large
number of places. Could maybe also use `__getstate__` and `__setstate__`
tricks to save `naming.namegen` to the file even without making it truly
a part of Game.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1247
2021-06-18 19:24:23 -07:00
Dan Albert
5c3bb75786 Fix EPLRS for aircraft.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1237
2021-06-18 16:48:59 -07:00
Dan Albert
4c3ac0af91 Adapt to DCS update. 2021-06-17 22:58:46 -07:00
Dan Albert
11dca41945 Remove unused file. 2021-06-17 22:11:00 -07:00
Dan Albert
09704b6f37 Add a wrapper type for ground unit info. 2021-06-17 22:09:17 -07:00
Dan Albert
7170a7b302 Fix spawning unused aircraft.
These are assigned a squadron even though they're unused as a hack. We
need to tolerate these aircraft having no pilot assigned since that's
the desired case for unused aircraft (though only happens when the
squadron runs out of pilots, which should be fixed).
2021-06-16 20:11:36 -07:00
Dan Albert
34453fa3be Fix incorrect conditional. 2021-06-16 17:23:57 -07:00
Dan Albert
021445216e Escape the JTAC zone name in the plugin data.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1218
2021-06-16 17:06:45 -07:00
Schneefl0cke
c13bf3ccd1
Fix procurement for factions that lack some units.
Fixes procurement for factions with no aircraft, no ground units, or no
tanks.
2021-06-16 09:34:58 -07:00
Dan Albert
ace42019fb Cap squadron size, limit replenishment rate.
This caps squadrons to 12 pilots and limits their replenishment rate to
1 pilot per turn. Should probably make those values configurable, but
they aren't currently.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1136
2021-06-13 14:40:15 -07:00
Dan Albert
25c289deaa Make squadron nicknames optional. 2021-06-12 21:43:26 -07:00
Dan Albert
3c802e7d55 Fix unit info window. 2021-06-12 21:35:01 -07:00
Dan Albert
ba3cf4d2bd Put back all the radio data. 2021-06-12 20:56:24 -07:00
Dan Albert
8c62a081fe Remove unused code from AircraftType conversion. 2021-06-12 20:13:45 -07:00
Dan Albert
4a3ef42e67 Wrap the pydcs FlyingType in our own AircraftType.
This is an attempt to remove a lot of our supposedly unnecessary error
handling. Every aircraft should have a price, a description, a name,
etc; and none of those should require carrying around the faction's
country as context.

This moves all the data for aircraft into yaml files (only one converted
here as an example). Most of the "extended unit info" isn't actually
being read yet.

To replace the renaming of units based on the county, we instead
generate multiple types of each unit when necessary. The CF-18 is just
as much a first-class type as the F/A-18 is.

This doesn't work in its current state because it does break all the
existing names for aircraft that are used in the faction and squadron
files, and we no longer let those errors go as a warning. It will be an
annoying one time switch, but it allows us to define the names that get
used in these files instead of being sensitive to changes as they happen
in pydcs, and allows faction designers to specifically choose, for
example, the Su-22 instead of the Su-17.

One thing not handled by this is aircraft task capability. This is
because the lists in ai_flight_planner_db.py are a priority list, and to
move it out to a yaml file we'd need to assign a weight to it that would
be used to stack rank each aircraft. That's doable, but it makes it much
more difficult to see the ordering of aircraft at a glance, and much
more annoying to move aircraft around in the priority list. I don't
think this is worth doing, and the priority lists will remain in their
own separate lists.

This includes the converted I used to convert all the old unit info and
factions to the new format. This doesn't need to live long, but we may
want to reuse it in the future so we want it in the version history.
2021-06-12 20:13:45 -07:00
Dan Albert
88abaef7f9 Fix inconsistencies in prices and unit data. 2021-06-12 20:13:45 -07:00
Schneefl0cke
21fe746f2f
Use ID for unit info lookups instead of name. 2021-06-12 02:24:21 -07:00
Dan Albert
c3c6915fa0 Include the micro version in the version string. 2021-06-11 16:52:23 -07:00
Florian
78cd17e279 added missing units 2021-06-10 11:18:52 -07:00
SnappyComebacks
a53a648a63 Add plannable tankers.
This Pull Request lets users plan Tanker flights.

Features:

- Introduction of `Refueling` flight type.
- Tankers can be purchased at airbases and carriers.
- Tankers get planned by AI.
- Tankers are planned from airbases and at aircraft carriers.
- Tankers aim to be at high, fast, and 70 miles from the nearest threat.
  (A10s won't be able to tank)
- Tankers racetrack orbit for one hour.
- Optional Tickbox to enable legacy tankers.
- S-3B Tanker added to factions.
- KC-130 MPRS added to factions.
- Kneeboard shows planned tankers, their tacans, and radios.

Limitations:

- AI doesn't know whether to plan probe and drogue or boom refueling
  tankers.
- User can't choose tanker speed.  Heavily loaded aircraft may have
  trouble.
- User can't choose tanker altitude.  A-10s will not make it to high
  altitude.

Problems:

- Tanker callsigns do not increment, see attached image.  (Investigated:
  Need to use `FlyingType.callsign_dict`, instead of just
  `FlyingType.callsign`.  This seems like it might be significant work
  to do.).
- Having a flight of two or more tankers only spawns one tanker.
- Let me know if you have a solution, or feel free to commit one.

https://user-images.githubusercontent.com/74509817/120909602-d7bc3680-c633-11eb-80d7-eccd4e095770.png
2021-06-09 21:14:10 -07:00
Florian
366190ee99 added missing units to price table 2021-06-09 19:03:25 -07:00
Dan Albert
87dd6b19bf Fix repeated JTACs after multiple generations.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1191
2021-06-08 20:56:00 -07:00
bgreman
3188994261 Gripen mod support.
(cherry picked from commit 0220fa4ff6c0f99216b5d74724d341908290cf36)
2021-06-08 20:49:24 -07:00
Dan Albert
0a9dc49e7f Remove UNIT_BY_TASK. 2021-06-07 19:13:49 -07:00
Dan Albert
fd85efbf55 Remove more dead code in game.db. 2021-06-07 18:59:02 -07:00
Dan Albert
6966c16dd2 Remove dead code. 2021-06-07 18:54:39 -07:00
Dan Albert
27b5f24a0f Move unit purchase off find_unittype. 2021-06-07 18:54:21 -07:00
Dan Albert
ef35ad90b8 Remove one user of UNIT_BY_TASK. 2021-06-07 18:01:31 -07:00
Dan Albert
914691eaa7 Remove more unused code from Base. 2021-06-07 17:51:25 -07:00
Dan Albert
37bb83dfa6 Delete a bunch of unused code from Base. 2021-06-07 17:48:03 -07:00
Dan Albert
3d4415d5d2 Move develop to 4.0. 2021-06-05 14:35:07 -07:00
Dan Albert
6d682d509f Restore former turn 0 budget split. 2021-06-05 14:09:10 -07:00