Is there any actual reason secondary weapons don't provide the ability to use themselves?
I can understand why the Gremlin doesn't, but why doesn't the sword provide SwordSlice, the Pistol provide FirePistol and the Grenade Launcher provide LaunchGrenade?
Maybe the grenade launcher would cause issues with the grenade pocket, but why the other 2? Anything that would make it ill advised to edit the templates to provide the abilities?
Posted Feb 13, 2017, 5:20 PM UTC
45
For the grenade launcher, XCGS_Unit.InitAbilitiessomething does only link up grenades with a launcher if the launching ability comes from the SCAT (Soldier Class Ability Tree). For the other ones, it shouldn't cause issues.
Looks like GetEarnedSoldierAbilities() only returns class and awc abilities.
Thanks, I think I know how to proceed.
The LW2 Highlander adds a hook for that function.
At first when I saw your response I wasn't sure I would need that hook for something, but then I posted this https://www.reddit.com/r/xcom2mods/comments/5u08br/lw2_is_it_possible_to_addremove_a_soldier_ability/ and went looking for a way to do what I asked... I think the hook you mentioned can accomplish that.
Since HasSoldierAbility calls GetEarnedSoldierAbilities and that one passes a reference for the unit. I could check if the unit is affected by an specific effect, if it is, I can add one of the marker abilities to the list. I can set up this effect using 3 abilities that emulate a 3 state switch on the soldier. the ability would be something like "Fire Control" as a free action, using it would add an effect that would hide the ability and mark the soldier as only firing on overwatch when he has more than 25% chance. The effect would also revel another ability, "Fire Control 25% > 50%" that would remove the previous effect and add a new one.
I find it really funny that you answered a question 20 hours before I posted it :D
No problem, although I am unsure it that's the proper way to do it. Now, if you excuse me, I have to redeem and download a shit ton of games from the humble bundle.