Jump to content

Error, unknown Property in uc file although having copied the original one


DreizehnX

Recommended Posts

I am trying to add a new class to Xcom2. I have followed a youtube tutorial and also managed to get the custom class into the game just as the video describes.

Now I have done this again, just with another modname and classname and it worked too. Since this prototype only had one single ability I started to add additional ones.

 

I did this by adding the soldier ranks to XComClassData.ini (config folder) and adding static functions to X2Ability_JedaiiMod.uc in my classes folder.

Since I continuously got errors I plainly copied the whole text from the original XCom 2 file for the Ranger (still from the XCom SDK directory, not the actual game) so I could be sure it worked. For some reason I am still getting error messages. Now this is something I really don't understand because I have just copied from the original files...

 

Warning/Error Summary
---------------------
E:\Program Files (x86)\Steam\SteamApps\common\XCOM 2 SDK\Development\Src\JedaiiMod\Classes\X2Ability_JedaiiMod.uc(707) : Error, Unknown Property 'RAPIDFIRE_AIM' in 'Function JedaiiMod.X2Ability_JedaiiMod:RapidFire2'
E:\Program Files (x86)\Steam\SteamApps\common\XCOM 2 SDK\Development\Src\JedaiiMod\Classes\X2Ability_JedaiiMod.uc(653) : Error, Unknown Property 'RAPIDFIRE_AIM' in 'Function JedaiiMod.X2Ability_JedaiiMod:RapidFire'
E:\Program Files (x86)\Steam\SteamApps\common\XCOM 2 SDK\Development\Src\JedaiiMod\Classes\X2Ability_JedaiiMod.uc(419) : Error, Unknown Property 'SHADOWSTRIKE_AIM' in 'Function JedaiiMod.X2Ability_JedaiiMod:Shadowstrike'
E:\Program Files (x86)\Steam\SteamApps\common\XCOM 2 SDK\Development\Src\JedaiiMod\Classes\X2Ability_JedaiiMod.uc(267) : Error, Unknown Property 'REAPER_COOLDOWN' in 'Function JedaiiMod.X2Ability_JedaiiMod:Reaper'
E:\Program Files (x86)\Steam\SteamApps\common\XCOM 2 SDK\Development\Src\JedaiiMod\Classes\X2Ability_JedaiiMod.uc(131) : Error, Unknown Property 'SwordSliceName' in 'Function JedaiiMod.X2Ability_JedaiiMod:AddSwordSliceAbility'
E:\Program Files (x86)\Steam\SteamApps\common\XCOM 2 SDK\Development\Src\JedaiiMod\Classes\X2Ability_JedaiiMod.uc(120) : Error, Unknown Property 'INSTINCT_DMG' in 'Function JedaiiMod.X2Ability_JedaiiMod:AddHuntersInstinctAbility'
E:\Program Files (x86)\Steam\SteamApps\common\XCOM 2 SDK\Development\Src\JedaiiMod\Classes\X2Ability_JedaiiMod.uc(91) : Error, Unknown Property 'BLADEMASTER_DMG' in 'Function JedaiiMod.X2Ability_JedaiiMod:Blademaster'


Failure - 7 error(s), 0 warning(s) (7 Unique Errors, 0 Unique Warnings)

X2Ability_JedaiiMod.uc

 

 

// This is an Unreal Scriptclass

X2Ability_JedaiiMod extends X2Ability dependson(XComGameStateContext_Ability) config(GameData_JedaiiMod);


var config int STEALTH_CHARGES1;


static function array CreateTemplates()
{
local array Templates;
Templates.AddItem(Stealth());
Templates.AddItem(Blademaster());
Templates.AddItem(AddHuntersInstinctAbility());
Templates.AddItem(AddSwordSliceAbility());
Templates.AddItem(RunAndGunAbility('RunAndGun'));
Templates.AddItem(Reaper());
Templates.AddItem(Untouchable());
Templates.AddItem(Implacable());
Templates.AddItem(Shadowstep());
Templates.AddItem(Shadowstrike());
Templates.AddItem(Phantom());
Templates.AddItem(Bladestorm());
Templates.AddItem(BladestormAttack());
Templates.AddItem(DeepCover());
Templates.AddItem(DeepCoverTrigger());
Templates.AddItem(RapidFire());
Templates.AddItem(RapidFire2());
return Templates;
}


