Jump to content

Adding assault rifles for other classes.


Darearkin

Recommended Posts

Now before you jump all over me with the 'eWP_AnyClass' tag and 'eWP_Heavy' tags, that's not actually what I'm trying to do. I tried that once and it slapped the guns down to 3 rounds per mag for -everyone.-

 

What I was asking is- how tricky would it be to make a 'new' gun for heavies/snipers that's functionally identical to the assault rifle(s) but doesn't hose everyone else in the ammo department?

Like, an assault rifle with similar (or a single difference so I can tell which is which) name, triggered by the research that gives us their respective guns of each category, so I can have that flexibility?

Link to comment
Share on other sites

  • 2 weeks later...

Now before you jump all over me with the 'eWP_AnyClass' tag and 'eWP_Heavy' tags, that's not actually what I'm trying to do. I tried that once and it slapped the guns down to 3 rounds per mag for -everyone.-

 

What I was asking is- how tricky would it be to make a 'new' gun for heavies/snipers that's functionally identical to the assault rifle(s) but doesn't hose everyone else in the ammo department?

Like, an assault rifle with similar (or a single difference so I can tell which is which) name, triggered by the research that gives us their respective guns of each category, so I can have that flexibility?

 

It would be a whole lot tricker than just adding eWP_AnyClass.

 

Adding eWP_Heavy is what knocked your ammo count down. Just adding eWP_AnyClass allows everyone to use it, including Heavies, and doesn't give it the LMG's crappy ammo count.

Link to comment
Share on other sites

  • 1 month later...

 

It would be a whole lot tricker than just adding eWP_AnyClass.

Adding eWP_Heavy is what knocked your ammo count down. Just adding eWP_AnyClass allows everyone to use it, including Heavies, and doesn't give it the LMG's crappy ammo count.

 

From what i've read around the forum and experienced first hand, eWP_AnyClass is needed for heavies to be able to equip Assualt Rifles with the AnyClass flag.

 

That being said you might be able to edit AnyClass to include heavies. I'll look it up and see where the class files are located. Found the post: http://forums.nexusmods.com/index.php?/topic/1021276-weapons-to-all-classes/page-3

 

 

 

Actually you are in luck here.

 

The code to designate which classes get which weapons is completely written in Unreal Engine code and is in the XComStrategyGame.upk

 

The function that does the job is XGStrategySoldier.SetClass.

This function basically sets the class, the name, and changes the soldier's loadout when it is called. It's called from XGStrategySoldier.LevelUp when the soldier is promoted from Rookie to Squaddie.

 

 

I've explored around and this looks to require hex editing which is a bit beyond me at the moment.

 

I'll look into it but i don't think i'll come up with anything.

 

Edit: IDK how but i mis-interpretted that post entirely.

 

That said, I poked around and found this in: XComStrategyGame.UPK>Classes>XGStorage

f

unction XComGame.XGTacticalGameCoreData.ESoldierClass GetWeaponClassLimit(XComGame.XGGameData.EItemType eItem)
{
    // End:0x9A
    if((TACTICAL().WeaponHasProperty(eItem, 3) || TACTICAL().WeaponHasProperty(eItem, 2)) || TACTICAL().WeaponHasProperty(eItem, 5))
    {
        return 0;
    }
    // End:0x16F
    else
    {
        // End:0xD0
        if(TACTICAL().WeaponHasProperty(eItem, 6))
        {
            return 4;
        }
        // End:0x16F
        else
        {
            // End:0x106
            if(TACTICAL().WeaponHasProperty(eItem, 4))
            {
                return 3;
            }
            // End:0x16F
            else
            {
                // End:0x13C
                if(TACTICAL().WeaponHasProperty(eItem, 7))
                {
                    return 1;
                }
                // End:0x16F
                else
                {
                    // End:0x16F
                    if(TACTICAL().WeaponHasProperty(eItem, 8))
                    {
                        return 2;
                    }
                }
            }
        }
    }
    return 0;
    //return ReturnValue;    
}

Edit 3:

 

Followed the code to xcomgame.upk>XGTacticalCoreGameData and found some functions relating to weapon classes

enum EWeaponClass
{
    eWeaponClass_None,
    eWeaponClass_Assault,
    eWeaponClass_Shotgun,
    eWeaponClass_Heavy,
    eWeaponClass_Sniper,
    eWeaponClass_MAX
};

From here you may be able to add more weapon classes yourself. Looking further into it as I don't see support or anyclass or rifles in there. I think rifles may be 'assualt' and 'shotgun' is the shotgun?

 

Edit 4: Found the any class code right under it.

 

Also found:

simulated function bool WeaponHasAbility(int iWeapon, int iAbility)
{
    return m_arrWeapons[iWeapon].aAbilities[iAbility] > 0;
    //return ReturnValue;    
}
simulated function XGGameData.EItemType GetEquipWeapon(TInventory kInventory)
{
    local int I, iWeapon;

    I = 0;
    J0x0B:
    // End:0xAD [Loop If]
    if(I < kInventory.iNumLargeItems)
    {
        iWeapon = kInventory.arrLargeItems[I];
        // End:0x9F
        if((iWeapon != -1) && !WeaponHasProperty(iWeapon, 1))
        {
            return byte(iWeapon);
        }
        ++ I;
        // [Loop Continue]
        goto J0x0B;
    }
    return byte(kInventory.iPistol);
    //return ReturnValue;    
}

I have no idea what all the weapon values mean though.

Edited by Lucidius134
Link to comment
Share on other sites

  • Recently Browsing   0 members

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