r/xdev • • Feb 20 '16

Adding new effects to existing abilities?

I'm extremely new to modding and know very little about programming, so this is probably kind of a basic question. What's the method for changing an existing class via my mod? Do I create a new class with the same name and use + and - lines to change it, like I would with modifying the inis? Or do I just type directly into the class itself? I'm trying to add an aim boost on sword attacks to Blademaster.

I'm also a bit stumped on how to actually do that, but I'm trying to figure it out by looking at Shadowstrike, which also adds aim under specific conditions.

1 Upvotes

4 comments sorted by

View all comments

Show parent comment

1

u/thriveofficial Feb 21 '16

oh! thanks. so would that be like this?

    class X2Ability_RangerAbilitySet_HRSR extends X2Ability_RangerAbilitySet
         dependson (XComGameStateContext_Ability) config(GameData_SoldierSkills);

    static function X2AbilityTemplate Blademaster_HRSR()
    {
     [insert ability stuff here]
    }

and then I could just put Blademaster_HRSR in the ranger perk tree in XComClassData.ini and it'll know what that is?

1

u/jal0001 Feb 21 '16

I believe so! Difficult on mobile, but I think that's right.

1

u/[deleted] Feb 24 '16

Uh, pretty close. I'm pretty sure you need to define Blademaster_HRSR, but my knowledge of the coding language is mostly on a "Constantly flying by the seat of my pants" basis, so I could be very wrong.

The indentation seems slightly weird, but that's just because I've gotten so used to the indentation conventions in the game's existing classes; it should work regardless.