static function X2AbilityTemplate Stealth()
{
local X2AbilityTemplate Template;
local X2Effect_RangerStealth StealthEffect;
local X2AbilityCharges Charges;


`CREATE_X2ABILITY_TEMPLATE(Template, 'Stealth');


Template.AbilitySourceName = 'eAbilitySource_Perk';
Template.eAbilityIconBehaviorHUD = eAbilityIconBehavior_AlwaysShow;
Template.Hostility = eHostility_Neutral;
Template.IconImage = "img:///UILibrary_PerkIcons.UIPerk_stealth";
Template.ShotHUDPriority = class'UIUtilities_Tactical'.const.CLASS_COLONEL_PRIORITY;


Template.AbilityToHitCalc = default.DeadEye;
Template.AbilityTargetStyle = default.SelfTarget;
Template.AbilityTriggers.AddItem(default.PlayerInputTrigger);
Template.AbilityCosts.AddItem(new class'X2AbilityCost_Charges');
Template.AbilityCosts.AddItem(default.FreeActionCost);


Charges = new class'X2AbilityCharges';
//Charges.InitialCharges = default.STEALTH_CHARGES;
Charges.InitialCharges = default.STEALTH_CHARGES1;
Template.AbilityCharges = Charges;


Template.AbilityShooterConditions.AddItem(default.LivingShooterProperty);
Template.AbilityShooterConditions.AddItem(new class'X2Condition_Stealth');


StealthEffect = new class'X2Effect_RangerStealth';
StealthEffect.BuildPersistentEffect(1, true, true, false, eGameRule_PlayerTurnEnd);
StealthEffect.SetDisplayInfo(ePerkBuff_Bonus, Template.LocFriendlyName, Template.GetMyHelpText(), Template.IconImage, true);
StealthEffect.bRemoveWhenTargetConcealmentBroken = true;
Template.AddTargetEffect(StealthEffect);


Template.AddTargetEffect(class'X2Effect_Spotted'.static.CreateUnspottedEffect());


Template.ActivationSpeech = 'ActivateConcealment';
Template.BuildNewGameStateFn = TypicalAbility_BuildGameState;
Template.BuildVisualizationFn = TypicalAbility_BuildVisualization;
Template.bSkipFireAction = true;


return Template;
}


static function X2AbilityTemplate Blademaster()
{
local X2AbilityTemplate Template;
local X2Effect_BonusWeaponDamage DamageEffect;


// Icon Properties
`CREATE_X2ABILITY_TEMPLATE(Template, 'Blademaster');
Template.IconImage = "img:///UILibrary_PerkIcons.UIPerk_momentum";


Template.AbilitySourceName = 'eAbilitySource_Perk';
Template.eAbilityIconBehaviorHUD = EAbilityIconBehavior_NeverShow;
Template.Hostility = eHostility_Neutral;


Template.AbilityToHitCalc = default.DeadEye;
Template.AbilityTargetStyle = default.SelfTarget;
Template.AbilityTriggers.AddItem(default.UnitPostBeginPlayTrigger);


DamageEffect = new class'X2Effect_BonusWeaponDamage';
DamageEffect.BonusDmg = default.BLADEMASTER_DMG;
DamageEffect.BuildPersistentEffect(1, true, false, false);
DamageEffect.SetDisplayInfo(ePerkBuff_Passive, Template.LocFriendlyName, Template.GetMyLongDescription(), Template.IconImage, true,,Template.AbilitySourceName);
Template.AddTargetEffect(DamageEffect);


Template.BuildNewGameStateFn = TypicalAbility_BuildGameState;
// NOTE: No visualization on purpose!


return Template;
}


//******** Hunter's Instinct Ability **********
static function X2AbilityTemplate AddHuntersInstinctAbility()
{
local X2AbilityTemplate Template;
local X2Effect_HuntersInstinctDamage DamageModifier;


`CREATE_X2ABILITY_TEMPLATE(Template, 'HuntersInstinct');


Template.AbilitySourceName = 'eAbilitySource_Perk';
Template.eAbilityIconBehaviorHUD = EAbilityIconBehavior_NeverShow;
Template.Hostility = eHostility_Neutral;
Template.IconImage = "img:///UILibrary_PerkIcons.UIPerk_hunter";


Template.AbilityToHitCalc = default.DeadEye;
Template.AbilityTargetStyle = default.SelfTarget;
Template.AbilityTriggers.AddItem(default.UnitPostBeginPlayTrigger);


DamageModifier = new class'X2Effect_HuntersInstinctDamage';
DamageModifier.BonusDamage = default.INSTINCT_DMG;
DamageModifier.BuildPersistentEffect(1, true, true, true);
DamageModifier.SetDisplayInfo(ePerkBuff_Passive, Template.LocFriendlyName, Template.GetMyLongDescription(), Template.IconImage, true,,Template.AbilitySourceName);
Template.AddTargetEffect(DamageModifier);


Template.BuildNewGameStateFn = TypicalAbility_BuildGameState;
// NOTE: No visualization on purpose!


return Template;
}


static function X2AbilityTemplate AddSwordSliceAbility(optional Name AbilityName = default.SwordSliceName)
{
local X2AbilityTemplate Template;
local X2AbilityCost_ActionPoints ActionPointCost;
local X2AbilityToHitCalc_StandardMelee StandardMelee;
local X2Effect_ApplyWeaponDamage WeaponDamageEffect;
local array SkipExclusions;


`CREATE_X2ABILITY_TEMPLATE(Template, AbilityName);


Template.AbilitySourceName = 'eAbilitySource_Standard';
Template.eAbilityIconBehaviorHUD = EAbilityIconBehavior_AlwaysShow;
Template.BuildNewGameStateFn = TypicalAbility_BuildGameState;
Template.BuildVisualizationFn = TypicalAbility_BuildVisualization;
Template.CinescriptCameraType = "Ranger_Reaper";
Template.IconImage = "img:///UILibrary_PerkIcons.UIPerk_swordSlash";
Template.bHideOnClassUnlock = false;
Template.ShotHUDPriority = class'UIUtilities_Tactical'.const.CLASS_SQUADDIE_PRIORITY;
Template.AbilityConfirmSound = "TacticalUI_SwordConfirm";


ActionPointCost = new class'X2AbilityCost_ActionPoints';
ActionPointCost.iNumPoints = 1;
ActionPointCost.bConsumeAllPoints = true;
Template.AbilityCosts.AddItem(ActionPointCost);


StandardMelee = new class'X2AbilityToHitCalc_StandardMelee';
Template.AbilityToHitCalc = StandardMelee;


Template.AbilityTargetStyle = new class'X2AbilityTarget_MovingMelee';
Template.TargetingMethod = class'X2TargetingMethod_MeleePath';


Template.AbilityTriggers.AddItem(default.PlayerInputTrigger);
Template.AbilityTriggers.AddItem(new class'X2AbilityTrigger_EndOfMove');


// Target Conditions
//
Template.AbilityTargetConditions.AddItem(default.LivingHostileTargetProperty);
Template.AbilityTargetConditions.AddItem(default.MeleeVisibilityCondition);


// Shooter Conditions
//
Template.AbilityShooterConditions.AddItem(default.LivingShooterProperty);
SkipExclusions.AddItem(class'X2StatusEffects'.default.BurningName);
Template.AddShooterEffectExclusions(SkipExclusions);


// Damage Effect
//
WeaponDamageEffect = new class'X2Effect_ApplyWeaponDamage';
Template.AddTargetEffect(WeaponDamageEffect);


Template.bAllowBonusWeaponEffects = true;
Template.bSkipMoveStop = true;


// Voice events
//
Template.SourceMissSpeech = 'SwordMiss';


Template.BuildNewGameStateFn = TypicalMoveEndAbility_BuildGameState;
Template.BuildInterruptGameStateFn = TypicalMoveEndAbility_BuildInterruptGameState;


return Template;
}


