Jump to content

UI Mod - Bigger Perk Tree


Amineri

Recommended Posts

  Quote

 

S_UiSoldierPromotion_UpdateAbilityData.upk_mod shows up in red when testing it's status

 

This may be because you didn't decompress UPKFILE=UICollection_Strategy_SF.upk

 

This file contains the Flash (actionscript + sprite) changes necessary to allow additional perk icons. The vanilla perk tree sprite was actually hard-coded to the 1-2-2-2-2-1-2 format, so the sprite had to be extended to allow up to 3 perk icons per level.

 

  Quote

 

Is there a way to determine what the error was?

 

UPKmodder isn't very good about dynamically refreshing the contents of the project pane when changes are made to the contents via Windows Explorer. It's one of the bigger workarounds I still have to deal with -- if rearranging or renaming files in Windows Explorer, it's necessary to close and re-open UPKmodder to get it to refresh properly. For a smaller mod like this it's not too cumbersome, but Long War with it's 1000+ files is a bit more awkward.

Link to comment
Share on other sites

  • Replies 193
  • Created
  • Last Reply

Top Posters In This Topic

  On 6/22/2014 at 9:24 PM, Amineri said:

 

  Quote

S_UiSoldierPromotion_UpdateAbilityData.upk_mod shows up in red when testing it's status

This may be because you didn't decompress UPKFILE=UICollection_Strategy_SF.upk

 

This file contains the Flash (actionscript + sprite) changes necessary to allow additional perk icons. The vanilla perk tree sprite was actually hard-coded to the 1-2-2-2-2-1-2 format, so the sprite had to be extended to allow up to 3 perk icons per level.

 

Actually, that file is listed as being UPKFILE=XComStrategyGame.upk. Either way, all of them should be decompressed.

 

Edit: Alright, so.

 

I went through the __S_UiSoldierPromotion_UpdateAbilityData.upk_mod row by row, and I found the following hexes weren't matching up with the XComStrategyGame.upk (marked down by row in Notepad+):

 

Row 88.
Does not exist:
07 19 02 99 00 FB 1A 00 00 00 F7 1A 00 00 16

Does exist:
06 19 02 99 00 FB 1A 00 00 00 F7 1A 00 00 16

Row 122.
Does not exist:
07 CD 04 99 00 FB 1A 00 00 00 F7 1A 00 00 16

Does exist:
06 CD 04 99 00 FB 1A 00 00 00 F7 1A 00 00 16

