grimjaw
General
Posts: 506
Joined: Wed Feb 09, 2011 5:38 am
Location: Arkansas

Question RE: unit model files, homearea/aipoweraffinity, chicken/egg ...

Fri Oct 16, 2015 7:45 pm

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.

jm

User avatar
Pocus
Posts: 25659
Joined: Wed Oct 19, 2005 7:37 am
Location: Lyon (France)

Sat Oct 17, 2015 7:21 am

AIPowerAffinity is wrong, why would you put a geographic area into it. This is to indicate what are the units he likes. What's the question otherwise? :)
Image


Hofstadter's Law: "It always takes longer than you expect, even when you take into account Hofstadter's law."

grimjaw
General
Posts: 506
Joined: Wed Feb 09, 2011 5:38 am
Location: Arkansas

Sun Oct 18, 2015 12:44 am

Ignore the AIPowerAffinity portion. I merely copied that from another model in the game (I used region b/c that was specified in the model I copied from). I couldn't find a description of AIPowerAffinity on the wiki, on the forum or through search engines.

This is mainly what I want to know:

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?

Restated a slightly different way: when a model upgrade takes place, is the original unit file/value still being used during the scenario?

unitfile_leader1 uses/refers to modelfile_leader1
modelfile_leader1 is upgraded via promotion or event to modelfile_leader2
1. unitfile_leader1 now points to modelfile_leader2?
2. unitfile_leader2 somehow replaces unitfile_leader1?
3. modelfile_leader1's values are overwritten with values from modelfile_leader2?
4. Something else?

User avatar
Pocus
Posts: 25659
Joined: Wed Oct 19, 2005 7:37 am
Location: Lyon (France)

Mon Oct 19, 2015 8:56 am

files are just the way the 'entity' is stored, so you better drop this wording, that will be less confusing. Just speak of models and units and that will be enough.

If a model upgrades, even for a leader, then the actual envelope in the game (the unit) won't upgrade automatically, unless you specify that in the unit definition, using TechAutoUpg or TrainAutoUpg (either will do). In this case, if at least 50% of the current models (so 1 as we are talking of a lone leader) are not native to the unit, then the unit will change to his TechAutoUpg unit, where you'll have put the new unit reference.
Image


Hofstadter's Law: "It always takes longer than you expect, even when you take into account Hofstadter's law."

grimjaw
General
Posts: 506
Joined: Wed Feb 09, 2011 5:38 am
Location: Arkansas

Mon Oct 19, 2015 11:25 pm

Thanks guys, this really helps.

jm

Return to “Modding AGE engine games”

Who is online

Users browsing this forum: No registered users and 6 guests