Krazyguy75 Posted February 25, 2016 Share Posted February 25, 2016 So I'm attempting to make a sectoid clone with a support sort of Mindspin that grants all nearby units (in a radius around the sectoid) a random stat buff, but I, for the life of me, can't figure out how one would do that. The ability code is too simple for me to make any sense of it. Any help, whether it'd be to solve my problem or simply refer me to a tutorial or some documentation that'd help me find my way, would be greatly appreciated. Link to comment Share on other sites More sharing options...
davidlallen Posted February 25, 2016 Share Posted February 25, 2016 Adding a new effect with a radius sounds like a good "second" project. First, you may want to look at the resources in the pinned thread, and dig through the rifleman mod to see how to work with the uc files. Link to comment Share on other sites More sharing options...
Krazyguy75 Posted February 25, 2016 Author Share Posted February 25, 2016 Thank you for your advice, but I've already done that... This isn't my first project in unrealscript, though it is my first project in XCOM2 ability modding. I've completed the cloning of the unit, the reskinning of the unit, and the restatting of the unit. The only problem is with the ability. I've looked at all the tutorials. I've downloaded and scried through most of the mods with new abilities. My problem is that patching together the mods doesn't seem to work. I'd be happy just to give Mindspin an AoE, because I also need to do that in the future anyways, but even that doesn't work right. Link to comment Share on other sites More sharing options...
gunzwei Posted February 25, 2016 Share Posted February 25, 2016 I'm assuming you just want a self-targeted aoe that applies an effect. X2Ability_AdventShieldbearer has a good example of it. Link to comment Share on other sites More sharing options...
Krazyguy75 Posted February 25, 2016 Author Share Posted February 25, 2016 Yeah, I know, I've looked at all those. My current problem is that, no matter what I change, my game won't let me use it, as it claims there is no target, which makes no sense for an AoE. I'm assuming I'm missing something simple, but for the life of me, I can't figure it out. What are the parts I'd need to change? I have the deadeye self targeting part, as well as the multitargeting radius. What else would I need to change to make it stop claiming there are no targets? Link to comment Share on other sites More sharing options...
Lucubration Posted February 25, 2016 Share Posted February 25, 2016 (edited) Can you post your custom ability template here? I've been doing quite a bit of work on them lately, so I might be able to spot something. It's hard to start making suggestions without an idea of what you've already put in place. If you've got the multi-targeting style already set, the next thing I can think of is that IIRC effects (at least, I think it's effects; maybe it's the multi-targeting style itself?) have flags for whether it can target friendly or enemy units; if those aren't set right, it won't pick up friendlies in the multi-target radius. Edited February 25, 2016 by Lucubration Link to comment Share on other sites More sharing options...
gunzwei Posted February 25, 2016 Share Posted February 25, 2016 static function X2AbilityTemplate AoeBuff() { local X2AbilityTemplate Template; local X2AbilityCost_ActionPoints ActionPointCost; local X2AbilityCharges Charges; local X2AbilityCost_Charges ChargeCost; local X2AbilityCooldown Cooldown; local X2Condition_UnitProperty UnitPropertyCondition; local X2AbilityTrigger_PlayerInput InputTrigger; local X2Effect_PersistentStatChange BuffEffect; local X2AbilityMultiTarget_Radius MultiTarget; `CREATE_X2ABILITY_TEMPLATE(Template, 'AoeBuff'); Template.IconImage = "img:///UILibrary_PerkIcons.UIPerk_adventshieldbearer_energyshield"; Template.eAbilityIconBehaviorHUD = eAbilityIconBehavior_AlwaysShow; Template.AbilitySourceName = 'eAbilitySource_Standard'; Template.Hostility = eHostility_Defensive; ActionPointCost = new class'X2AbilityCost_ActionPoints'; ActionPointCost.iNumPoints = 1; ActionPointCost.bConsumeAllPoints = true; Template.AbilityCosts.AddItem(ActionPointCost); Charges = new class 'X2AbilityCharges'; Charges.InitialCharges = 1; Template.AbilityCharges = Charges; ChargeCost = new class'X2AbilityCost_Charges'; ChargeCost.NumCharges = 1; Template.AbilityCosts.AddItem(ChargeCost); Cooldown = new class'X2AbilityCooldown'; Cooldown.iNumTurns = 1; Template.AbilityCooldown = Cooldown; Template.AbilityShooterConditions.AddItem(default.LivingShooterProperty); Template.AbilityToHitCalc = default.DeadEye; Template.AbilityTargetStyle = default.SelfTarget; MultiTarget = new class'X2AbilityMultiTarget_Radius'; MultiTarget.fTargetRadius = 5; MultiTarget.bIgnoreBlockingCover = true; Template.AbilityMultiTargetStyle = MultiTarget; InputTrigger = new class'X2AbilityTrigger_PlayerInput'; Template.AbilityTriggers.AddItem(InputTrigger); UnitPropertyCondition = new class'X2Condition_UnitProperty'; UnitPropertyCondition.ExcludeDead = true; UnitPropertyCondition.ExcludeFriendlyToSource = false; UnitPropertyCondition.ExcludeHostileToSource = true; UnitPropertyCondition.ExcludeCivilian = true; UnitPropertyCondition.FailOnNonUnits = true; Template.AbilityMultiTargetConditions.AddItem(UnitPropertyCondition); BuffEffect = new class 'X2Effect_PersistentStatChange'; BuffEffect.EffectName = 'BuffEffect'; BuffEffect.BuildPersistentEffect(2, false, true, , eGameRule_PlayerTurnBegin); BuffEffect.AddPersistentStatChange(eStat_Hp, 5); BuffEffect.SetDisplayInfo(ePerkBuff_Bonus, Template.LocFriendlyName, Template.GetMyLongDescription(), Template.IconImage, true,, Template.AbilitySourceName); Template.AddShooterEffect(BuffEffect); Template.AddMultiTargetEffect(BuffEffect); Template.BuildNewGameStateFn = TypicalAbility_BuildGameState; Template.BuildVisualizationFn = TypicalAbility_BuildVisualization; Template.bSkipFireAction = true; return Template; } Here's a quick change on the shieldbearer's ability. Worked fine in debug-tactical. Link to comment Share on other sites More sharing options...
Lucubration Posted February 25, 2016 Share Posted February 25, 2016 Hunh. I figured it'd be something obvious, too, but that looks correct. Maybe try setting up single-target conditions in addition to your multi-target condition? Regardless of other targets caught in the radius, from what you describe it sounds like it's trying to find a valid primary target apply it to and failing. Link to comment Share on other sites More sharing options...
Krazyguy75 Posted February 25, 2016 Author Share Posted February 25, 2016 Hunh. I figured it'd be something obvious, too, but that looks correct. Maybe try setting up single-target conditions in addition to your multi-target condition? Regardless of other targets caught in the radius, from what you describe it sounds like it's trying to find a valid primary target apply it to and failing. That's not my code, he's trying to help me as well. That code should work. At the dentist RN, will post my code when I get back. My mistake will probably be obvious. Link to comment Share on other sites More sharing options...
Lucubration Posted February 25, 2016 Share Posted February 25, 2016 (edited) That's not my code, he's trying to help me as well. That code should work. At the dentist RN, will post my code when I get back. My mistake will probably be obvious.Well now I just feel foolish. Sorry. Edited February 25, 2016 by Lucubration Link to comment Share on other sites More sharing options...
Recommended Posts