In AACW2 I am modding some of the Confederate generals to have home areas. For the purposes of my question, I'll use Jubal Early as an example. I hope I make myself clear.
With my changes, Jubal Early first appears as a state militia brigadier general on April 10, 1861. He has HomeArea of $VA and AIPowerAffinity of $VA. Both of these values are specified in the model file. There is a unit file specific to this model (uni_CSA_EarlyVA/ldr_CSA_EarlyVA).
Early's state militia model doesn't have a TechUpg value. Instead, I change the model via an event on the date of his historical promotion to Confederate brigadier. But this bought up the question of where the value of HomeArea should go and how the game is keeping track of models and units when upgrades occur.
When a leader is spawned via event, the unit file value is specified, $uni_CSA_MyGeneral1. The unit refers to a model, $ldr_CSA_MyGeneral1. The model file contains a value for TechUpg, $ldr_CSA_MyGeneral2. $ldr_CSA_MyGeneral2 has a specific until file that refers to it. Assuming the conditions for the upgrade are achieved, I assume the new model replaces the old one, but isn't the original unit file, $uni_CSA_MyGeneral1 still in play? Or does the game link UIDs somewhere as the files are called during a scenario? So far as I know, there's no hard link in any model file to a specific unit. Multiple units can refer to the same models, meaning there are ambiguous links from models -> to -> units. In my example in this paragraph, is $uni_CSA_MyGeneral1 still in play and now referring to $ldr_CSA_MyGeneral2?
I want to make sure I put my HomeArea and AIPowerAffinity values in the appropriate files. In the case of leaders, if I place the HomeArea value in the unit files, and the unit doesn't upgrade with the model, I would be restricting generals without intending to.