Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
static event OnPostTemplatesCreated()
{
local int i;
local array <int> Array1, Array2;
for (i = 0; i < 5; i++)
Array1.AddItem(i);
Array2 = Array1;
for(i = 0; i < 5; i++)
Array2 = -1;
for(i = 0; i < 5; i++)
`log("Array1[" $ i $ "]:" $ Array1 $ " Array2[" $ i $ "]:" $ Array2, , 'Array Test---');
}
Results in an output of:
[0005.82] Array Test---: Array1[0]:0 Array2[0]:-1
[0005.82] Array Test---: Array1[1]:1 Array2[1]:-1
[0005.82] Array Test---: Array1[2]:2 Array2[2]:-1
[0005.82] Array Test---: Array1[3]:3 Array2[3]:-1
[0005.82] Array Test---: Array1[4]:4 Array2[4]:-1
So that rules out a programmatic change through altering the TrainingPrograms array, and we can't access the SoldierRanks array to get at the SoldierClassRank so we can replace the TrainingPrograms array.
I think that only leaves one possible approach, overriding the DefaultClassData.ini values.
How do we override these, such that we can add a training ability at a certain rank?
EDIT
I'm refreshing myself on overriding ini files, so my question is related to the ability / rank tree itself. It looks like there's nothing in each SoldierRanks line that associates an entry to a rank, it's just the natural order of repeated SoldierRanks lines in the file that determine this.
So for overriding this, would I have to - out the entire tree, and renter it all with my additional training program? That doesn't quite feel right, and would likely conflict with anyone else that's doing a similar ability tree change.
Is there a better way to do this? Seems like multiple training program additions from mods are ripe for conflicts with this approach.
If we create a subclass of X2SoldierClassTemplate, any function within can access the protected SoldierRanks array, allowing us to insert training directly into the appropriate place in the structure.
Something like this:
With that, from elsewhere, we can insert our training template where it needs to be:
Now to troubleshoot the trained ability, but relieved to have found a good means of adding custom training!
Feel free to reuse something like this in your own custom mods!