Regardless of how the problem with facility uniqueness constraint can be solved (
https://openxcom.org/forum/index.php/topic,8017.0.html), we in The X-Com Files need another property for our facilities.
See, we want straightway to upgrade one building (say, HQ, or Bio Lab) to its advanced version without permitting the player to be able to build any other copies of that building - in other words, the player should have either normal HQ, or advanced one at a time, without any other options. We also have more such buildings. Currently, if player desire, even with a uniqueness constraint, that I mentioned above, the player can build normal HQ, and then advanced next to it, thus, having both of them at a time.
To solve this problem I would like to suggest this small addition to the code. Proposed syntax:
- type: STR_CYBER_HQ
maxAllowedPerBase: 1
isUpgrade: true #default false
buildOverFacilities:
- STR_HQ
Here is a solution I can imagine at the moment:
https://github.com/MeridianOXC/OpenXcom/compare/oxce-plus...FinnikXCF:virtualCraftAdditionally, I think, we can check onLoad if `isUpgrade: true` was set, but there are no `buildOverFacilities:` defined. If so, stop loading with error for modder:
[21-03-2020_19-25-52] [INFO] Loading rulesets...
[21-03-2020_19-25-58] [ERROR] Error processing 'STR_LARGE_RADAR_SYSTEM' in facilities: Facility has property isUpgrade set TRUE, but buildOverFacilities property was not defined!
I would really appreciate feedback and comments!