static function X2AbilityTemplate RunAndGunAbility(Name AbilityName)
{
local X2AbilityTemplate Template;
local X2AbilityCooldown Cooldown;
local X2Effect_GrantActionPoints ActionPointEffect;
local X2AbilityCost_ActionPoints ActionPointCost;


`CREATE_X2ABILITY_TEMPLATE(Template, AbilityName);


// Icon Properties
Template.DisplayTargetHitChance = false;
Template.AbilitySourceName = 'eAbilitySource_Perk'; // color of the icon
Template.IconImage = "img:///UILibrary_PerkIcons.UIPerk_runandgun";
Template.ShotHUDPriority = class'UIUtilities_Tactical'.const.CLASS_LIEUTENANT_PRIORITY;
Template.Hostility = eHostility_Neutral;
Template.eAbilityIconBehaviorHUD = eAbilityIconBehavior_AlwaysShow;
Template.AbilityConfirmSound = "TacticalUI_Activate_Ability_Run_N_Gun";


Cooldown = new class'X2AbilityCooldown';
Cooldown.iNumTurns = 4;
Template.AbilityCooldown = Cooldown;


ActionPointCost = new class'X2AbilityCost_ActionPoints';
ActionPointCost.iNumPoints = 1;
ActionPointCost.bFreeCost = true;
Template.AbilityCosts.AddItem(ActionPointCost);


Template.AbilityToHitCalc = default.DeadEye;


SuperKillRestrictions(Template, 'RunAndGun_SuperKillCheck');
Template.AbilityShooterConditions.AddItem(default.LivingShooterProperty);
Template.AddShooterEffectExclusions();


ActionPointEffect = new class'X2Effect_GrantActionPoints';
ActionPointEffect.NumActionPoints = 1;
ActionPointEffect.PointType = class'X2CharacterTemplateManager'.default.RunAndGunActionPoint;
Template.AddTargetEffect(ActionPointEffect);


Template.AbilityTargetStyle = default.SelfTarget;
Template.AbilityTriggers.AddItem(default.PlayerInputTrigger);


Template.bShowActivation = true;
Template.bSkipFireAction = true;


Template.ActivationSpeech = 'RunAndGun';


Template.BuildNewGameStateFn = TypicalAbility_BuildGameState;
Template.BuildVisualizationFn = TypicalAbility_BuildVisualization;


Template.bCrossClassEligible = true;


return Template;
}


static function X2AbilityTemplate Reaper()
{
local X2AbilityTemplate Template;
local X2AbilityCooldown Cooldown;
local X2Effect_Reaper ReaperEffect;
local X2AbilityCost_ActionPoints ActionPointCost;


`CREATE_X2ABILITY_TEMPLATE(Template, 'Reaper');


// Icon Properties
Template.DisplayTargetHitChance = false;
Template.AbilitySourceName = 'eAbilitySource_Perk'; // color of the icon
Template.IconImage = "img:///UILibrary_PerkIcons.UIPerk_reaper";
Template.ShotHUDPriority = class'UIUtilities_Tactical'.const.CLASS_COLONEL_PRIORITY;
Template.Hostility = eHostility_Neutral;
Template.eAbilityIconBehaviorHUD = eAbilityIconBehavior_AlwaysShow;
Template.AbilityConfirmSound = "TacticalUI_ActivateAbility";


Cooldown = new class'X2AbilityCooldown';
Cooldown.iNumTurns = default.REAPER_COOLDOWN;
Template.AbilityCooldown = Cooldown;


ActionPointCost = new class'X2AbilityCost_ActionPoints';
ActionPointCost.iNumPoints = 1;
ActionPointCost.bFreeCost = true;
Template.AbilityCosts.AddItem(ActionPointCost);


Template.AbilityToHitCalc = default.DeadEye;


SuperKillRestrictions(Template, 'Reaper_SuperKillCheck');
Template.AbilityShooterConditions.AddItem(default.LivingShooterProperty);
Template.AddShooterEffectExclusions();


ReaperEffect = new class'X2Effect_Reaper';
ReaperEffect.BuildPersistentEffect(1, false, true, false, eGameRule_PlayerTurnEnd);
ReaperEffect.SetDisplayInfo(ePerkBuff_Bonus, Template.LocFriendlyName, Template.GetMyHelpText(), Template.IconImage, true, , Template.AbilitySourceName);
Template.AddTargetEffect(ReaperEffect);


Template.AbilityTargetStyle = default.SelfTarget;
Template.AbilityTriggers.AddItem(default.PlayerInputTrigger);


Template.bShowActivation = true;
Template.bSkipFireAction = true;


Template.ActivationSpeech = 'Reaper';


Template.BuildNewGameStateFn = TypicalAbility_BuildGameState;
Template.BuildVisualizationFn = TypicalAbility_BuildVisualization;


return Template;
}


