Jump to content

UI Mod - Bigger Perk Tree


Amineri

Recommended Posts

How about

function OnPromotionLeft()
{
    SetAbilityTreeOption(OnPromotionRight()); 
}
function OnPromotionRight()
{
    Return (GetAbilityTreeOption()+1)%4; 
}

Or

function OnPromotionLeft()
{
    SetAbilityTreeOption(m_kSoldierAbilityTree.Option+1); /Only working for ability tree
}
function OnPromotionRight()
{
    SetAbilityTreeOption(m_kSoldierPsiTree.Option+1); /Only workig for PSI-tree
}
Link to comment
Share on other sites

  • Replies 193
  • Created
  • Last Reply

Top Posters In This Topic

The m_kSoldierAbilityTree is a struct, so the m_kSoldierAbilityTree.Option construct looks like:

 

35 ## ## 00 00 ## ## 00 00 00 00 01 ## ## 00 00 -- the first blank is the reference to Option, the second blank is the reference to TAbilityTree, and the third blank is the reference to m_kSoldierAbilityTree. Just that one reference is 16 bytes long, which eats all but 5 of the available bytes just making the reference.

 

I played around a bit with having SetAbilityTreeOption treat the 0 and 1 values as right/left commands, and using a shift-left 1 bit operator to store an actual value.

 

Something like:

simulated function SetAbilityTreeOption(int setOption)
{
	if(setOption > 1) // 0 and 1 are reserved for left/right operations ... larger numbers represent actual number to set
        {
                m_kSoldierAbilityTree.Option = (setOption >> 1);
		return;
	}
	
	--m_kSoldierAbilityTree.Option += (setOption == 0 ? 0 : 2);
	return;		
}

I think this fits but it doesn't address the boundary issues (nor blank spaces)

 

Link to comment
Share on other sites

I guess the last option after ruling out the possibility to buy the source code would be this:

function OnPromotionLeft()
{
    BigUnusedFunction(1); //Or -1 for Right function
}

function BigUnusedFunction(int direction)
{
    //Figure out which is the next valid perk option for given direction;
    //Select next valid perk option
    return;
}
Link to comment
Share on other sites

Okay, I've worked out an option to make the keyboard / controller usable. It's still a little bit glitchy but completely usable.

 

I took over the unused function XGSoldierUI.RotateSoldier (the actual implementation of rotating the soldier on the plinth bypasses this function).

 

So now OnPromotionLeft() calls RotateSoldier(1) and OnPromotionRight() calls RotateSoldier(0).

 

RotateSoldier isn't a really big function either, with 78 usable bytes, but it's better than the original functions.

 

RotateSoldier simply executes:

SetAbilityTreeOption(Clamp(GetAbilityTreeOption() + (Dir *2) - 1, 0, 2);

I looked into checking against valid perks, but just the basic call to GetPerkInTree takes 78 bytes, so it's not going to happen. This allows moving the selector bracket freely around the 3x7 (or 3x3 for psi tree) perk grid. Empty perks will have the bracket highlight the space but show no information.

 

Navigating down below the current rank will give 'locked perk' info. It's not quite ideal as I wanted to entirely suppress display of anything below the current rank, but it works better than the current implementation.

 

Here are the hex changes for people to test :

 

 

XGSoldierUI.RotateSoldier
	
original hex:
header:
98 3F 00 00 AB 1F 00 00 00 00 00 00 97 3F 00 00 00 00 00 00 00 00 00 00 98 3F 00 00 00 00 00 00 44 01 00 00 2C 20 00 00 75 00 00 00 51 00 00 00 

body: (81 file bytes)
07 72 00 82 77 01 79 3F 00 00 2A 16 18 22 00 77 19 01 79 3F 00 00 09 00 E0 44 00 00 00 01 E0 44 00 00 2A 16 16 19 19 01 79 3F 00 00 09 00 E0 44 00 00 00 01 E0 44 00 00 13 00 00 00 00 00 00 1B 49 23 00 00 00 00 00 00 00 98 3F 00 00 16 04 0B 53 


original hex: (virtual 0x55)
header:
98 3F 00 00 AB 1F 00 00 00 00 00 00 97 3F 00 00 00 00 00 00 00 00 00 00 98 3F 00 00 00 00 00 00 44 01 00 00 2C 20 00 00 55 00 00 00 51 00 00 00 

body: (81 file bytes)
1B A5 23 00 00 00 00 00 00 FB 93 92 1B 70 0E 00 00 00 00 00 00 16 90 00 98 3F 00 00 2C 02 16 16 26 16 25 2C 02 16 16 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 04 0B 53 


Have to replace both calls in OnPromotionLeft and OnPromotionRight with RotateSoldier

For OnPromotionRight change:
1B A5 23 00 00 00 00 00 00 25 16 1B E0 21 00 00 00 00 00 00 16 
to:
1B 4B 23 00 00 00 00 00 00 25 16 1B E0 21 00 00 00 00 00 00 16 


For OnPromotionLeft change:
1B A5 23 00 00 00 00 00 00 26 16 1B E0 21 00 00 00 00 00 00 16 
to:
1B 4B 23 00 00 00 00 00 00 26 16 1B E0 21 00 00 00 00 00 00 16  

 

 

 

Any feedback is helpful so I can make sure there are no obvious defects before I release an update of the ToolBoks Custom Mod file.

Link to comment
Share on other sites

Seems to be working as planned.

I edited my currently installed Merciless v1.5 Beta.

 

I can freely roam around the 3*7 (including locked ranks).

But I cannot select any locked perks, so no mega-cheat option accidently included :)

 

I also tested to select one of the eAbility_NONE perks, and it asked me to confirm if I really wanted to select that perk and then happily allowed me to do it.

 

