Jump to content

Help with ability modding?


Krazyguy75

Recommended Posts

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

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

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 by traenol
Link to comment
Share on other sites

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

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

  • Recently Browsing   0 members

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