static function X2AbilityTemplate Untouchable()
{
local X2AbilityTemplate Template;
local X2AbilityTargetStyle TargetStyle;
local X2AbilityTrigger Trigger;
local X2Effect_Untouchable UntouchableEffect;


`CREATE_X2ABILITY_TEMPLATE(Template, 'Untouchable');


Template.AbilitySourceName = 'eAbilitySource_Perk';
Template.eAbilityIconBehaviorHUD = EAbilityIconBehavior_NeverShow;
Template.Hostility = eHostility_Neutral;
Template.IconImage = "img:///UILibrary_PerkIcons.UIPerk_evasion";


Template.AbilityToHitCalc = default.DeadEye;


TargetStyle = new class'X2AbilityTarget_Self';
Template.AbilityTargetStyle = TargetStyle;


Trigger = new class'X2AbilityTrigger_UnitPostBeginPlay';
Template.AbilityTriggers.AddItem(Trigger);


UntouchableEffect = new class'X2Effect_Untouchable';
UntouchableEffect.BuildPersistentEffect(1, true, false, false);
UntouchableEffect.SetDisplayInfo(ePerkBuff_Passive, Template.LocFriendlyName, Template.GetMyLongDescription(), Template.IconImage,,,Template.AbilitySourceName);
UntouchableEffect.DuplicateResponse = eDupe_Ignore;
Template.AddTargetEffect(UntouchableEffect);


Template.BuildNewGameStateFn = TypicalAbility_BuildGameState;
// NOTE: No visualization on purpose!


Template.bCrossClassEligible = true;


return Template;
}


static function X2AbilityTemplate Implacable()
{
local X2AbilityTemplate Template;
local X2Effect_Implacable ImplacableEffect;


`CREATE_X2ABILITY_TEMPLATE(Template, 'Implacable');


Template.AbilitySourceName = 'eAbilitySource_Perk';
Template.eAbilityIconBehaviorHUD = EAbilityIconBehavior_NeverShow;
Template.Hostility = eHostility_Neutral;
Template.IconImage = "img:///UILibrary_PerkIcons.UIPerk_implacable";


Template.AbilityToHitCalc = default.DeadEye;
Template.AbilityTargetStyle = default.SelfTarget;
Template.AbilityTriggers.AddItem(default.UnitPostBeginPlayTrigger);


ImplacableEffect = new class'X2Effect_Implacable';
ImplacableEffect.BuildPersistentEffect(1, true, false, false);
ImplacableEffect.SetDisplayInfo(ePerkBuff_Passive, Template.LocFriendlyName, Template.GetMyLongDescription(), Template.IconImage,,,Template.AbilitySourceName);
ImplacableEffect.DuplicateResponse = eDupe_Ignore;
Template.AddTargetEffect(ImplacableEffect);


Template.BuildNewGameStateFn = TypicalAbility_BuildGameState;
// NOTE: No visualization on purpose!


Template.bCrossClassEligible = true;


return Template;
}


static function X2AbilityTemplate Shadowstep()
{
local X2AbilityTemplate Template;
local X2Effect_Persistent Effect;


`CREATE_X2ABILITY_TEMPLATE(Template, 'Shadowstep');


Template.AbilitySourceName = 'eAbilitySource_Perk';
Template.eAbilityIconBehaviorHUD = eAbilityIconBehavior_NeverShow;
Template.Hostility = eHostility_Neutral;
Template.IconImage = "img:///UILibrary_PerkIcons.UIPerk_shadowstep";


Template.AbilityToHitCalc = default.DeadEye;
Template.AbilityTargetStyle = default.SelfTarget;
Template.AbilityTriggers.AddItem(default.UnitPostBeginPlayTrigger);


Effect = new class'X2Effect_Persistent';
Effect.EffectName = 'Shadowstep';
Effect.DuplicateResponse = eDupe_Ignore;
Effect.BuildPersistentEffect(1, true, false);
Effect.SetDisplayInfo(ePerkBuff_Passive, Template.LocFriendlyName, Template.GetMyLongDescription(), Template.IconImage,,,Template.AbilitySourceName);
Template.AddTargetEffect(Effect);


Template.BuildNewGameStateFn = TypicalAbility_BuildGameState;
// NOTE: No visualization on purpose!


Template.bCrossClassEligible = true;


return Template;
}


static function X2AbilityTemplate Shadowstrike()
{
local X2AbilityTemplate Template;
local X2Effect_ToHitModifier Effect;
local X2Condition_Visibility VisCondition;


`CREATE_X2ABILITY_TEMPLATE(Template, 'Shadowstrike');


Template.AbilitySourceName = 'eAbilitySource_Perk';
Template.eAbilityIconBehaviorHUD = eAbilityIconBehavior_NeverShow;
Template.Hostility = eHostility_Neutral;
Template.IconImage = "img:///UILibrary_PerkIcons.UIPerk_shadowstrike";


Template.AbilityToHitCalc = default.DeadEye;
Template.AbilityTargetStyle = default.SelfTarget;
Template.AbilityTriggers.AddItem(default.UnitPostBeginPlayTrigger);


Effect = new class'X2Effect_ToHitModifier';
Effect.EffectName = 'Shadowstrike';
Effect.DuplicateResponse = eDupe_Ignore;
Effect.BuildPersistentEffect(1, true, false);
Effect.SetDisplayInfo(ePerkBuff_Passive, Template.LocFriendlyName, Template.GetMyLongDescription(), Template.IconImage,,,Template.AbilitySourceName);
Effect.AddEffectHitModifier(eHit_Success, default.SHADOWSTRIKE_AIM, Template.LocFriendlyName);
Effect.AddEffectHitModifier(eHit_Crit, default.SHADOWSTRIKE_CRIT, Template.LocFriendlyName);
VisCondition = new class'X2Condition_Visibility';
VisCondition.bExcludeGameplayVisible = true;
Effect.ToHitConditions.AddItem(VisCondition);
Template.AddTargetEffect(Effect);


Template.BuildNewGameStateFn = TypicalAbility_BuildGameState;
// NOTE: No visualization on purpose!


return Template;
}


