Jump to content

Templates Missing in Debug.


EsteemedGentleman

Recommended Posts

Hi everyone!
I've finally managed to get a successful build put together to be able to test my custom class in game though a few things have occurred which I have been trying to figure out, would appreciate some help on the matters if that would be alright?

1) A few of my templates are not loading for the ability skills and i'm not sure why as I have done them all in the same pattern, following guides etc, some of my skills (such as the ones carried from different classes, and Opportunist) appear whereas the main one that the class is supposed to learn at the start cannot seem to create it's template (or rather the game is not finding it). If anyone could see the problem and let me know what's happened I can apply that to the rest of the tree.

 

static function X2AbilityTemplate DisplacingShot()

{
local X2AbilityTemplate Template;
local X2AbilityCooldown Cooldown;
local X2AbilityToHitCalc_StandardAim ToHitCalc;
local X2Condition_Visibility TargetVisibilityCondition;
local X2AbilityCost_Ammo AmmoCost;
local X2AbilityCost_ActionPoints ActionPointCost;
local X2Effect_FlushFallBack FlushEffect;
`CREATE_X2ABILITY_TEMPLATE(Template, 'DisplacingShot');
Template.IconImage = "img:///UILibrary_Commando.DisplacingShot";
Template.AbilitySourceName = 'eAbilitySource_Perk';
Template.eAbilityIconBehaviorHUD = eAbilityIconBehavior_AlwaysShow;
Template.Hostility = eHostility_Offensive;
Template.ShotHUDPriority = class'UIUtilities_Tactical'.const.CLASS_SERGEANT_PRIORITY;
Template.AbilityConfirmSound = "TacticalUI_ActivateAbility";
Template.TargetingMethod = class'X2TargetingMethod_OverTheShoulder';
Template.bUsesFiringCamera = true;
Template.CinescriptCameraType = "StandardGunFiring";
Cooldown = new class'X2AbilityCooldown';
Cooldown.iNumTurns = default.DS_COOLDOWN;
Template.AbilityCooldown = Cooldown;
ToHitCalc = new class'X2AbilityToHitCalc_StandardAim';
ToHitCalc.BuiltInHitMod = default.DS_AIM_BONUS;
ToHitCalc.bAllowCrit = false;
Template.AbilityToHitCalc = ToHitCalc;
AmmoCost = new class'X2AbilityCost_Ammo';
AmmoCost.iAmmo = default.DS_AMMOCOST;
Template.AbilityCosts.AddItem(AmmoCost);
ActionPointCost = new class'X2AbilityCost_ActionPoints';
ActionPointCost.iNumPoints = 1;
ActionPointCost.bConsumeAllPoints = False;
Template.AbilityCosts.AddItem(ActionPointCost);
Template.AbilityTargetStyle = default.SimpleSingleTarget;
Template.AbilityTriggers.AddItem(default.PlayerInputTrigger);
Template.AbilityShooterConditions.AddItem(default.LivingShooterProperty);
Template.AddShooterEffectExclusions();
TargetVisibilityCondition = new class'X2Condition_Visibility';
TargetVisibilityCondition.bRequireGameplayVisible = true;
TargetVisibilityCondition.bAllowSquadsight = true;
Template.AbilityTargetConditions.AddItem(TargetVisibilityCondition);
Template.AbilityTargetConditions.AddItem(default.LivingHostileTargetProperty);
// Put holo target effect first because if the target dies from this shot, it will be too late to notify the effect.
Template.AddTargetEffect(class'X2Ability_GrenadierAbilitySet'.static.HoloTargetEffect());
Template.AddTargetEffect(class'X2Ability_GrenadierAbilitySet'.static.ShredderDamageEffect());
Template.bAllowAmmoEffects = False;
Template.bAllowFreeFireWeaponUpgrade = true;
//sjh Flush fleeing effect is added here
FlushEffect = new class'X2Effect_FlushFallBack';
Template.AddTargetEffect(FlushEffect);
Template.BuildNewGameStateFn = TypicalAbility_BuildGameState;
Template.BuildVisualizationFn = TypicalAbility_BuildVisualization;
Template.bCrossClassEligible = false;
return Template;
}

 

2) Following This ability tutorial (https://www.reddit.com/r/xcom2mods/comments/4f4j4t/ability_tutorial_2_modifying_a_base_game_ability/) I managed to create light em up as a skill which appears on the soldier, however it is not actually having the effect in game (firing at the start using standard shot is still ending the turn). I have created it as a pure passive on the ability list as follows:
Templates.AddItem(PurePassive(default.LightEmUpAbilityName, "img:///UILibrary_PerkIcons.UIPerk_bulletswarm"));

the rest of my code is below, it should be the same as the example one but with the skill renamed, if anyone can see where the problem is i'd appreciate the feedback :)

 

class TemplateEditors_Tactical extends UIScreenListener;

var bool bEditedTemplates;
event OnInit(UIScreen Screen)
{
if (!bEditedTemplates)
{
EditTemplates();
bEditedTemplates = true;
}
}
function EditTemplates()
{
// Add Light Em Up to the standard shot ability
AddDoNotConsumeAllAbility('StandardShot', 'LightEmUp');
}
function AddDoNotConsumeAllAbility(name LightEmUp, name PassiveLightEmUp)
{
local X2AbilityTemplateManager AbilityManager;
local X2AbilityTemplate Template;
local X2AbilityCost AbilityCost;
local X2AbilityCost_ActionPoints ActionPointCost;
AbilityManager = class'X2AbilityTemplateManager'.static.GetAbilityTemplateManager();
Template = AbilityManager.FindAbilityTemplate(LightEmUp);
foreach Template.AbilityCosts(AbilityCost)
{
ActionPointCost = X2AbilityCost_ActionPoints(AbilityCost);
if (ActionPointCost != none && ActionPointCost.DoNotConsumeAllSoldierAbilities.Find(LightEmUp) == INDEX_NONE)
{
ActionPointCost.DoNotConsumeAllSoldierAbilities.AddItem(LightEmUp);
}
}
}
defaultproperties
{
ScreenClass = "UITacticalHUD";
}


3) I have carried over Suppression from the grenadier tree however the animation red screens when I attempt to use it as it cannot play the animation, is it because I am trying to use it with a rifle? I was wondering if anyone else has rectified this issue when making a class.
if so what part of the code do I need to replace to allow it to use the rifle firing animation?

Thanks for your time as I realize these are quite chunky topics, i'll try to cut down in future.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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