Modding: Different criteria needed for upgrading? |
I did a quick test and I found that if you modify the stats of a facility (and likely a component, too) in a way not related to the level of the facility, the facility cannot be upgraded nor does it gain the benefits of the new stats unless the facility is destroyed and rebuilt.
I added a miniaturization tech to the tree and modified the space yard so that the tonnage of the facility decreases according to the miniaturization tech level. The size of the facility did not change on the planet, but the size of the facility in the construction menu did. However, there were no means to upgrade the facility, short of meeting the criteria for a new "level".
I plan to mod a variety of components and facilities to have statistics dependent on more than a single technology, but I would greatly appreciate it if the upgrade / retrofit options also compared the stats of the current component and the new one rather than only compare the level to determine if an upgrade can be done.
Re: Modding: Different criteria needed for upgrading?
I was able to get this feature to work without any upgrade issues. I think it may be in your code. Isn't there two lines for tonnage? One is tonnage and the other is tonnage structure. Do you have the adjustment being applied to both? The game I am playing right now has the facility footprint shrinking slowly. My facilities are at 820kt.
Re: Modding: Different criteria needed for upgrading?
However, I think it would be more desirable if buildings did need to be upgraded to get these added benefits.
Simple. Just add new requirments. I experiemented with this a while ago (made the structure dependant on armor tech, not the level of the facility). If the tech is found in the requirments (even if it is always true), the facility won't auto-upgrade, you will need to upgrade it to gain the new benifit. Alternatively, if you want the new benifit to be availiable regardless of level, just don't add them to the requirment field. Also the requirment field can use numbers instead of True of False (like in componment enhencement or vehiculesize), this way you can choose what affect the level, the placement and other conditions.




Re: Modding: Different criteria needed for upgrading?
I'm also assuming you're using the Get Empire Tech Level function with the Miniaturization tech area in the facility size formula field?
The game doesn't always instantly recalculate the stats for existing objects. Run a few turns and see if it changes at all. The above function has been used elsewhere with components so I don't see why it wouldn't work with a facility.
-----
Space Empires Depot | SE:V Balance Mod