static function X2AbilityTemplate Phantom()
{
local X2AbilityTemplate Template;
local X2Effect_Persistent Effect;


`CREATE_X2ABILITY_TEMPLATE(Template, 'Phantom');


Template.AbilitySourceName = 'eAbilitySource_Perk';
Template.eAbilityIconBehaviorHUD = eAbilityIconBehavior_NeverShow;
Template.Hostility = eHostility_Neutral;
Template.IconImage = "img:///UILibrary_PerkIcons.UIPerk_phantom";


Template.AbilityToHitCalc = default.DeadEye;
Template.AbilityTargetStyle = default.SelfTarget;
Template.AbilityTriggers.AddItem(default.UnitPostBeginPlayTrigger);


Effect = new class'X2Effect_StayConcealed';
Effect.BuildPersistentEffect(1, true, false);
Effect.SetDisplayInfo(ePerkBuff_Passive, Template.LocFriendlyName, Template.GetMyLongDescription(), Template.IconImage,,,Template.AbilitySourceName);
Template.AddTargetEffect(Effect);


Template.BuildNewGameStateFn = TypicalAbility_BuildGameState;
// NOTE: No visualization on purpose!


Template.bCrossClassEligible = true;


return Template;
}


static function X2AbilityTemplate Bladestorm()
{
local X2AbilityTemplate Template;


Template = PurePassive('Bladestorm', "img:///UILibrary_PerkIcons.UIPerk_bladestorm", false, 'eAbilitySource_Perk');
Template.AdditionalAbilities.AddItem('BladestormAttack');


return Template;
}


static function X2AbilityTemplate BladestormAttack()
{
local X2AbilityTemplate Template;
local X2AbilityToHitCalc_StandardMelee ToHitCalc;
local X2AbilityTrigger_Event Trigger;
local X2Effect_Persistent BladestormTargetEffect;
local X2Condition_UnitEffectsWithAbilitySource BladestormTargetCondition;
local X2AbilityTrigger_EventListener EventListener;
local X2Condition_UnitProperty SourceNotConcealedCondition;
local X2Condition_Visibility TargetVisibilityCondition;


`CREATE_X2ABILITY_TEMPLATE(Template, 'BladestormAttack');


Template.AbilitySourceName = 'eAbilitySource_Perk';
Template.eAbilityIconBehaviorHUD = eAbilityIconBehavior_NeverShow;
Template.IconImage = "img:///UILibrary_PerkIcons.UIPerk_bladestorm";
Template.ShotHUDPriority = class'UIUtilities_Tactical'.const.CLASS_CAPTAIN_PRIORITY;


ToHitCalc = new class'X2AbilityToHitCalc_StandardMelee';
ToHitCalc.bReactionFire = true;
Template.AbilityToHitCalc = ToHitCalc;
Template.AbilityTargetStyle = default.SimpleSingleMeleeTarget;


// trigger on movement
Trigger = new class'X2AbilityTrigger_Event';
Trigger.EventObserverClass = class'X2TacticalGameRuleset_MovementObserver';
Trigger.MethodName = 'InterruptGameState';
Template.AbilityTriggers.AddItem(Trigger);
Trigger = new class'X2AbilityTrigger_Event';
Trigger.EventObserverClass = class'X2TacticalGameRuleset_MovementObserver';
Trigger.MethodName = 'PostBuildGameState';
Template.AbilityTriggers.AddItem(Trigger);
// trigger on an attack
Trigger = new class'X2AbilityTrigger_Event';
Trigger.EventObserverClass = class'X2TacticalGameRuleset_AttackObserver';
Trigger.MethodName = 'InterruptGameState';
Template.AbilityTriggers.AddItem(Trigger);


// it may be the case that enemy movement caused a concealment break, which made Bladestorm applicable - attempt to trigger afterwards
EventListener = new class'X2AbilityTrigger_EventListener';
EventListener.ListenerData.Deferral = ELD_OnStateSubmitted;
EventListener.ListenerData.EventID = 'UnitConcealmentBroken';
EventListener.ListenerData.Filter = eFilter_Unit;
EventListener.ListenerData.EventFn = BladestormConcealmentListener;
EventListener.ListenerData.Priority = 55;
Template.AbilityTriggers.AddItem(EventListener);


Template.AbilityTargetConditions.AddItem(default.LivingHostileUnitDisallowMindControlProperty);
TargetVisibilityCondition = new class'X2Condition_Visibility';
TargetVisibilityCondition.bRequireGameplayVisible = true;
TargetVisibilityCondition.bRequireBasicVisibility = true;
TargetVisibilityCondition.bDisablePeeksOnMovement = true; //Don't use peek tiles for over watch shots
Template.AbilityTargetConditions.AddItem(TargetVisibilityCondition);
Template.AbilityTargetConditions.AddItem(class'X2Ability_DefaultAbilitySet'.static.OverwatchTargetEffectsCondition());


Template.AbilityShooterConditions.AddItem(default.LivingShooterProperty);
Template.AddShooterEffectExclusions();


//Don't trigger when the source is concealed
SourceNotConcealedCondition = new class'X2Condition_UnitProperty';
SourceNotConcealedCondition.ExcludeConcealed = true;
Template.AbilityShooterConditions.AddItem(SourceNotConcealedCondition);


Template.bAllowBonusWeaponEffects = true;
Template.AddTargetEffect(new class'X2Effect_ApplyWeaponDamage');


//Prevent repeatedly hammering on a unit with Bladestorm triggers.
//(This effect does nothing, but enables many-to-many marking of which Bladestorm attacks have already occurred each turn.)
BladestormTargetEffect = new class'X2Effect_Persistent';
BladestormTargetEffect.BuildPersistentEffect(1, false, true, true, eGameRule_PlayerTurnEnd);
BladestormTargetEffect.EffectName = 'BladestormTarget';
BladestormTargetEffect.bApplyOnMiss = true; //Only one chance, even if you miss (prevents crazy flailing counter-attack chains with a Muton, for example)
Template.AddTargetEffect(BladestormTargetEffect);


BladestormTargetCondition = new class'X2Condition_UnitEffectsWithAbilitySource';
BladestormTargetCondition.AddExcludeEffect('BladestormTarget', 'AA_DuplicateEffectIgnored');
Template.AbilityTargetConditions.AddItem(BladestormTargetCondition);




Template.BuildNewGameStateFn = TypicalAbility_BuildGameState;
Template.BuildVisualizationFn = TypicalAbility_BuildVisualization;
Template.bShowActivation = true;


return Template;
}


