Jump to content

Use Arc Thrower after Run n Gun


EbenezerGrymm

Recommended Posts

Topic title pretty much says it all. It would be nice and sensible to be able to use your arc thrower after performing Run n Gun with an assault trooper.

 

I've looked through most files and I haven't found where values are stored for the class abilities. If someone could point me in the right direction I'd like to take a crack at it myself.

Link to comment
Share on other sites

hmm, I know you can change the arcthrower to being a pistol (it's been done).

 

I haven't heard whether than enables it to be used as a r&g weapon though.

 

I'm going to guess that adding this as one of the properties will allow it to be used like a normal weapon:

 

eAbility_ShotStandard

 

so this is what it might look like:

 

Weapons=(iType=eItem_ArcThrower,ABILITIES[0]=eAbility_ShotStun,ABILITIES[1]=eAbility_ShotStandard,ABILITIES[2]=eAbility_NONE,ABILITIES[3]=eAbility_NONE,ABILITIES[4]=eAbility_NONE,ABILITIES[5]=eAbility_NONE,Properties[0]=eWP_None,Properties[1]=eWP_NoReload,Properties[2]=eWP_CantReact,Properties[3]=eWP_Secondary,Properties[4]=eWP_Backpack,Properties[5]=eWP_None,iDamage=0,iEnvironmentDamage=0,iRange=27,iReactionRange=-1,iReactionAngle=200,iRadius=0,iCritical=0,iOffenseBonus=0,iSuppression=0,iSize=eItemSize_Small,iHPBonus=0,iWillBonus=0)

 

I'll play around with it and see.

 

 

nnnnope.

 

try 2: tried giving shotstun ability to standard pistol, which does allow you to stun when you swap to it, but doesn't allow you to use it with R&G. I'm thinking that there is a different .ini file needed where the abilities themselves are defined, because shotstun as an ability does not allow you to use it for R&G.

 

so, I would amend your request to add a request for someone to figure out which files control ability effects.

 

 

 

will have to try something else, as I think your idea is a good one.

Edited by Sir_Toejam
Link to comment
Share on other sites

  • 3 months later...
  • 1 month later...

a note for Sir_Toejam, if you care : (Pre update 3) Adding shot_stun to any weapon (other than the arc thrower) allows you to stun (click the button, target the alien) but the stun ALWAYS fail. That's because the code that calculates stun success actually checks if you have the arc thrower on you (for some obscure reason i haven't figured out...).

 

As for your request Eb... its well beyond my meager abilities. Sorry.

Link to comment
Share on other sites

I suspect that is impossible to achieve, but first, since this is a recurring topic a few clarifications are in order.

 

As it has been pointed out, to stun an alien you've got to use the "stun" ability, there's no other way you can stun an enemy (not shooting, not in any other way). To be able to use that ability, the weapon must have the "eWP_ShotStun" property set in the ini. And to actualy stun the alien that weapon must be an arc thrower, because as Wolfgeist said that's hard-coded somewhere (dunno if it's in an accessible function). So turning the arc thrower into a pistol and making other edits to DGC.ini you can get cool stuff but nothing to do with stunning aliens.

 

Now, I think it's impossible to make it usable after run'n gun 'cause if I'm not mistaken the function that (re)calculates available abilities after each move is a native function (which means totally unaccessible for us). Check this code (XComGame.upk >> class XGAbility >> function ApplyCost)

 

 

function ApplyCost()
{
    // End:0x11
    if(HasProperty(8))
    {
        return;
    }
    // End:0x1C3
    if(HasProperty(7))
    {
        // End:0x8D
        if(m_kUnit.m_bDashing && !m_kUnit.RunAndGunPerkActive())
        {
            m_kUnit.m_iMovesActionsPerformed += 2;
        }
        // End:0xAD
        else
        {
            ++ m_kUnit.m_iMovesActionsPerformed;
        }
        // End:0x1A0
        if(m_kUnit.RunAndGunPerkActive())
        {
            // End:0x13B
            if((m_kUnit.m_iMovesActionsPerformed == 1) && m_kUnit.m_bDashing)
            {
                m_kUnit.m_bRunAndGunUsedMove = true;
            }
            // End:0x1A0
            else
            {
                // End:0x1A0
                if(m_kUnit.m_iMovesActionsPerformed > 1)
                {
                    m_kUnit.m_bRunAndGunUsedMove = true;
                    m_kUnit.m_iMovesActionsPerformed = 1;
                }
            }
        }
        m_kUnit.BuildAbilities(true);
    }
    // End:0x626
    else
    {
        // End:0x1D3
        if(m_bReactionFire)
        {
        }
        // End:0x626
        else
        {
            // End:0x2D2
            if(((((m_kUnit.GetSoldierClass() == 2) && m_kUnit.GetCharacter().HasUpgrade(26)) && (GetType()) == 7) && XGAbility_Targeted(self).m_kWeapon != none) && XGAbility_Targeted(self).m_kWeapon.HasProperty(8))
            {
                ++ m_kUnit.m_iMovesActionsPerformed;
            }
            // End:0x626
            else
            {
                // End:0x606
                if(((((m_kUnit.GetSoldierClass() == 1) && m_kUnit.m_iMovesActionsPerformed == 0) && m_kUnit.GetCharacter().HasUpgrade(13)) && !XComGameReplicationInfo(class'Engine'.static.GetCurrentWorldInfo().GRI).m_kGameCore.m_kAbilities.IsAbilityCoolingDown(m_kUnit, 60)) && XComGameReplicationInfo(class'Engine'.static.GetCurrentWorldInfo().GRI).m_kGameCore.m_kAbilities.IsDoubleTapAllowedAbility(byte(GetType())))
                {
                    ++ m_kUnit.m_iMovesActionsPerformed;
                    m_kUnit.m_aAbilitiesOnCooldown[m_kUnit.m_iNumAbilitiesOnCooldown].iCooldown = XComGameReplicationInfo(class'Engine'.static.GetCurrentWorldInfo().GRI).m_kGameCore.3;
                    m_kUnit.m_aAbilitiesOnCooldown[m_kUnit.m_iNumAbilitiesOnCooldown].iType = 60;
                    ++ m_kUnit.m_iNumAbilitiesOnCooldown;
                    m_kUnit.m_bDoubleTapActivated = true;
                    m_kUnit.m_bBuildAbilityDataDirty = true;
                }
                // End:0x626
                else
                {
                    ++ m_kUnit.m_iFireActionsPerformed;
                }
            }
        }
    }
    // End:0x690
    if((((GetType()) == 33) || (GetType()) == 38) || (GetType()) == 45)
    {
        m_kUnit.SetUsedAbility(GetType());
        EndTurnCheck();
    }
    //return;    
}

It seems the game keeps track of the num. of moves and actions performed, separatedly, for each unit per turn, and after processing them (in theory each time an action is performed) it calls m_kUnit.BuildAbilities(true) which is that unaccessible function that I suspect it sets which abilities are available and which aren't (given the moves made, actions taken, perks, etc). But hey, I haven't explored that much, so I could be wrong. If someone wants to dig further I'd recommend starting for this XGAbility class and similar.

 

Here's a tutorial on hex editing and a modding tools package.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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