XCOM 2
Welcome to the Resistance
Create your own aliens, weapons, maps, and other content to expand the XCOM2 universe
Trying to make GTS unlocks for modded class
Been struggling to get it to work. Looking at the modding guide on reddit for reference ( https://www.reddit.com/r/xcom2mods/wiki/gtsunlocks/ ) but I must be missing something because they don't show up in game. Tried a bunch of different times. Is anyone able to tell what I'm doing wrong?

My src file looks like this:

class X2StrategyElement_ModernBreacherGTS extends X2StrategyElement;

static function array<X2DataTemplate> CreateTemplates()
{
local array<X2DataTemplate> Templates;

Templates.AddItem(Create_GTS_Unlock(MZPartnerFlankBreacherGTSUnlock));

return Templates;
}

static function X2SoldierAbilityUnlockTemplate Create_GTS_Unlock(MZPartnerFlankBreacherGTSUnlock)
{
local X2SoldierAbilityUnlockTemplate Template;

`CREATE_X2TEMPLATE(class'X2SoldierAbilityUnlockTemplate', Template, 'MZPartnerFlankBreacherGTSUnlock');

Template.AllowedClasses.AddItem('ModernBreacher');

Template.AbilityName = 'MZPartnerFlank';
Template.strImage = "img:///SurplusPack.Blue.ermine";


return Template;
}

static event OnPostTemplatesCreated()
{
AddGTSUnlockTemplate('MZPartnerFlankBreacherGTSUnlock');
}

static private function AddGTSUnlockTemplate(MZPartnerFlankBreacherGTSUnlock)
{
local X2StrategyElementTemplateManager TechMgr;
local X2FacilityTemplate Template;
local array<X2DataTemplate> DifficultyVariants;
local X2DataTemplate DifficultyVariant;

TechMgr = class'X2StrategyElementTemplateManager'.static.GetStrategyElementTemplateManager();

TechMgr.FindDataTemplateAllDifficulties('OfficerTrainingSchool', DifficultyVariants);

foreach DifficultyVariants(DifficultyVariant)
{
Template = X2FacilityTemplate(DifficultyVariant);
if (Template != none)
{
Template.SoldierUnlockTemplates.AddItem(MZPartnerFlankBreacherGTSUnlock);
}
}
}
Last edited by Maprikan; 13 Jan @ 1:03pm
< >
Showing 1-2 of 2 comments
The OnPostTemplatesCreated must go into a class that extends X2DownloadableContentInfo in order to do anything.
If you require further assistance, come to the modmaking discord: https://discord.gg/ZytsZ93
Thanks, looks like the problem is something else. Taking another crack at it to see if I can figure it out
< >
Showing 1-2 of 2 comments
Per page: 1530 50