//Must be static, because it will be called with a different object (an XComGameState_Ability)
//Used to trigger Bladestorm when the source's concealment is broken by a unit in melee range (the regular movement triggers get called too soon)
static function EventListenerReturn BladestormConcealmentListener(Object EventData, Object EventSource, XComGameState GameState, Name EventID)
{
local XComGameStateContext_Ability AbilityContext;
local XComGameState_Unit ConcealmentBrokenUnit;
local StateObjectReference BladestormRef;
local XComGameState_Ability BladestormState;
local XComGameStateHistory History;


History = `XCOMHISTORY;


ConcealmentBrokenUnit = XComGameState_Unit(EventSource);
if (ConcealmentBrokenUnit == None)
return ELR_NoInterrupt;


//Do not trigger if the Bladestorm Ranger himself moved to cause the concealment break - only when an enemy moved and caused it.
AbilityContext = XComGameStateContext_Ability(GameState.GetContext().GetFirstStateInEventChain().GetContext());
if (AbilityContext != None && AbilityContext.InputContext.SourceObject != ConcealmentBrokenUnit.ConcealmentBrokenByUnitRef)
return ELR_NoInterrupt;


BladestormRef = ConcealmentBrokenUnit.FindAbility('BladestormAttack');
if (BladestormRef.ObjectID == 0)
return ELR_NoInterrupt;


BladestormState = XComGameState_Ability(History.GetGameStateForObjectID(BladestormRef.ObjectID));
if (BladestormState == None)
return ELR_NoInterrupt;


BladestormState.AbilityTriggerAgainstSingleTarget(ConcealmentBrokenUnit.ConcealmentBrokenByUnitRef, false);
return ELR_NoInterrupt;
}


static function X2AbilityTemplate DeepCover()
{
local X2AbilityTemplate Template;


Template = PurePassive('DeepCover', "img:///UILibrary_PerkIcons.UIPerk_one_for_all");
Template.AdditionalAbilities.AddItem('DeepCoverTrigger');


Template.bCrossClassEligible = true;


return Template;
}


static function X2AbilityTemplate DeepCoverTrigger()
{
local X2AbilityTemplate Template;
local X2AbilityTrigger_EventListener Trigger;


`CREATE_X2ABILITY_TEMPLATE(Template, 'DeepCoverTrigger');


Template.AbilityToHitCalc = default.DeadEye;
Template.AbilityShooterConditions.AddItem(default.LivingShooterProperty);
Template.AbilityTargetStyle = default.SelfTarget;
Template.eAbilityIconBehaviorHUD = eAbilityIconBehavior_NeverShow;
Template.Hostility = eHostility_Neutral;


Trigger = new class'X2AbilityTrigger_EventListener';
Trigger.ListenerData.Deferral = ELD_OnStateSubmitted;
Trigger.ListenerData.EventID = 'PlayerTurnEnded';
Trigger.ListenerData.Filter = eFilter_Player;
Trigger.ListenerData.EventFn = class'XComGameState_Ability'.static.DeepCoverTurnEndListener;
Template.AbilityTriggers.AddItem(Trigger);


Template.BuildNewGameStateFn = TypicalAbility_BuildGameState;


return Template;
}