So by replacing those and removing the "__" in front of the name of two of the files (because for some reason, they just wouldn't install otherwise.. maybe this was intentional?), everything seems to now have installed just fine. I haven't tried launching XCom yet, though, so.. here's hoping it'll work. I have to first update the .ini-files, though, to conform to the new format.

 

Edit 2: AHA! It seems to be working! Unfortunately, it broke "Rig the Roulette Wheel" (http://www.nexusmods.com/xcom/mods/449/?), but I'm going to see if I can get them both working at the same time, by uninstalling both, re-installing the Bigger Perk Tree, and then examine Rig the Roulette Wheel to see if I can hit it with a wrench until it gives in and gives me both.

 

Thanks for all the help. :smile:

 

Edit 3: Oh christ almighty who arth in heaven, I'm retarded, god dammit, I'm so sorry for wasting your time. I think it was the Rig the Roulette Wheel mod that was interfering the whole time. It specifically changes 07 19 02 to 06 19 02 and 07 CD 04 to 06 CD 04. I have no idea what I was thinking, I've been brainwashed by press-button-to-install mods for way too long, I'd forgotten the first tenet of troubleshooting - reduction of parameters. That is, remove all the fedging mods that might interfere. God. Dammit.

Edited by SwedenRebel
Link to comment
Share on other sites

Well, I'm glad you were able to get it figured out :)

 

And yes, it appears that the "Rig the Roulette Wheel" mod had modded some hexcode that the Expanded Perk Tree also wanted to mod, thus making them incompatible.

 

When starting a line like that 07 is the token for 'jumpifnot', basically creating an if-statement. 06 is the token for 'unconditionaljump'. So the "Rig the Roulette Wheel" was changing those two if statements into unconditional jumps, thus preventing them from ever executing.

 

The first change breaks the conditional displaying "unknown" icon instead of the actual perk icon for perks above the current rank.

The second change breaks the conditional to hid the background info for perks above the current rank.

 

For the Expanded Perk Tree I work it differently -- instead of displaying "unknown" the perks are entirely hidden. This turned out to be necessary for Long War, because the later perks aren't even known until after the 1st rank perks are picked -- a consequence of the subclass system (e.g. Support class can't determine perks for ranks 2-7 until after the first rank perk is picked setting subclass to either Medic or Engineer).

 

Anyhow, that's not really needed for the core Expanded perk tree, so feel free to further mod in a version to display future perks.

Link to comment
Share on other sites

Also, sorry about leaving the double underscore prefix on a couple of those files. The double underscore prefix is a code to UPKmodder that a file is deprecated and should be applied/reverted as part of a bulk apply/revert process -- it's still possible to apply/revery by opening the file and using the apply/revert buttons directly, however.

 

Those two files were updated for Long War -- in both cases the substantial changes to the psionics system required rewriting those functions. However, instead of totally rewriting them I kept the simpler versions but deprecated them and created new versions that merged the expanded perk tree + Long War psionics. My goal in doing this was precisely to keep a version of the Expanded Perk Tree mod that was independent of the Long War psionic changes.

 

However, I forgot to removed the deprecation marks before uploading -- my apologies.

Link to comment
Share on other sites

First of all, thanks for all the help. :smile:

  On 6/24/2014 at 6:33 PM, Amineri said:

[...]

Anyhow, that's not really needed for the core Expanded perk tree, so feel free to further mod in a version to display future perks.


Secondly, I'm trying, at the moment. However, I can't figure out how the structure in these files work, in the .upk_mod-files. Clearly and obviously the [bEFORE_HEX] is the section to be changed, while [AFTER_HEX] is the section detailing what to change the previous section into, but how do I know which part of the BEFORE_HEX correspond to the AFTER_HEX? Can I at all?

Because I need to find what is originally 07 19 02 and 07 CD 04, to be able to determine what to change them into for a "Rig the Roulette Wheel" setup. Rig the Roulette Wheel wants to change these sections into 06 19 02 and 06 CD 04 respectively, but obviously I cannot find these first parts (since they are changed by the Bigger Perk Tree), nor should I change them into exactly what the Rig the Roulette Wheel mod wants to change it to (since these parts now look differently).

I tried matching the BEFORE_HEX and AFTER_HEX sections up side-by-side, but it doesn't always correspond straight over, and I'm having a hard time working out how the 07 19 02 99 00 FB 1A 00 00 00 F7 1A 00 00 16 (which contains the 07 19 02) string and the 07 CD 04 99 00 FB 1A 00 00 00 F7 1A 00 00 16 (which contains the 07 CD 04) string looks post-Bigger Perk Tree.

Edit: Actually, thinking about it, I shouldn't need to do that, because if I understand what you're saying, I should just (..."just") have to remove the parts of your Bigger Perk Tree mod that ends up hiding the perks completely (rather than displaying "Unknown"). Unfortunately, I have absolutely no clue how to do that, but that seems like the more likely solution.

Edit 2: I cannot for the life of me find the function that hides the perks, although I can see that you added a function that makes it so that if there is a duplicate Perk (a very real possibility with 3 perks/rank), you cannot take it, provided I'm reading this right. Neat. That said, I feel like the more I stare at this the more I understand.

...I've been looking for something you added that made the Perks not display, but I'm looking in the wrong place, aren't I? If you simply took the function out, nothing would display. What I need to try to do is to look at the code before the mod was applied, and actually re-add the function that makes the perks display, and then make it ignore the function that made it display the "Unknown" icons. This should be... interesting.

I'm surprised I still haven't irrevocably broken something.

Edited by SwedenRebel
Link to comment
Share on other sites

The BEFORE and AFTER sections of code work basically like a Search and Replace using a hex editor. If there's no resizing, it works exactly like that. With resizing it works similarly, except that UPKmodder does a whole bunch of extra stuff in the background to fix up UPK positions and such so that the UPK still functions properly -- this is on the order of 10,000 to 50,000 individual changes !

 

I think the section of modded hex you'd want to change is :

	// if(column >= SoldierRank)
	07 D3 00 99 00 FB 1A 00 00 00 F7 1A 00 00 16

This is the part that sets up to hide the future perks -- the mod actually hides the perks and background instead of displaying a "locked" icon. Changing the leading 07 to 06 changes it from a conditional to unconditional jump, basically making it act as though the conditional were always false.

Link to comment
Share on other sites

  On 6/24/2014 at 9:17 PM, Amineri said:

The BEFORE and AFTER sections of code work basically like a Search and Replace using a hex editor. If there's no resizing, it works exactly like that. With resizing it works similarly, except that UPKmodder does a whole bunch of extra stuff in the background to fix up UPK positions and such so that the UPK still functions properly -- this is on the order of 10,000 to 50,000 individual changes !

 

I think the section of modded hex you'd want to change is :

	// if(column >= SoldierRank)
	07 D3 00 99 00 FB 1A 00 00 00 F7 1A 00 00 16
This is the part that sets up to hide the future perks -- the mod actually hides the perks and background instead of displaying a "locked" icon. Changing the leading 07 to 06 changes it from a conditional to unconditional jump, basically making it act as though the conditional were always false.

 

Hmmm.. changing that particular bit of code for 07 ... to 06 ... doesn't seem to have changed anything by itself. Now, this is how the Rig the Roulette Wheel does it's thing, completely separate from Bigger Perk Tree:

 

UPK_FILE=XComStrategyGame.upk
OBJECT=UISoldierPromotion.UpdateAbilityData
[BEFORE_HEX]
07 19 02
[AFTER_HEX]
06 19 02
[BEFORE_HEX]
07 CD 04
[AFTER_HEX]
06 CD 04

OBJECT=XGSoldierUI.GetHighlightedPerk
[BEFORE_HEX]
07 D6 00
[AFTER_HEX]
07 C9 00

OBJECT=XGSoldierUI.GetHighlightedPerkDescription
[BEFORE_HEX]
07 7D 01
[AFTER_HEX]
07 50 01

OBJECT=XGSoldierUI.GetHighlightedPromoPerkName
[BEFORE_HEX]
07 0B 01
[AFTER_HEX]
07 C9 00
Now, the lower three aren't changed by Bigger Perk Tree at all - or if it is, then Rig the Roulette Wheel doesn't seem to care when installing via the XCOM Patcher GUI. But the upper two are each part of the Bigger Perk Tree mod, in these two instances:

 

        // if(column >= SoldierRank)
        07 19 02 99 00 FB 1A 00 00 00 F7 1A 00 00 16

            // AS_SetAbilityIcon(column, Row, "unknown", m_kSoldier.HasPerk(Perk))
            1B 5C 02 00 00 00 00 00 00 00 FB 1A 00 00 00 FA 1A 00 00 1F 75 6E 6B 6E 6F 77 6E 00 19 01 BE 1A 00 00 13 00 39 54 00 00 00 1B 42 14 00 00 00 00 00 00 00 F9 1A 00 00 16 16
and

        // if(column >= SoldierRank)
        07 CD 04 99 00 FB 1A 00 00 00 F7 1A 00 00 16

            // AS_SetColumnData(column, Caps(XComGameReplicationInfo(class'Engine'.static.GetCurrentWorldInfo().GRI).m_kGameCore.GetRankString(column + 1)), 3)
            1B 75 02 00 00 00 00 00 00 00 FB 1A 00 00 EB 19 19 2E 55 FE FF FF 19 12 20 C6 FE FF FF 0A 00 8F FA FF FF 00 1C 3E FD FF FF 16 09 00 77 FA FF FF 00 01 77 FA FF FF 09 00 46 FA FF FF 00 01 46 FA FF FF 18 00 FD F8 FF FF 00 1B 18 13 00 00 00 00 00 00 92 00 FB 1A 00 00 26 16 4A 4A 16 16 2C 03 16

Now, it would seem to me, when I look over this, that the first corresponds to the section of the modded hex that you posted;

    // if(column >= SoldierRank)
    07 D3 00 99 00 FB 1A 00 00 00 F7 1A 00 00 16
But changing the 07 (if) to a 06 (else) doesn't seem to do anything.

 

I'll keep poking at it in the morning.

Edited by SwedenRebel
Link to comment
Share on other sites

  • 1 month later...
  On 2/18/2014 at 4:35 PM, Amineri said:

Am posting up my latest revision of the Expanded Perk Tree mod, including various testing that's gone on in our internal Long War testing. I've also consolidated all of the actionscript/sprite changes into a single upk_mod file that's a bit easier to install.

 

Actionscript/Sprite change:

 

  Reveal hidden contents

 

 

Core unreal changes:

 

 

  Reveal hidden contents

 

 

To install the above changes UICollection_Strategy_SF.upk, XComGame.upk, and XComStrategyGame.upk must be decompressed.

 

 

The following changes patch up gamepad/keyboard functionality. If you're only using a mouse you can skip these:

 

 

  Reveal hidden contents

 

 

To make changes to the DGC.ini, you'll need to have installed the XComEW.exe-patch to force the game to load DefaultGameCore.ini from file instead of Resource Cache.

 

Perks are configured in the DGC.ini using the following template:

SoldierPerkTrees=(SoldierType=eSC_Sniper,		Squaddie=ePerk_SquadSight, 			Corporal1=ePerk_SquadSight, Corporal2=0, Sergeant1=ePerk_DamnGoodGround, Sergeant2=0, Lieutenant1=ePerk_BattleScanner,  Lieutenant2=0, Captain1=ePerk_Opportunist, Captain2=0, Major=0, 				Colonel1=ePerk_DoubleTap, 	Colonel2=0)
SoldierPerkTrees=(SoldierType=eSC_Sniper,		Squaddie=0, 						Corporal1=0, 				Corporal2=0, Sergeant1=0, 					 Sergeant2=0, Lieutenant1=0, 					Lieutenant2=0, Captain1=0, 				   Captain2=0, Major=ePerk_LowProfile, 	Colonel1=0, 				Colonel2=0)
SoldierPerkTrees=(SoldierType=eSC_Sniper,		Squaddie=ePerk_LightningReflexes, 	Corporal1=ePerk_SnapShot, 	Corporal2=0, Sergeant1=ePerk_Gunslinger, 	 Sergeant2=0, Lieutenant1=ePerk_DisablingShot,  Lieutenant2=0, Captain1=ePerk_Executioner, Captain2=0, Major=0, 				Colonel1=ePerk_InTheZone, 	Colonel2=0)

SoldierPerkTrees=(SoldierType=eSC_HeavyWeapons,	Squaddie=ePerk_FireRocket, 			Corporal1=ePerk_TracerBeams, Corporal2=0, Sergeant1=ePerk_FocusedSuppression, 	Sergeant2=0, Lieutenant1=ePerk_RapidReaction, 	Lieutenant2=0, Captain1=ePerk_DangerZone, Captain2=0, Major=0, 					 Colonel1=ePerk_Mayhem, 	Colonel2=0)
SoldierPerkTrees=(SoldierType=eSC_HeavyWeapons,	Squaddie=0,  						Corporal1=0, 				 Corporal2=0, Sergeant1=0, 							Sergeant2=0, Lieutenant1=0, 					Lieutenant2=0, Captain1=0, 				  Captain2=0, Major=ePerk_WillToSurvive, Colonel1=0, 				Colonel2=0)
SoldierPerkTrees=(SoldierType=eSC_HeavyWeapons,	Squaddie=ePerk_FocusedSuppression, 	Corporal1=ePerk_BulletSwarm, Corporal2=0, Sergeant1=ePerk_ShredderRocket, 		Sergeant2=0, Lieutenant1=ePerk_HEATAmmo, 		Lieutenant2=0, Captain1=ePerk_Grenadier,  Captain2=0, Major=0, 					 Colonel1=ePerk_Rocketeer, 	Colonel2=0)

SoldierPerkTrees=(SoldierType=eSC_Support,		Squaddie=ePerk_FieldMedic, 	Corporal1=ePerk_CoveringFire, Corporal2=0, Sergeant1=ePerk_SmokeAndMirrors, Sergeant2=0, Lieutenant1=ePerk_FocusedSuppression,  Lieutenant2=0, Captain1=ePerk_CombatDrugs, 	Captain2=0, Major=0, 				 Colonel1=ePerk_Sentinel, 	Colonel2=0)
SoldierPerkTrees=(SoldierType=eSC_Support,		Squaddie=0, 				Corporal1=0,  Corporal2=0, Sergeant1=0, 					Sergeant2=0, Lieutenant1=0, 						Lieutenant2=0, Captain1=0, 					Captain2=0, Major=ePerk_DeepPockets, Colonel1=0, 				Colonel2=0)
SoldierPerkTrees=(SoldierType=eSC_Support,		Squaddie=ePerk_Grenadier, 	Corporal1=ePerk_Sprinter, 	  Corporal2=0, Sergeant1=ePerk_FieldMedic, 		Sergeant2=0, Lieutenant1=ePerk_Revive, 				Lieutenant2=0, Captain1=ePerk_DenseSmoke, 	Captain2=0, Major=0, 				 Colonel1=ePerk_Savior, 	Colonel2=0)

SoldierPerkTrees=(SoldierType=eSC_Assault,		Squaddie=ePerk_RunAndGun, 	Corporal1=ePerk_Aggression, 	Corporal2=0, Sergeant1=ePerk_CloseAndPersonal, 	Sergeant2=0, Lieutenant1=ePerk_RapidFire, 	Lieutenant2=0, Captain1=ePerk_BringEmOn, 			 Captain2=0, Major=0, 					    Colonel1=ePerk_KillerInstinct,  Colonel2=0)
SoldierPerkTrees=(SoldierType=eSC_Assault,		Squaddie=0, 				Corporal1=0, 					Corporal2=0, Sergeant1=0, 						Sergeant2=0, Lieutenant1=0, 				Lieutenant2=0, Captain1=0, 							 Captain2=0, Major=ePerk_ExtraConditioning, Colonel1=0, 					Colonel2=0)
SoldierPerkTrees=(SoldierType=eSC_Assault,		Squaddie=ePerk_BulletSwarm, Corporal1=ePerk_TacticalSense, 	Corporal2=0, Sergeant1=ePerk_LightningReflexes, Sergeant2=0, Lieutenant1=ePerk_Flush, 		Lieutenant2=0, Captain1=ePerk_CloseCombatSpecialist, Captain2=0, Major=0, 					    Colonel1=ePerk_Resilience,  	Colonel2=0)

SoldierPerkTrees=(SoldierType=eSC_Psi,			Squaddie=0, 			 Corporal1=ePerk_PsiPanic, 			Corporal2=0, Sergeant1=ePerk_MindControl, 	  	Sergeant2=0, Lieutenant1=0,	Lieutenant2=0, Captain1=0, 	Captain2=0, Major=0, Colonel1=0,	Colonel2=0)
SoldierPerkTrees=(SoldierType=eSC_Psi,			Squaddie=ePerk_MindFray, Corporal1=0, 						Corporal2=0, Sergeant1=0, 					 	Sergeant2=0, Lieutenant1=0, Lieutenant2=0, Captain1=0, 	Captain2=0, Major=0, Colonel1=0, 	Colonel2=0)
SoldierPerkTrees=(SoldierType=eSC_Psi,			Squaddie=0, 			 Corporal1=ePerk_PsiInspiration, 	Corporal2=0, Sergeant1=ePerk_TelekineticField, 	Sergeant2=0, Lieutenant1=0, Lieutenant2=0, Captain1=0, 	Captain2=0, Major=0, Colonel1=0, 	Colonel2=0)

Unfortunately this hasn't been converted into a more end-user-friendly method of installation such as Toolboks or UPK-Utils. I've managed to avoid resizing any functions so it should be able to be converted into either format.

Hey Amineri, I was just wondering if you ever plan on converting it to the custom mod format for Toolboks or Utils? Or at least a tutorial on how to convert it, as I can't seem to figure out how on my own, and I would really love for this to work on EW.

 

One other question, is there a way, once this is installed, to have a separate mod file to recreate the perk trees, like the old mod file? I can't seem to enable direct ini loading, for various reasons :sad: And I was hoping there was a UPK-Utils method of replacing perks or adding perks.

 

Thanks in advance for your reply.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...