[WOTC] Fix Controller Grappling
This mod fixes the annoying interaction with grapple targeting while using an xinput controller. It does so by making the ability require activation before targeting.
When you target with a grenade, you have to activate targeting. Once targeting is active, the game registers all dpad inputs as camera manipulations. This mod adds grapple and blazing pinions to this list.
In addition, in case I missed any abilities, I’ve made the list configurable. So if a mod adds a new targeting method, you can add it to the config file here::
The vanilla way the grapple is implemented picks the nearest valid location, and then centers the camera on your soldier.
Grapple targets are usually on a higher elevation than your soldier, so when you press UP on the dpad, it decides to switch to a different ability. This cancelling your grapple targeting. (Trying to rotate your camera also cancels out).
Activated targeting is a special mode for controllers only, It should have no impact on Mouse input mode.
There is a hardcoded list of targeting methods that get special consideration for controller. If the current ability’s targeting method is on this list, or inherits from an element on this list then it must be activated before it brings up targeting.
- X2TargetingMethod_Cone (e.g. Kill Zone)
- X2TargetingMethod_Line (e.g. Dark Lance)
Note, that targeting methods that inherit from one of these templates also get this treatment. So while not explicitly listed, Gremlin AoE methods are also on this list.
I’ve now added grapple, path targeting (ionic storm and other friends) and blazing pinions to the list.
Meaning, that pressing A on grapple (or Blazing Pinions if you are mind controlling an Archon) now activates the targeting mode for grapple and you can now raise the elevation, rotate the camera or do whatever. Cancelling out of this mode requires you to press B like you would with a grenade.
source code available on github
Q. Does this work with vanilla?
A. No, and I have no idea how to make it do that. The change is very simple, Please take a look at the code on github.
Q. You idiot, you forgot about Ability! How can I add support for my modded ability that doesn’t use one of these methods?
A. There is a list in XcomFixControllerGrappling.ini. You can add targeting methods to it.
Special thanks to Mr.Nice who basically wrote this mod in the highlander.
If you’re using this mod please like and favorite it, as it helps get attention.
Also if you find any other abilities in the base game that need this special treatment, I’ll be happy to incorporate them.