static function X2AbilityTemplate RapidFire()
{
local X2AbilityTemplate Template;
local X2AbilityCost_ActionPoints ActionPointCost;
local X2AbilityCost_Ammo AmmoCost;
local X2AbilityToHitCalc_StandardAim ToHitCalc;


`CREATE_X2ABILITY_TEMPLATE(Template, 'RapidFire');


ActionPointCost = new class'X2AbilityCost_ActionPoints';
ActionPointCost.iNumPoints = 0;
ActionPointCost.bAddWeaponTypicalCost = true;
ActionPointCost.bConsumeAllPoints = true;
Template.AbilityCosts.AddItem(ActionPointCost);


// require 2 ammo to be present so that both shots can be taken
AmmoCost = new class'X2AbilityCost_Ammo';
AmmoCost.iAmmo = 2;
AmmoCost.bFreeCost = true;
Template.AbilityCosts.AddItem(AmmoCost);
// actually charge 1 ammo for this shot. the 2nd shot will charge the extra ammo.
AmmoCost = new class'X2AbilityCost_Ammo';
AmmoCost.iAmmo = 1;
Template.AbilityCosts.AddItem(AmmoCost);


ToHitCalc = new class'X2AbilityToHitCalc_StandardAim';
ToHitCalc.BuiltInHitMod = default.RAPIDFIRE_AIM;
Template.AbilityToHitCalc = ToHitCalc;
Template.AbilityToHitOwnerOnMissCalc = ToHitCalc;


Template.AbilityTargetStyle = default.SimpleSingleTarget;


Template.AbilityShooterConditions.AddItem(default.LivingShooterProperty);
Template.AddShooterEffectExclusions();


Template.AbilityTargetConditions.AddItem(default.LivingHostileTargetProperty);
Template.AbilityTargetConditions.AddItem(default.GameplayVisibilityCondition);


Template.AddTargetEffect(class'X2Ability_GrenadierAbilitySet'.static.HoloTargetEffect());
Template.AssociatedPassives.AddItem('HoloTargeting');
Template.AddTargetEffect(class'X2Ability_GrenadierAbilitySet'.static.ShredderDamageEffect());
Template.bAllowAmmoEffects = true;


Template.AbilityTriggers.AddItem(default.PlayerInputTrigger);


Template.ShotHUDPriority = class'UIUtilities_Tactical'.const.CLASS_COLONEL_PRIORITY;
Template.AbilitySourceName = 'eAbilitySource_Perk';
Template.eAbilityIconBehaviorHUD = eAbilityIconBehavior_AlwaysShow;
Template.IconImage = "img:///UILibrary_PerkIcons.UIPerk_rapidfire";
Template.AbilityConfirmSound = "TacticalUI_ActivateAbility";
Template.CinescriptCameraType = "StandardGunFiring";
Template.TargetingMethod = class'X2TargetingMethod_OverTheShoulder';


Template.BuildNewGameStateFn = TypicalAbility_BuildGameState;
Template.BuildVisualizationFn = TypicalAbility_BuildVisualization;
Template.BuildInterruptGameStateFn = TypicalAbility_BuildInterruptGameState;


Template.AdditionalAbilities.AddItem('RapidFire2');
Template.PostActivationEvents.AddItem('RapidFire2');


Template.bCrossClassEligible = true;
Template.bPreventsTargetTeleport = true;


return Template;
}


static function X2AbilityTemplate RapidFire2()
{
local X2AbilityTemplate Template;
local X2AbilityCost_Ammo AmmoCost;
local X2AbilityToHitCalc_StandardAim ToHitCalc;
local X2AbilityTrigger_EventListener Trigger;


`CREATE_X2ABILITY_TEMPLATE(Template, 'RapidFire2');


AmmoCost = new class'X2AbilityCost_Ammo';
AmmoCost.iAmmo = 1;
Template.AbilityCosts.AddItem(AmmoCost);


ToHitCalc = new class'X2AbilityToHitCalc_StandardAim';
ToHitCalc.BuiltInHitMod = default.RAPIDFIRE_AIM;
Template.AbilityToHitCalc = ToHitCalc;
Template.AbilityToHitOwnerOnMissCalc = ToHitCalc;


Template.AbilityTargetStyle = default.SimpleSingleTarget;


Template.AbilityShooterConditions.AddItem(default.LivingShooterProperty);
Template.AddShooterEffectExclusions();


Template.AbilityTargetConditions.AddItem(default.LivingHostileTargetProperty);


Template.AddTargetEffect(class'X2Ability_GrenadierAbilitySet'.static.HoloTargetEffect());
Template.AssociatedPassives.AddItem('HoloTargeting');
Template.AddTargetEffect(class'X2Ability_GrenadierAbilitySet'.static.ShredderDamageEffect());
Template.bAllowAmmoEffects = true;


Trigger = new class'X2AbilityTrigger_EventListener';
Trigger.ListenerData.Deferral = ELD_OnStateSubmitted;
Trigger.ListenerData.EventID = 'RapidFire2';
Trigger.ListenerData.Filter = eFilter_Unit;
Trigger.ListenerData.EventFn = class'XComGameState_Ability'.static.RapidFireListener;
Template.AbilityTriggers.AddItem(Trigger);


Template.ShotHUDPriority = class'UIUtilities_Tactical'.const.CLASS_COLONEL_PRIORITY;
Template.AbilitySourceName = 'eAbilitySource_Perk';
Template.eAbilityIconBehaviorHUD = eAbilityIconBehavior_NeverShow;
Template.IconImage = "img:///UILibrary_PerkIcons.UIPerk_rapidfire";
Template.CinescriptCameraType = "StandardGunFiring";


Template.BuildNewGameStateFn = TypicalAbility_BuildGameState;
Template.BuildVisualizationFn = TypicalAbility_BuildVisualization;
Template.bShowActivation = true;


return Template;
}


