Jump to content

[EW] Bind Key to "Head Down" action?


pepoluan

Recommended Posts

Can be done in XComGame.upk, XComTacticalInput.ActiveUnit_Moving.Key_K. Just add civilian's head down ability, like:

if(kActiveUnit.GetCharacter().IsA('XGCharacter_Civilian'))
{
    // head down
    kActiveUnit.PerformAbility(70);
    return true;
}
else
{
    // hunker down
    kActiveUnit.PerformAbility(27);
    return true;
}

---

Here is mod file for PatcherGUI. There is no confirmation dialog after a key press, while the soldier is moving and not aiming. Either the ability is performed or in a case of hunker down outside cover an error sound is played. Enjoy.

MOD_NAME=Stay Down for EW
AUTHOR=Drakous79
DESCRIPTION=A key for soldier's hunker down ability will work for civilian's head down ability as well.
There is no confirmation dialog after a key press, while the soldier is moving and not aiming.
Either the ability is performed or in a case of hunker down outside cover an error sound is played.

Version 1.401776a

UPK_FILE = XComGame.upk
OBJECT = XComTacticalInput.ActiveUnit_Moving.Key_K:AUTO

[REPLACEMENT_CODE]
0F 00 <.kActiveUnit> 1B <GetActiveUnit> 16

07 [@label_if_1] 84 84 19 00 <.kActiveUnit> [@] <XGUnitNativeBase.IsPanicked.ReturnValue> 00 ( 1B <IsPanicked> 16 ) 18 [@] ( 19 00 <.kActiveUnit> [@] <XGUnit.IsStrangled.ReturnValue> 00 ( 1B <IsStrangled> 16 ) 16 ) 18 [@] ( 19 00 <.kActiveUnit> [@] <XGUnit.IsStrangling.ReturnValue> 00 ( 1B <IsStrangling> 16 ) 16 )
    04 28
[#label_if_1]

07 [@label_if_2] 9B 9C 00 <.Actionmask> 2C 20 16 25 16

    // if the unit is a civilian; eAbility_CivilianCover (70, 0x46) - Head Down
    // if (kActiveUnit.GetCharacter().IsA('XGCharacter_Civilian'))
    07 [@label_if_3] 19 19 00 <.kActiveUnit> [@] <XGUnit.GetCharacter.ReturnValue> 00 ( 1B <GetCharacter> 16 ) [@] <Core.Object.IsA.ReturnValue> 00 ( C5 21 <XGCharacter_Civilian> 16 )
        // kActiveUnit.PerformAbility(70)
        19 00 <.kActiveUnit> [@] <NullRef> 00 ( 1B <PerformAbility> 24 46 16 )
        // return true
        04 27
    // else the unit is a soldier or an alien; eAbility_TakeCover (27, 0x1b) - Hunker Down
    06 [@label_else_3]
    [#label_if_3]
        // kActiveUnit.PerformAbility(27)
        19 00 <.kActiveUnit> [@] <NullRef> 00 ( 1B <PerformAbility> 24 1B 16 )
        // return true
        04 27
    [#label_else_3]

[#label_if_2]

04 28
04 3A <.ReturnValue>
53
Edited by Drakous79
Link to comment
Share on other sites

  • Recently Browsing   0 members

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