It showed up as ?-icon in that soldiers list of perks.

Link to comment
Share on other sites

Toolboks custom mod changes:

 

 

UPK_FILE=XComStrategyGame.upk
OFFSET=3736154
[MODDED_HEX]
{hex offset 0x39025A}
{XGSoldierUI.RotateSoldier}

{Install}
98 3F 00 00 AB 1F 00 00 00 00 00 00 97 3F 00 00 00 00 00 00 00 00 00 00 98 3F 00 00 00 00 00 00 44 01 00 00 2C 20 00 00 55 00 00 00 51 00 00 00 1B A5 23 00 00 00 00 00 00 FB 93 92 1B 70 0E 00 00 00 00 00 00 16 90 00 98 3F 00 00 2C 02 16 16 26 16 25 2C 02 16 16 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 04 0B 53

{uninstall}
{98 3F 00 00 AB 1F 00 00 00 00 00 00 97 3F 00 00 00 00 00 00 00 00 00 00 98 3F 00 00 00 00 00 00 44 01 00 00 2C 20 00 00 75 00 00 00 51 00 00 00 07 72 00 82 77 01 79 3F 00 00 2A 16 18 22 00 77 19 01 79 3F 00 00 09 00 E0 44 00 00 00 01 E0 44 00 00 2A 16 16 19 19 01 79 3F 00 00 09 00 E0 44 00 00 00 01 E0 44 00 00 13 00 00 00 00 00 00 1B 49 23 00 00 00 00 00 00 00 98 3F 00 00 16 04 0B 53}


UPK_FILE=XComStrategyGame.upk
OFFSET=3739901
[MODDED_HEX]
{hex offset 0x3910fD}
{XGSoldierUI.OnPromotionRight}

{Install}
1B 4B 23 00 00 00 00 00 00 25 16 1B E0 21 00 00 00 00 00 00 16

{uninstall}
{1B A5 23 00 00 00 00 00 00 25 16 1B E0 21 00 00 00 00 00 00 16}


UPK_FILE=XComStrategyGame.upk
OFFSET=3739988
[MODDED_HEX]
{hex offset 0x391154}
{XGSoldierUI.OnPromotionRight}

{Install}
1B 4B 23 00 00 00 00 00 00 26 16 1B E0 21 00 00 00 00 00 00 16

{uninstall}
{1B A5 23 00 00 00 00 00 00 26 16 1B E0 21 00 00 00 00 00 00 16} 

 

 

Link to comment
Share on other sites

I don't know if anyone else is having this problem, but I've setup all 4 class perk trees with only a single option at each rank (yeah, boring I know), and it works great in that the perks I assigned are selectable and work, but there is also at each rank a second "option" with no perk and no icon (left of the assigned perks). I haven't been game to try selecting one of the "non" options cos I don't want to create a tear in the space-time continuum... (joke btw)

 

Any ideas?

 

Thanks :)

 

Also, is there a way currently that I can swap "Mind Control" and "Rift" in the psi tree (I never use MC except this one time at band camp... erm I mean on the Ethereal's ship - to get the achievement - so I figure the "volunteer" can have it... and Rift is the bomb)

 

U guys rock!!!

Link to comment
Share on other sites

Also, is there a way currently that I can swap "Mind Control" and "Rift" in the psi tree (I never use MC except this one time at band camp... erm I mean on the Ethereal's ship - to get the achievement - so I figure the "volunteer" can have it... and Rift is the bomb)

 

Well... you could always try this:

 

 

Asuming you already have toolboks and enhanced perk mod installed:

1. Copy this to a text file and save it in Toolboks custom mod-folder

MOD_NAME=PSI-rift-cheat
AUTHOR=blacklimoband
DESCRIPTION=Custom XCOM cheat for Enhanced Perk tree mod

UPK_FILE=XComGame.upk
OFFSET=7169126
[MODDED_HEX]
4A {Add rift to PSI level 3}

UPK_FILE=XComGame.upk
OFFSET=7169147
[MODDED_HEX]
48 {Add mind control to PSI level 4} 

2. Open toolboks and load the mod same way you did for enhanced perk tree mod.

3. You should now have Rift as an extra option for level 3 and mind control as an extra option for level 4.

4. Test it on your own risk :)

 

 

Link to comment
Share on other sites

I don't know if anyone else is having this problem, but I've setup all 4 class perk trees with only a single option at each rank (yeah, boring I know), and it works great in that the perks I assigned are selectable and work, but there is also at each rank a second "option" with no perk and no icon (left of the assigned perks). I haven't been game to try selecting one of the "non" options cos I don't want to create a tear in the space-time continuum... (joke btw)

 

Any ideas?

 

 

I'm not quite sure I follow. With the controller any of the 3x7 space can be highlighted, but only spaces with valid perks can be selected. When using a mouse only spaces with highlighted perks should be selectable.

 

If you can a screenshot showing the issue would be much appreciated.

 

My design plan for the perk tree includes have 0, 1, 2, or 3 perk choices at any rank. If 0 valid perks are available to select at a rank that rank should be auto-promoted with no player action required (same if there is 1 perk choice but it was selected at an earlier rank).

Link to comment
Share on other sites

I'm having the same issue,

 

I installed the latest Toolboks when I noticed an update but didn't apply the stand alone Expanded Perk Trees modlet (I think this is why).

 

Three perks per rank works however with no problems, although the UI formatting is clearly right biased (and any rank with a only a single perk displays a 'phantom' slot.)

 

http://i16.photobucket.com/albums/b39/Zybortrix/2013-06-26_00002.jpg

 

Screenie ^

Edited by Zybertryx
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...