Amineri Posted February 27, 2016 Share Posted February 27, 2016 I've found that the ability to code up "custom" stuff within the actual AbilityTemplate is fairly limited. You pretty much are just setting data in there. Also, the code in there only executes once, when the AbilityTemplate is being created, so you wouldn't want to put randomization in there -- that would mean that every instance of the ability would have the same randomized effect each play session. Instead, you can do a lot more by creating a custom X2Effect. In particular, w.r.t. randomization, you'd probably want to put it into the custom X2Effect.OnEffectAdded, which is triggered when the Ability Effect is applied to a unit. Link to comment Share on other sites More sharing options...
Krazyguy75 Posted February 28, 2016 Author Share Posted February 28, 2016 Ok, new question, how would I add Covering Fire to an alien? Link to comment Share on other sites More sharing options...
Amineri Posted February 28, 2016 Share Posted February 28, 2016 Abilities can be added to characters or items. When added to items, they generally use animations for visualization tied to that item (unless overridden). So, for example, in the Muton Centurion template code, in the X2CharacterTemplate definition we have : CharTemplate.Abilities.AddItem('CounterattackPreparation'); CharTemplate.Abilities.AddItem('CounterattackDescription'); CharTemplate.Abilities.AddItem('WarCry'); CharTemplate.Abilities.AddItem('Beastmaster'); //CharTemplate.Abilities.AddItem('BayonetCharge'); // moved to X2Item_MutonM2.CreateTemplate_MutonM2_MeleeAttack so that proper animation plays Link to comment Share on other sites More sharing options...
Krazyguy75 Posted February 28, 2016 Author Share Posted February 28, 2016 Oh, so Covering Fire is just like a normal ability? I thought it might be different because it is a passive.. Ok, I'll test it out then. Link to comment Share on other sites More sharing options...
Amineri Posted February 28, 2016 Share Posted February 28, 2016 Passive abilities are still abilities in XCOM 2. The distinction between "passive perks" and "active abilities" from XCOM EU no longer applies. The primary difference between passive abilities and active ones is just what the trigger is. Link to comment Share on other sites More sharing options...
Krazyguy75 Posted March 3, 2016 Author Share Posted March 3, 2016 So... it doesn't seem like passive abilities work the same. Both Salvo and Covering Fire fail when I add them like normal abilities, despite showing up in the corner of the screen. Link to comment Share on other sites More sharing options...
Krazyguy75 Posted March 4, 2016 Author Share Posted March 4, 2016 Another sorta related thing, which isn't truly an ability... but how do I get it to carry 2 grenades? Link to comment Share on other sites More sharing options...
traenol Posted March 4, 2016 Share Posted March 4, 2016 (edited) Without adding a special slot, the free pocket grenade is coded to the launch grenade ability so that is out, your best option is changing it to allow multiple grenades. IIRC there is some code that makes grenades unique equippable that is easily changed. I think there is even a mod on the workshop that does that. edit: finishing my sentences is hard sometimes ... edit 2: here is the mod that makes them non-unique:http://steamcommunity.com/sharedfiles/filedetails/?id=622470685 Edited March 4, 2016 by traenol Link to comment Share on other sites More sharing options...
Krazyguy75 Posted March 4, 2016 Author Share Posted March 4, 2016 I actually wanted two of the same grenade, and I found out that was really easy. You just change the ClipSize feature of grenades, and that adds more charges, and since it is a custom grenade and not equippable by XCOM, it'll work fine. I'm still confused on the prior issue of how to get Covering Fire and Salvo to work. It doesn't seem to work normally, whether added on the character or on the items. However, other passives seem to be done the same way, such as the andromedon's break wall or robotic suit abilities Link to comment Share on other sites More sharing options...
Krazyguy75 Posted March 6, 2016 Author Share Posted March 6, 2016 So, I've got all my abilities worked out, except the aforementioned Salvo and Covering Fire... but now I have no idea how to make the AI use them. How would one edit the AI? I want the unit to have regular muton AI, but with an increased chance to use grenades (especially on higher difficulties, if that is possible), and I want it to use one of its abilities as the first opportunity it has every turn. Link to comment Share on other sites More sharing options...
Recommended Posts