安装 Steam
登录
|
语言
繁體中文(繁体中文)
日本語(日语)
한국어(韩语)
ไทย(泰语)
български(保加利亚语)
Čeština(捷克语)
Dansk(丹麦语)
Deutsch(德语)
English(英语)
Español-España(西班牙语 - 西班牙)
Español - Latinoamérica(西班牙语 - 拉丁美洲)
Ελληνικά(希腊语)
Français(法语)
Italiano(意大利语)
Bahasa Indonesia(印度尼西亚语)
Magyar(匈牙利语)
Nederlands(荷兰语)
Norsk(挪威语)
Polski(波兰语)
Português(葡萄牙语 - 葡萄牙)
Português-Brasil(葡萄牙语 - 巴西)
Română(罗马尼亚语)
Русский(俄语)
Suomi(芬兰语)
Svenska(瑞典语)
Türkçe(土耳其语)
Tiếng Việt(越南语)
Українська(乌克兰语)
报告翻译问题




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!