Jump to content

Question about the new Training Centre Skills


Mettpawwz

Recommended Posts

2 Questions on this:

 

1)Where in the game's code is the full list of cross-class "XCom" skills defined?

 

2)Also, how does the game determine which promotion levels to grant these extra skills at?

 

In the XComClassData.ini file there are lots of multi-line elements like this which define the skills available at each rank:

 

; colonel
SoldierRanks=(AbilitySlots=((AbilityType=(AbilityName="RapidFire", ApplyToWeaponSlot=eInvSlot_PrimaryWeapon)), \\
(AbilityType=(AbilityName="Reaper", ApplyToWeaponSlot=eInvSlot_SecondaryWeapon))), \\
aStatProgression=((StatType=eStat_Offense,StatAmount=1), (StatType=eStat_HP,StatAmount=1), (StatType=eStat_Strength,StatAmount=1), (StatType=eStat_Hacking,StatAmount=5), (StatType=eStat_CombatSims,StatAmount=0)))

But nowhere in this line does it say whether a training centre ability should be granted at the Colonel rank or not. Based on testing it seems to be somewhat random, but is there any way to change this so that skills are always granted at the same levels guaranteed?

 

Thanks in advance.

Link to comment
Share on other sites

Those abilities are assigned when then the unit is created. The necessary code is found in

XComGamestate_Unit

und the function responsible is

function RollForTrainingCenterAbilities()
{
	local array<SoldierClassAbilityType> EligibleAbilities;
	local array<int> PossibleRanks;
	local int Idx, RemIdx, NumRanks, RankIdx, AbilityIdx;
	local X2SoldierClassTemplate SoldierClassTemplate;

	if (!bRolledForAWCAbility)
	{
		bRolledForAWCAbility = true;
		EligibleAbilities = class'X2SoldierClassTemplateManager'.static.GetSoldierClassTemplateManager().GetCrossClassAbilities(GetSoldierClassTemplate());

		SoldierClassTemplate = GetSoldierClassTemplate();
		for (Idx = 0; Idx < SoldierClassTemplate.ExcludedAbilities.Length; ++Idx)
		{
			RemIdx = EligibleAbilities.Find('AbilityName', SoldierClassTemplate.ExcludedAbilities[Idx]);
			if (RemIdx != INDEX_NONE)
				EligibleAbilities.Remove(RemIdx, 1);
		}

		if (EligibleAbilities.Length > 0)
		{
			// Set up the array of possible ranks the soldier can purchase abilities
			NumRanks = m_SoldierClassTemplate.GetMaxConfiguredRank();
			for (Idx = 1; Idx < NumRanks; Idx++)
			{
				PossibleRanks.AddItem(Idx);
			}

			for(Idx = 0; Idx < class'XComGameState_HeadquartersXCom'.default.XComHeadquarters_NumAWCAbilities; Idx++)
			{
				RankIdx = `SYNC_RAND(PossibleRanks.Length);
				AbilityIdx = `SYNC_RAND(EligibleAbilities.Length);
				AbilityTree[PossibleRanks[RankIdx]].Abilities.AddItem(EligibleAbilities[AbilityIdx]);
				
				PossibleRanks.Remove(RankIdx, 1); // Remove the rank which was chosen so it won't get picked again
				EligibleAbilities.Remove(AbilityIdx, 1); // Remove the ability which was chosen so it won't get picked again
			}
		}
	}
}

But beware this is only true for normal normal soldiers. Herosoldiers get them from a RandomAbilityDeck defined in

XComClassData.ini

To actually get a reference of all eligable crossclass abilities you have to use the Templatemanger like

 

Normal Soldiers:

EligibleAbilities = class'X2SoldierClassTemplateManager'.static.GetSoldierClassTemplateManager().GetCrossClassAbilities(SoldierClassTemplate);

Hero soldiers:

RandomAbilityDecks = SoldierClassTemplate.RandomAbilityDecks;
EligibleAbilities = RandomAbilityDecks[RandomAbilityDecks.Find('DeckName',ClassAndDeckNames[idx].Deckname)].Abilities;

if you still need help with that you can look at my mod on steam [WotC] I'm the Commander here. It lets you respec any TC ability and presents the user with only eligable choices. It also fills up missed ability slots on herosoldiers to 4 or whatever the ini setting is (max 6 though). It also introduces AP on promtion for sparks as well as TC abilities for them. Or find me on Discord: Clyde#7185.

Edited by Clyde82
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...