Thanks for the quick reply.
So, I understand that it's a limitation currently of the game engine, I also don't understand why then do some facilities have properties such as:
canBeBuiltOver: true
buildOverFacilities:
- STR_INTEL_LABORATORY
if the game is always 'destroying' the old facility weather you build over or manually remove then build a new facility, is there really any different in affect to have these settings as opposed to removing the facility and building a new facility? I can understand that it may disconnect part of the base so building over a facility is helpful to not remove part of the base. I've also have seen in X-Com Files where building Virtualized HQ over HQ allowed current researchers allocated in the HQ to continue researching as an over the total amount allowed as long as they don't stop or are removed from the research allocation.
I don't know if this would be an easy implementation or not, but what I was thinking would be for mod developers to have the ability to design and specify specific facilities they could upgrade over.
So for example if a mod has set the STR_GENERAL_STORES_2 to be allowed to be upgraded over by STR_GENERAL_STORES_3, then building the STR_GENERAL_STORES_3 over the STR_GENERAL_STORES_2 the facilities provided by the STR_GENERAL_STORES_2 would remain until the STR_GENERAL_STORES_3 was completed.
This could be done by:
1.) checking if the facility has the "canBeBuiltOver: true" flag and matches the "allowableUpgradeOverFacilities:"
2.) when building over and upgrading the facility there would be an additional new line in the facility listing in the base facilities, which would keep the old facilities base functions until the new facility is built.
- type: STR_GENERAL_STORES_3
x: 0
y: 0
buildTime: 4
upgradingOver: STR_GENERAL_STORES_2
3.) The "upgradingOver" value would tell the game engine to keep those base facility functions until that line is removed.
4.) Once the new facility builtTime finished the facility functions would immediately shift from the old facility functions to the new facility functions.
5.) The game engine would ignore any checks and take the mod designers settings explicitly and assume they know what they are doing, so building a larger storage over a smaller one or similar for a hangar over a hangar or workshop over workshop makes sense, but if the mod developer said build over living quarters with sickbay the engine would ignore that this was probably wrong as after the upgrade, if the living quarters was maxed out before hand, you now have 50 living space used over the max with the new sickbay providing none of the living space.
6.) It probably would be helpful to have some sort of check or warning, after the end of the build, or at the end of the month when there is a warning about having a negative amount of money remaining, to also have a warning about "Base facilities are over used" and force a sell of people, items, ships, aliens, etc. This is also usually triggered at the end of a mission when supplies is going back to that base over the amount allowed.