Jump to content

Need help getting custom reaction ability to use the Insanity animation


Ghostlines

Recommended Posts

This is for a psi feedback ability, a reaction triggered after being fired at by a hostile psionic power. I have the reaction ability working, I can see the damage taking place, what's missing is the power animation. I originally wanted to use the Psi Fuse animation, but that one is more complicated in several ways, so I'm backing off to something which should be simpler.

 

Unfortunately, this still isn't working for me, and I know there are modders here who are more experienced working with animations and archetypes who may know enough of what's going on under the hood to help out.

 

Also, any pointers on how to better debug animation/archetype issues like this are more than appreciated.

 

Here's the code for the reaction shot ability:

// pulse attack after ego fortress is attacked by a psi power
static function X2AbilityTemplate PsiFeedbackPulse()
{
	local X2AbilityTemplate                 Template;
	local X2AbilityCost_ReserveActionPoints ReserveActionPointCost;
	local X2Condition_UnitProperty          ShooterCondition;
	local X2AbilityTarget_Single            SingleTarget;
	local X2AbilityTrigger_Event	        Trigger;
	local X2Effect_Knockback		KnockbackEffect;
	local X2Condition_Visibility		TargetVisibilityCondition;
	local array<name>                       SkipExclusions;
	local X2Effect_ApplyWeaponDamage        WeaponDamageEffect;
	
	`CREATE_X2ABILITY_TEMPLATE(Template, 'PsiFeedbackPulse');
	Template.bShowPostActivation = TRUE;
	Template.bDontDisplayInAbilitySummary = true;
	
	ReserveActionPointCost = new class'X2AbilityCost_ReserveActionPoints';
	ReserveActionPointCost.iNumPoints = 1;
	ReserveActionPointCost.AllowedTypes.AddItem(default.PSI_FEEDBACK_ACTION_POINT);
	Template.AbilityCosts.AddItem(ReserveActionPointCost);
	
	Template.AbilityToHitCalc = default.DeadEye; // always hits

	Template.AbilityTargetConditions.AddItem(default.LivingHostileUnitDisallowMindControlProperty);
	
	TargetVisibilityCondition = new class'X2Condition_Visibility';
	TargetVisibilityCondition.bRequireGameplayVisible = false;
	TargetVisibilityCondition.bRequireBasicVisibility = false;
	TargetVisibilityCondition.bDisablePeeksOnMovement = false;
	Template.AbilityTargetConditions.AddItem(TargetVisibilityCondition);

	Template.AbilityShooterConditions.AddItem(default.LivingShooterProperty);	
	ShooterCondition = new class'X2Condition_UnitProperty';
	ShooterCondition.ExcludeConcealed = false;
	Template.AbilityShooterConditions.AddItem(ShooterCondition);

	SkipExclusions.AddItem(class'X2AbilityTemplateManager'.default.DisorientedName);
	Template.AddShooterEffectExclusions(SkipExclusions);
	
	SingleTarget = new class'X2AbilityTarget_Single';
	SingleTarget.OnlyIncludeTargetsInsideWeaponRange = false;
	Template.AbilityTargetStyle = SingleTarget;

	//Trigger on movement - interrupt the move
	Trigger = new class'X2AbilityTrigger_Event';
	Trigger.EventObserverClass = class'X2TacticalGameRuleset_MovementObserver';
	Trigger.MethodName = 'InterruptGameState';
	Template.AbilityTriggers.AddItem(Trigger);

	Template.eAbilityIconBehaviorHUD = EAbilityIconBehavior_NeverShow;
	Template.ShotHUDPriority = class'UIUtilities_Tactical'.const.OVERWATCH_PRIORITY;
	Template.bDisplayInUITooltip = false;
	Template.bDisplayInUITacticalText = false;
	Template.DisplayTargetHitChance = false;

        // playing with these fields
	Template.bSkipFireAction = false; 
	Template.bShowActivation = true;
	//Template.bSkipExitCoverWhenFiring = true;
	//Template.ActionFireClass = class'X2Action_Fire_IgniteFuse'; // from when I was trying to get fuse animation to work
	
	Template.CustomFireAnim = 'HL_Psi_MindControl';
	Template.AbilitySourceName = 'eAbilitySource_Psionic';
	Template.CinescriptCameraType = "Psionic_FireAtUnit";
	Template.BuildNewGameStateFn = TypicalAbility_BuildGameState;
	Template.BuildVisualizationFn = TypicalAbility_BuildVisualization;

	WeaponDamageEffect = new class'X2Effect_ApplyWeaponDamage';
	WeaponDamageEffect.bIgnoreBaseDamage = true;
	WeaponDamageEffect.DamageTag = 'Soulfire';
	WeaponDamageEffect.bBypassShields = true;
	Template.AddTargetEffect(WeaponDamageEffect);

	KnockbackEffect = new class'X2Effect_Knockback';
	KnockbackEffect.KnockbackDistance = 2;
	KnockbackEffect.bUseTargetLocation = true;
	Template.AddTargetEffect(KnockbackEffect);
	
	return Template;		
}

In the XCom 2 Editor, I also copied over Perk_Psi_Insanity_Common and renamed it for my ability, setting the associated ability to PsiFeedbackPulse. I also noticed the perk specific weapon was WP_Sectoid_Mindspin", which seemed wrong and didn't work. I changed this to WP_Insanity, which seems like the right weapon to reference (and yes this asset does exist).

 

When the reaction ability triggers, the unit correctly does the begin precast animation with the amplifier, but hangs when the insanity animation. Redscreen shows:

 

Perk content for PsiFeedbackPulse: None did not receive expected projectile impact.

 

Thanks in advance for any solutions or pointers!

 

 

Link to comment
Share on other sites

  • Recently Browsing   0 members

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