static function SuperKillRestrictions(X2AbilityTemplate Template, name ThisSuperKill)
{
local X2Condition_UnitValue ValueCondition;
local X2Effect_SetUnitValue ValueEffect;


ValueCondition = new class'X2Condition_UnitValue';
ValueCondition.AddCheckValue('RunAndGun_SuperKillCheck', 0, eCheck_Exact,,,'AA_RunAndGunUsed');
ValueCondition.AddCheckValue('Reaper_SuperKillCheck', 0, eCheck_Exact,,,'AA_ReaperUsed');
ValueCondition.AddCheckValue('Serial_SuperKillCheck', 0, eCheck_Exact,,,'AA_SerialUsed');
Template.AbilityShooterConditions.AddItem(ValueCondition);


ValueEffect = new class'X2Effect_SetUnitValue';
ValueEffect.UnitName = ThisSuperKill;
ValueEffect.NewValueToSet = 1;
ValueEffect.CleanupType = eCleanup_BeginTurn;
Template.AddShooterEffect(ValueEffect);
}


DefaultProperties
{
SwordSliceName="SwordSlice"
}

 

 

Can you please help my understanding where the errors are?

Edited by DreizehnX
Link to comment
Share on other sites

In the future please either use spoiler tags, or put the whole code file in another location such as pastebin and put the link here.

 

This is a problem of "extending". There is X2Ability. Then X2Ability_RangerAbilityset "extends" that and adds more stuff. What you think you are doing (I believe) is extending X2Ability_RangerAbilitySet, so that anything defined in that file can be used by yours. Unfortunately what you actually did is extend X2Ability. So, stuff which is defined in the ranger file is not visible to you.

 

Change the line:

class X2Ability_JedaiiMod extends X2Ability

to:

class X2Ability_JedaiiMod extends X2Ability_RangerAbilitySet

Link to comment
Share on other sites

You probably didn't copy the "var int" stuff at the beginning of the RangerAbilitySet.uc file, which might be why you're getting those errors.

 

And IIRC, you can just slap the Ranger skills into the ClassData.ini skill tree and remove them from your custom class's ability file.

Link to comment
Share on other sites

In the future please either use spoiler tags, or put the whole code file in another location such as pastebin and put the link here.

 

This is a problem of "extending". There is X2Ability. Then X2Ability_RangerAbilityset "extends" that and adds more stuff. What you think you are doing (I believe) is extending X2Ability_RangerAbilitySet, so that anything defined in that file can be used by yours. Unfortunately what you actually did is extend X2Ability. So, stuff which is defined in the ranger file is not visible to you.

 

Change the line:

class X2Ability_JedaiiMod extends X2Ability

to:

class X2Ability_JedaiiMod extends X2Ability_RangerAbilitySet

 

Thank you and sorry - I have edited my post to lessen the wall of text.

From what I understand my new class should do the same as X2Ability_RangerAbilitySet does; extending the original X2Ability.

After I have changed my headline to class X2Ability_JedaiiMod extends X2Ability_RangerAbilitySet I get no more errors. It just seems to my as if I now add something to the original ranger calss because I'm extending the RangerAbilitySet. Do I missunderstand this?

The reason why I chose to copy the ranger was because I wanted to have the SwordSlice as automatically unlocked ability after the soldier gets promoted to squaddie. After my custom class was in the game with the ranger-like abilities I wanted to change the skills with those of other soldiers (eventually with alien skills in case that is even possible).

 

For some reason, when I start debugging, my custom soldier now has Reaper has his first/squaddie ability.

 

This:

// This is an Unreal Scriptclass X2Ability_JedaiiMod extends X2Ability dependson(XComGameStateContext_Ability) config(GameData_JedaiiMod);

into:

// This is an Unreal Script
class X2Ability_JedaiiMod extends X2Ability dependson(XComGameStateContext_Ability) config(GameData_JedaiiMod);

?

This was my fault when coyping the code into my post. The unreal script has the line break.

 

You probably didn't copy the "var int" stuff at the beginning of the RangerAbilitySet.uc file, which might be why you're getting those errors.

 

And IIRC, you can just slap the Ranger skills into the ClassData.ini skill tree and remove them from your custom class's ability file.

At first I tried only using the ini files (I followed this guide I have found in davidlallen's signature and copied the steps 1:1) but my custom class never showed up in the game. After using this other guide that involved the uc script I managed to have the custom class visible in the game.

 

Thank you all very much for your help.

 

In case it is important: My XComClassData.ini looks like this.

Link to comment
Share on other sites

Sorry for the doublepost but... yesterday and today I kept trying to edit my uc file to find a solution for my ability-problem.. After not succeeding at all I copied the code I have posted in this topic and changed the headline to

class X2Ability_JedaiiMod extends X2Ability_RangerAbilitySet

as davidlallen told in his post. Now I'm getting a new error:

E:\Program Files (x86)\Steam\SteamApps\common\XCOM 2 SDK\Development\Src\JedaiiMod\Classes\X2Ability_JedaiiMod.uc(9) : Error, Missing '<' in 'array'

The line 9 is leading to my

static function array CreateTemplates()

...which is the same as it had been before - I just get an error while it was no problem before.

Link to comment
Share on other sites

Many compilers stop upon the first error. So, if you fix one error, you may get a new error, because the compiler stopped before checking for the second error. If you closely compare your line against other similar lines, you will see the problem. A proper line looks like this:

 

static function array<X2DataTemplate> CreateTemplates()

Link to comment
Share on other sites

  • Recently Browsing   0 members

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