Jump to content

The web based (extended) Perk Tree mod generator(s)


Bertilsson

Recommended Posts

FYI, I've changed the Lock n Load Perk to hex 01 (instead of 0c) because Amineri thought she was seeing buggy behavior with 0c -- possibly some residual effects of the original unused perk, Button Up, that was assigned to that hex.

 

Also, I screwed up one perk assignment on my end -- Assault rank 3, perk 2 was meant to be Tactical Sense, not Smoke Grenade. I'll get a fix out soon.

Link to comment
Share on other sites

  • Replies 61
  • Created
  • Last Reply

Top Posters In This Topic

Noob question.... I notice that all of the web tools have L8-11... does this mean we can add more ranks? How does one add the new ranks and required XP for leveling up to the game (as in does it require hex edits or can it be done through DGC)

 

Awesome work btw, love these tools :)

Link to comment
Share on other sites

Unfortunately the ranks 8 to 11 are there just for future compatibility.

 

When I re-defined the GetPerkInTree functions I allowed for up to 4 perks per rank and up to 11 ranks.

 

The Perk Tree sprite is only 7 icons talls and 3 icons wide.

 

I've made use of the 4 perks per rank by adding in the subclasses.

 

My eventual plans for the ranks 8 to 11 involve the free 4 rank slots in the psi tree. Am thinking of eventually adding in either more ranks for the soldiers (which has been suggested as an idea, or allowing for some additional choices at certain ranks. Perk choices are still somewhat limited, so adding in too many more ranks probably wouldn't work. However, I'd thought of allowing some choices between different stats bonuses at certain ranks.

 

The config variable m_iSoldierXPLevels is a dynamic array, so new levels and xp requirements can be added pretty easily.

 

There are a few hard-coded limiters in the hex that would have to be undone, such as in XGTacticalGameCore :

simulated function int GetXPRequired(int iRank)
{
    local int iXPRequired;

    iXPRequired = 10000000;
    if(iRank < 8)
    {
        iXPRequired = m_iSoldierXPLevels[iRank];
    }
    return iXPRequired;
    //return ReturnValue;    
}

and in XGStrategySoldier :

function OnLevelUp()
{
    local int Rank;

    Rank = m_kSoldier.GetRank();
    // End:0x8D
    if(Rank < 7)
    {
        m_kSoldier.LevelUp();
        Rank = m_kSoldier.GetRank();
        UpdateView();
    }
    //return;    
}

This would allows additional leveling up which could include stats, if LevelUpStats were updated.

 

The SoldierStatProgression config variable is also a dynamic array, so could be defined for more than 7 ranks.

 

There's only one additional rank icon (Field Marshall, I believe), so something would have to be worked out there.

 

The other big issue is adding perk choices for higher ranks. Both finding perks to assign and then a place to assign them. Currently the only place I have to assign them would be in the psitree.

Link to comment
Share on other sites

I have updated the long war compatible version:

* Locked down rank 1 to only allow edit of perk 1 and 2.

* Removed Rank 8-11

* Removed Perk 3 for PSI

* Put in descriptions to make it intuitive how the perks vs classes thing works

 

Should be backwards compatible with existing links.

Edited by Bertilsson
Link to comment
Share on other sites

  • 3 months later...

Hello! Thank you for a wonderful mod, JL and Amineri, and a nifty perk adjustment tool, Bertilsson. I've been having a lot of fun with both!

 

Now, I'm wondering if there is a problem with the way version 0.97 of the perk tree generator works with Long War 2.11: though I can patch in any changes I make just fine, my Assaults and Infantry are swapped.

 

E.g., I set Run & Gun as perk 1 and Close and Personal as perk 2. When a soldier promotes to squaddie and I pick Run & Gun, he promotes to Assault and is equipped with a shotgun by default.

 

I then change Run & Gun to perk 2 and make Close and Personal perk 1... and get the same outcome.

 

The other classes do not seem to have this problem.

Link to comment
Share on other sites

@ eld10 :

 

Although Bertilsson's tool allows you to change any of the perks around, there is some additional code to set the subclass based upon the specific perk selected at Squaddie.

 

This function is in XcomStrategyGame.upk, and is XGStrategySoldier.SetClass. The vanilla function is defined to accept the class, but the modded version is now passed a perk enum (the same enum values that Bertilsson's web tool shows).

 

There is a switch/case statement that has a case for each subclass-defining perk (e.g. Squadsight, Lightning Reflexes, Run and Gun).

 

If you want to change one of the squaddie perks (which is a defining perk to define the subclass) then the case values in SetClass have to be updated to match in order to make the class selection work properly.

 

-----------------

 

As an aside, I'm not at all sure how I'm going to make this system work in EW (from both a technical and a balance perspective). There's both a new XCOM Class (MEC) and a new enemy faction with the same class structure (EXALT).

Link to comment
Share on other sites

 

My eventual plans for the ranks 8 to 11 involve the free 4 rank slots in the psi tree. Am thinking of eventually adding in either more ranks for the soldiers (which has been suggested as an idea, or allowing for some additional choices at certain ranks. Perk choices are still somewhat limited, so adding in too many more ranks probably wouldn't work. However, I'd thought of allowing some choices between different stats bonuses at certain ranks.

 

Fantastically, Firaxis independently came up with the idea of adding more stats and perks to soldiers (stats via medals and perks via gene-mods).

 

Of course Firaxis has the source code, so they added additional UIs for each new mechanic. With this I'm pretty sure there's no need for me to add this capability in the EW-version of the expanded perk tree.

 

Instead my initial version will likely focus on expanding the possible options for each the sprites : MEC ability tree, Genemod selection, and Medal selection. Also there must be some new data structures to support the new SW option training Roulette, which means quite a few under-the-hood changes to how the mod will be implemented.

Link to comment
Share on other sites

Hi, Amineri. Thanks for a super quick and informative reply!

So that's what's going on. Hmm... I guess the fact that changing the Gunner's defining perk to Extra Conditioning worked is a bit of luck? Guess I'll have to read up on upk editing if I want the classes to look the way I do.

-------------------

One reason I'm putting off getting EW is that I'm having too much fun with Long War to consider playing without it. >_>

Link to comment
Share on other sites

There is a default setup for a soldier if the perk isn't found. Access to eWP_Rifle weapons (which would mean the Gunner shouldn't be getting access to LMGs, as that is defined via eWP_Support in Long War).

 

Fortunately the hex edits required to change a subclass-defining perks are of the simplest "value change" variety.

 

If you use UE Explorer to open up XComStrategyGame, and then open XGStrategySoldier.SetClass, you'll see the following code:

 

 

function SetClass(XComGame.XGTacticalGameCoreData.ESoldierClass eNewClass)
{
    local TInventory kNewLoadout;

    // End:0x14
    if(eNewClass == 69)
    {
        return;                
    }
    kNewLoadout = m_kChar.kInventory;
    Option = 0;
    m_kSoldier.kClass.eWeaponType = 5;
    branch = 3;
    switch(eNewClass)
    {
        // End:0xDC
        case 3:
            m_kSoldier.kClass.eWeaponType = 7;
            branch = 6;
            // End:0x264
            break;
        // End:0xEF
        case 35:
            Option = 1;
            // End:0x264
            break;
        // End:0x135
        case 6:
            m_kSoldier.kClass.eWeaponType = 6;
            branch = 4;
            // End:0x264
            break;
        // End:0x17A
        case 26:
            Option = 1;
            m_kSoldier.kClass.eWeaponType = 6;
            // End:0x264
            break;
        // End:0x1C0
        case 21:
            m_kSoldier.kClass.eWeaponType = 4;
            branch = 5;
            // End:0x264
            break;
        // End:0x214
        case 18:
            m_kSoldier.kClass.eWeaponType = 8;
            branch = 1795;
            Option = 1;
            // End:0x264
            break;
        // End:0x21C
        case 48:
            // End:0x264
            break;
        // End:0x261
        case 24:
            Option = 1;
            m_kSoldier.kClass.eWeaponType = 6;
            // End:0x264
            break;
        // End:0xFFFF
        default:
            TACTICAL().TInventoryLargeItemsSetItem(kNewLoadout, 0, branch & 255);
            // End:0x2DF
            if(IsInjured())
            {
                TACTICAL().TInventoryLargeItemsSetItem(m_kInjuredLoadout, 0, branch & 255);
            }
            branch = 255 & (branch >> 8);
            // End:0x37C
            if(branch > 0)
            {
                TACTICAL().TInventoryLargeItemsSetItem(kNewLoadout, 1, branch);
                // End:0x37C
                if(IsInjured())
                {
                    TACTICAL().TInventoryLargeItemsSetItem(m_kInjuredLoadout, 1, branch);
                }
            }
            LOCKERS().ApplySoldierLoadout(self, kNewLoadout);
            ParseStringIntoArray(class'XGLocalizedData'.default.SoldierClassNames[GetClass()], SplitStr, "/", true);
            m_kSoldier.kClass.strName = SplitStr[Option];
            OnLoadoutChange();
            return;
    } 

 

 

 

What the modded version of SetClass does is:

1) Define the weapon class the soldier can use (e.g. m_kSoldier.kClass.eWeaponType = 6;)

2) Define the initial weapon loadout (e.g. equipping a Gunner with an LMG)

3) Define which split of the combined classname the soldier gets (e.g. Gunner out of Gunner/Rocketeer).

 

The defaults for these are:

1) Weapon class 5 (eWP_Rifle)

2) Assault Rifle

3) The first half of the classname

 

To change the subclass-defining perk the case value has to be changed, as in :

        case 3:
            m_kSoldier.kClass.eWeaponType = 7;
            branch = 6;
            // End:0x264
            break;

The 3 here refers to perk 3, Squadsight. So this is the case that handles selecting the Sniper Subclass from Sniper/Scout. If you were to change the initial defining perk for Sniper to something else, it is this value that has to be changed.

 

Hex values for case statements are pretty straightforward:

case 3:
0A DC 00 24 03 

The 0A is the token for 'case'. The DC 00 is the jump offset (don't worry about that, as it's not changing). The 24 defines a byte-constant. The 03 value is the '3' part of the case 3:

 

Just changing that number will change the required perk.

 

Hopefully this helps :)

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...