kexx456 Posted June 24, 2016 Share Posted June 24, 2016 (edited) Hello everyone, I hope someone can help me. I'm creating a new enemy unit, the Valkyrie (based off of the Archon), and I want to give her an ability that behaves like the sectopod's Lightning Field ability. Sort of like a pulse grenade, emitting from her, that deals damage on an AoE radius. I would also like this ability to have a percent chance of inflicting Stun. So here's what I did: 1. Created X2Ability_VakyriePoop (placeholder name until I come up with something)2. Copied Sectopod's Lightning Field ability code into it.3. Swapped all "SectopodLightningField" for "ValkyriePoop"4. Copied LeaderEnemyBoss' code from his Venator enemy unit's ability Paralyze for the Stunned Status Effect part (with his permission of course)5. In the UE, created a copy of the AnimSet AS_Archon over to my upk, added the Codex's HL_MalfunctionA animation sequence to it, saved it as AS_Valkyrie, added it to Archetype.6. In the .uc, added the HL_MalfunctionA to the Template.CustomFireAnim.7. Added the newly created ValkyriePoop ability to her list of abilities in the X2Character_Valkyrie.uc Issues:1. While in the UE, the malfunction sequence plays just fine, in debug/game the unit isn't playing the anim, and it fires the staff towards the sky.2. It's just not working. No damage, not getting the radius highlight, no effect, nothing. I'm very new at this, so I don't understand coding or the language, but so far I've learned a lot and have been able to:1. Add the unit to the game.2. Created her own loot table, so she now drops Valkyrie corpses instead of Archon ones.3. Created an autopsy research for her, with tech requirements, etc. Even created a new autopsy image for her and implemented correctly in game. So I don't know where I'm going wrong since I don't understand much yet. Maybe I'm extending the wrong class? Maybe the config's aren't lining up? Do I have to create a new weapon for her, so that the weapondamage is correctly called upon? I have no idea, and would immensely appreciate any help or direction I can get. Here's what the code for the X2Ability_ValkyriePoop.uc looks like: -- class X2Ability_ValkyriePoop extends X2Ability config(GameData_Characterstats); var config float VALKYRIEPOOP_TILE_RADIUS; static function array<X2DataTemplate> CreateTemplates() { local array<X2DataTemplate> Templates; Templates.AddItem(CreateValkyriePoopAbility()); return Templates; } static function X2AbilityTemplate CreateValkyriePoopAbility() { local X2AbilityTemplate Template; local X2AbilityCost_ActionPoints ActionPointCost; local X2AbilityTrigger_PlayerInput InputTrigger; local X2AbilityMultiTarget_Radius RadiusMultiTarget; local X2Condition_UnitProperty UnitProperty; local X2Effect_ApplyWeaponDamage DamageEffect; local X2AbilityCooldown_LocalAndGlobal Cooldown; local X2Effect_Stunned StunnedEffect; `CREATE_X2ABILITY_TEMPLATE(Template, 'ValkyriePoop'); //IconImage needs to be changed once there is an icon for this Template.IconImage = "img:///UILibrary_PerkIcons.UIPerk_lightningfield"; Template.eAbilityIconBehaviorHUD = eAbilityIconBehavior_AlwaysShow; Template.Hostility = eHostility_Offensive; UnitProperty = new class'X2Condition_UnitProperty'; UnitProperty.ExcludeDead = true; Template.AbilityShooterConditions.AddItem(UnitProperty); Template.AbilityToHitCalc = default.DeadEye; //Cooldowns Cooldown = new class'X2AbilityCooldown_LocalAndGlobal'; Cooldown.iNumTurns = 1; Cooldown.NumGlobalTurns = 1; Template.AbilityCooldown = Cooldown; // Targets enemies UnitProperty = new class'X2Condition_UnitProperty'; UnitProperty.ExcludeFriendlyToSource = true; UnitProperty.ExcludeDead = true; UnitProperty.IsOutdoors = true; Template.AbilityMultiTargetConditions.AddItem(UnitProperty); ActionPointCost = new class'X2AbilityCost_ActionPoints'; ActionPointCost.iNumPoints = 1; Template.AbilityCosts.AddItem(ActionPointCost); //Triggered by player or AI InputTrigger = new class'X2AbilityTrigger_PlayerInput'; Template.AbilityTriggers.AddItem(InputTrigger); //fire from self, with a radius amount Template.AbilityTargetStyle = default.SelfTarget; RadiusMultiTarget = new class'X2AbilityMultiTarget_Radius'; RadiusMultiTarget.fTargetRadius = default.VALKYRIEPOOP_TILE_RADIUS * class'XComWorldData'.const.WORLD_StepSize * class'XComWorldData'.const.WORLD_UNITS_TO_METERS_MULTIPLIER; RadiusMultiTarget.bIgnoreBlockingCover = true; Template.AbilityMultiTargetStyle = RadiusMultiTarget; //Weapon damage to all affected DamageEffect = new class'X2Effect_ApplyWeaponDamage'; DamageEffect.EffectDamageValue = class'X2Item_DefaultWeapons'.default.SECTOPOD_LIGHTINGFIELD_BASEDAMAGE; Template.AddMultiTargetEffect(DamageEffect); Template.BuildNewGameStateFn = TypicalAbility_BuildGameState; Template.BuildVisualizationFn = TypicalAbility_BuildVisualization; Template.bShowActivation = true; Template.bSkipFireAction = false; Template.bSkipExitCoverWhenFiring = true; Template.CustomFireAnim = 'HL_MalfunctionA'; Template.CinescriptCameraType = "Sectopod_LightningField"; StunnedEffect = class'X2StatusEffects'.static.CreateStunnedStatusEffect(1, 100); StunnedEffect.bRemoveWhenSourceDies = false; Template.AddMultiTargetEffect(StunnedEffect); return Template; } -- And what I have on the config ini: [XComGame.X2Ability_ValkyriePoop] VALKYRIEPOOP_TILE_RADIUS=3.5Notes: also new to the site, so I don't know how to put that into spoilers to avoid wall of text. Sorry! Edited June 24, 2016 by kexx456 Link to comment Share on other sites More sharing options...
kexx456 Posted June 24, 2016 Author Share Posted June 24, 2016 Thanks to LeaderEnemyBoss, I've gotten the ability to work, and a new animation to play. The new animation is based on the Archon AnimSet, as I haven't figured out how to have it play an animation from a different set, but that's secondary. When activating the skill, a radius highlighted grid shows up, and the units within it suffer damage. So the important, big part is done. But... the ability isn't playing the red particle effect from the original Sectopod Lightning Field. It plays nothing. The unit plays its animation, then the enemies suffer damage, but no particle effects appear. I'm guessing the issue is I'm not calling any on the code above. Anyone know what I can do so the particle effect shows? Link to comment Share on other sites More sharing options...
LeaderEnemyBoss Posted June 24, 2016 Share Posted June 24, 2016 Thanks to LeaderEnemyBoss, I've gotten the ability to work, and a new animation to play. The new animation is based on the Archon AnimSet, as I haven't figured out how to have it play an animation from a different set, but that's secondary. When activating the skill, a radius highlighted grid shows up, and the units within it suffer damage. So the important, big part is done. But... the ability isn't playing the red particle effect from the original Sectopod Lightning Field. It plays nothing. The unit plays its animation, then the enemies suffer damage, but no particle effects appear. I'm guessing the issue is I'm not calling any on the code above. Anyone know what I can do so the particle effect shows? easiest way to do this this is: 1. Copy the animationsequence you want to use in a new animset (rename it!)2. add the animset to the enemies archetype3. you can now add particle effects to the animationsequence similar to how some other sequences do it (codex-malfunction e.g.) Link to comment Share on other sites More sharing options...
kexx456 Posted June 26, 2016 Author Share Posted June 26, 2016 I'm lost on step 3. Where does one add particle effects to animation sequences? In the UE? In what window? Archetype? SkeletalMesh? I've been looking around but can't find anything! Help! Link to comment Share on other sites More sharing options...
E3245 Posted June 26, 2016 Share Posted June 26, 2016 I'm lost on step 3. Where does one add particle effects to animation sequences? In the UE? In what window? Archetype? SkeletalMesh? I've been looking around but can't find anything! Help!You'll have to look at the properties of the archetype, and find m arr particle system? Something like that. That's where you'll add new particle systems to the enemy. It also requires a socket, which you can add in the AnimSet Viewer while your skeletal mesh is selected. Link to comment Share on other sites More sharing options...
LeaderEnemyBoss Posted June 26, 2016 Share Posted June 26, 2016 I'm lost on step 3. Where does one add particle effects to animation sequences? In the UE? In what window? Archetype? SkeletalMesh? I've been looking around but can't find anything! Help!in the as-editor (the same where you can preview the animations). You can add notifies to animation sequences, these notifies can be a range of things, for example particle effects. Link to comment Share on other sites More sharing options...
Recommended Posts