Jump to content

Probably found a way to edit ability tree's of your troops and ene


Nolanoth

Recommended Posts

Once you unpack the XComGame.upk file and open it up with UE Explorer or anything else you'll notice it has a lot of XGAbility entries which contain certain ability data.

 

One entry in particular:

AGAbilityTree

 

Contains what I believe is the list of Ability Tree's for each class along with the alien abilities such as "PSI Lance" or "Mind Merge". The list goes like this:

 

	AbilityNames[1]="Move"
AbilityNames[2]="Toggle Flight"
AbilityNames[3]="Ascend"
AbilityNames[4]="Descend"
AbilityNames[5]="Launch"
AbilityNames[6]="Grapple"
AbilityNames[7]="Fire"
AbilityNames[8]="Rapid Fire"
AbilityNames[9]="Stun"
AbilityNames[10]="Drone Hack"
AbilityNames[11]="Overload"
AbilityNames[12]="Flush"
AbilityNames[17]="Suppression"
AbilityNames[22]="Frag Grenade"
AbilityNames[23]="Smoke Grenade"
AbilityNames[24]="Alien Grenade"
AbilityNames[25]="Fire Rocket"
AbilityNames[26]="Aim"
AbilityNames[27]="Intimidate"
AbilityNames[33]="Overwatch"
AbilityNames[35]="Poison Spit"
AbilityNames[36]="Stabilize"
AbilityNames[37]="Revive"
AbilityNames[38]="Hunker Down"
AbilityNames[40]="Ghost"
AbilityNames[41]="Heal Wound"
AbilityNames[42]="Repair S.H.I.V."
AbilityNames[43]="Combat Stim"
AbilityNames[45]="Reload"
AbilityNames[47]="Mind Merge"
AbilityNames[48]="Psi Lance"
AbilityNames[51]="Greater Mind Merge"
AbilityNames[52]="Mind Control"
AbilityNames[53]="Psi Panic"
AbilityNames[56]="Reanimate Ally"
AbilityNames[57]="Reanimate Enemy"
AbilityNames[58]="Psi Drain"
AbilityNames[61]="Headshot"
AbilityNames[62]="Disabling Shot"
AbilityNames[66]="Shredder Rocket"
AbilityNames[67]="Suppression"
AbilityNames[68]="Run & Gun"
AbilityNames[70]="Bull Rush"
AbilityNames[71]="Battle Scanner"
AbilityNames[72]="Mindfray"
AbilityNames[73]="Rift"
AbilityNames[74]="Telekinetic Field"
AbilityNames[75]="Mind Control"
AbilityNames[76]="Psi Inspiration"
AbilityNames[77]="Close"
AbilityNames[78]="Death Blossom"
AbilityNames[79]="Cannon Fire"
AbilityNames[80]="Cluster Bomb"
AbilityNames[81]="Destroy Terrain"
AbilityNames[83]="Repair"
AbilityNames[86]="Head Down"
AbilityNames[88]="Blood Call"

 

As you can see this is not the full list "BUT" it shows all the abilities you have to manually activate.

 

Now how to chnage a certain classes ability? I believe it's pretty simple let's take [68]="Run & Gun" for example it show up in only one build. And that would be the Assault Build.

 

BuildAbility(68, 1, 0, 6, 0, 30, 8, 44, 3, 9, 6);

 

This builds first ability is of course:

 

AbilityNames[68]="Run & Gun"

 

And cage it to something else like

 

AbilityNames[17]="Suppression"

 

This is just a theory because most abilities are passive and not on the "AbilityNames" list, but their numbers still show up like 87 in the BuildAbility list. I should check if it works in just a moment, but this is definitely related to the Ability/Skill Tree's of all the characters.

Link to comment
Share on other sites

Small update -> I could have been wrong. I looked in for "Perks" like their named in Fallout within XComGame.upk and I made another discovery that might help with dealing with the issue of Perk/Skill/Ability (w/e you call it) Tree editing.

 

Under XComPerkManager you'll find:

 

	BuildPerk(0, 0, "Unknown");
BuildPerk(2, 1, "PrecisionShot");
BuildPerk(3, 0, "SquadSight");
BuildPerk(95, 0, "Gunslinger");
BuildPerk(5, 0, "LowProfile");
BuildPerk(16, 0, "SnapShot");
BuildPerk(9, 1, "DisablingShot");
BuildPerk(10, 0, "Opportunist");
BuildPerk(11, 0, "Executioner");
BuildPerk(12, 0, "ButtonUp");
BuildPerk(15, 0, "DamnGoodGround");
BuildPerk(13, 0, "DoubleTap");
BuildPerk(14, 0, "InTheZone");
BuildPerk(8, 1, "BattleScanner");
BuildPerk(18, 0, "FireRocket");
BuildPerk(19, 0, "TracerBeams");
BuildPerk(20, 0, "HEATRockets");
BuildPerk(91, 0, "HEATAmmo");
BuildPerk(21, 1, "Suppression");
BuildPerk(22, 1, "ShredderRocket");
BuildPerk(23, 0, "RapidReaction");
BuildPerk(24, 0, "Grenadier");
BuildPerk(25, 0, "DangerZone");
BuildPerk(26, 0, "BulletSwarm");
BuildPerk(27, 0, "ExtraConditioning");
BuildPerk(30, 0, "ReadyForAnything");
BuildPerk(94, 0, "Mayhem");
BuildPerk(29, 0, "FirstBlood");
BuildPerk(93, 0, "Rocketeer");
BuildPerk(44, 1, "SmokeBomb");
BuildPerk(47, 0, "CoveringFire");
BuildPerk(48, 0, "FieldMedic");
BuildPerk(49, 1, "RifleSuppression");
BuildPerk(56, 1, "Revive");
BuildPerk(51, 0, "CombatDrugs");
BuildPerk(52, 0, "DenseSmoke");
BuildPerk(53, 0, "DeepPockets");
BuildPerk(54, 0, "Sentinel");
BuildPerk(55, 0, "Savior");
BuildPerk(6, 1, "RunAndGun");
BuildPerk(31, 0, "Sprinter");
BuildPerk(32, 0, "Aggression");
BuildPerk(33, 0, "TacticalSense");
BuildPerk(34, 0, "CloseAndPersonal");
BuildPerk(35, 0, "LightningReflexes");
BuildPerk(36, 1, "RapidFire");
BuildPerk(37, 1, "Flush");
BuildPerk(38, 0, "FlameOn");
BuildPerk(39, 0, "BringEmOn");
BuildPerk(40, 0, "CloseCombatSpecialist");
BuildPerk(17, 0, "WillToSurvive");
BuildPerk(41, 0, "KillerInstinct");
BuildPerk(42, 0, "Vengeance");
BuildPerk(43, 0, "Resilience");
BuildPerk(92, 0, "SmokeAndMirrors");
BuildPerk(57, 0, "HeightAdvantage");
BuildPerk(59, 0, "ImmuneToDisabled");
BuildPerk(58, 0, "DisablingShot");
BuildPerk(60, 0, "SuppressedActive");
BuildPerk(61, 0, "CriticallyWounded");
BuildPerk(62, 0, "Flying");
BuildPerk(63, 0, "Stealth");
BuildPerk(65, 0, "ChitinPlating");
BuildPerk(66, 0, "CombatStimsActive");
BuildPerk(68, 0, "Panicked");
BuildPerk(69, 1, "PsiMindfray");
BuildPerk(71, 1, "PsiInspiration");
BuildPerk(72, 1, "PsiMindControl");
BuildPerk(70, 1, "PsiPanic");
BuildPerk(73, 1, "PsiTelekineticField");
BuildPerk(74, 1, "PsiRift");
BuildPerk(81, 1, "Launch");
BuildPerk(80, 1, "Evasion");
BuildPerk(78, 1, "MindMerge2");
BuildPerk(79, 1, "MindMerge2");
BuildPerk(82, 1, "Bombard");
BuildPerk(83, 1, "Leap");
BuildPerk(84, 1, "PoisonSpit");
BuildPerk(85, 1, "PoisonSpit");
BuildPerk(86, 1, "Bloodcall");
BuildPerk(87, 1, "Intimidate");
BuildPerk(89, 1, "Bloodlust");
BuildPerk(90, 1, "Bullrush");
BuildPerk(75, 1, "MindMerge");
BuildPerk(76, 1, "MindMerge");
BuildPerk(96, 1, "HeatWave");
BuildPerk(97, 1, "ClusterBomb");
BuildPerk(98, 1, "PsiLance");
BuildPerk(99, 1, "DeathBlossom");
BuildPerk(100, 1, "Overload");
BuildPerk(77, 0, "Harden");
BuildPerk(101, 1, "PsiMindControl");
BuildPerk(102, 1, "PsiDrain");
BuildPerk(103, 1, "Repair");
BuildPerk(104, 1, "CannonFire");
BuildPerk(105, 0, "Implant");
BuildPerk(106, 0, "Implant");
BuildPerk(7, 0, "AutopsyRequired");
BuildPerk(88, 0, "FallenComrades");
BuildPerk(107, 0, "BattleFatigue");
BuildPerk(108, 0, "MindShield");
BuildPerk(46, 0, "Stun");
BuildPerk(109, 0, "DONT_USE_ItemRangeBonus");
BuildPerk(110, 0, "DONT_USE_ItemRangePenalty");

 

I'm guessing this could also be responsible for editing all the Perks.

Link to comment
Share on other sites

genius... i didn't even know that file existed... i found this code:

 

unction GivePerk(XGUnit kUnit, int iPerk)
{
// End:0x19b Loop:False
if(!kUnit.GetCharacter().HasUpgrade(iPerk))
{
	kUnit.GetCharacter().GivePerk(iPerk);
	// End:0x19b Loop:False
	if(XGBattle_SP(XComTacticalGRI(class'Engine'.static.GetCurrentWorldInfo().GRI).m_kBattle) != none)
	{
		// ObjectIndex:26133 BlockSize:0
		switch(iPerk)
		{
			// End:0x11e
			case 48:
				kUnit.SetMediKitCharges(3);
				// End:0x19b
				break;
			// End:0x147
			case 93:
				kUnit.SetRockets(2);
				// End:0x19b
				break;
			// End:0x16f
			case 22:
				kUnit.SetShredderRockets(1);
				// End:0x19b
				break;
			// End:0x198
			case 44:
				kUnit.SetSmokeGrenadeCharges(3);
				// End:0x19b
				break;
			// End:0xffff
			default:
			}
		}
}

 

or maybe i'm wrong.. gonna test it.. cause i don't think the perk gives 3 smoke grenades...

 

Maybe that's multiplayer? dunno

 

 

Dunno, someone else can try but i changes the medkit charges to 6.. maybe it doesn't work on already generated characters? Or that might be multiplayer... if only i could find similar code in other files..

Edited by tbkiah
Link to comment
Share on other sites

Where in the code is the function giveperk() called?

 

Is there a way to have UE Explorer export all the decompiled scripts in a upk?

 

Because finding this stuff is ridiculous without being able to use a tool like grep.

Edited by Daemonjax
Link to comment
Share on other sites

OK guys I think I found what we where looking for if you compare this:

 

function int GetPerkInTreeHeavyWeapons(int branch, int Option)
{
// End:0x15 Loop:False
if(branch == 1)
{
	return 18;
}
// End:0x14a
else
{
	// End:0x4f Loop:False
	if(branch == 2)
	{
		// End:0x3a Loop:False
		if(Option == 0)
		{
			return 19;
		}
		// End:0x4c
		else
		{
			// End:0x4c Loop:False
			if(Option == 1)
			{
				return 26;
			}
		}
	}
	// End:0x14a
	else
	{
		// End:0x89 Loop:False
		if(branch == 3)
		{
			// End:0x74 Loop:False
			if(Option == 0)
			{
				return 21;
			}
			// End:0x86
			else
			{
				// End:0x86 Loop:False
				if(Option == 1)
				{
					return 22;
				}
			}
		}
		// End:0x14a
		else
		{
			// End:0xc3 Loop:False
			if(branch == 4)
			{
				// End:0xae Loop:False
				if(Option == 0)
				{
					return 23;
				}
				// End:0xc0
				else
				{
					// End:0xc0 Loop:False
					if(Option == 1)
					{
						return 91;
					}
				}
			}
			// End:0x14a
			else
			{
				// End:0xfd Loop:False
				if(branch == 5)
				{
					// End:0xe8 Loop:False
					if(Option == 0)
					{
						return 25;
					}
					// End:0xfa
					else
					{
						// End:0xfa Loop:False
						if(Option == 1)
						{
							return 24;
						}
					}
				}
				// End:0x14a
				else
				{
					// End:0x113 Loop:False
					if(branch == 6)
					{
						return 17;
					}
					// End:0x14a
					else
					{
						// End:0x14a Loop:False
						if(branch == 7)
						{
							// End:0x138 Loop:False
							if(Option == 0)
							{
								return 94;
							}
							// End:0x14a
							else
							{
								// End:0x14a Loop:False
								if(Option == 1)
								{
									return 93;
								}
							}
						}
					}
				}
			}
		}
	}
}
return 0;
}

 

And now compare it with my last list. For example:

 

0

 

BuildPerk(18, 0, "FireRocket"); => return 18

 

1

 

BuildPerk(19, 0, "TracerBeams"); => return 19 (Must be another name for Holo Targeting)

 

BuildPerk(26, 0, "BulletSwarm"); => return 26

 

2

 

BuildPerk(21, 1, "Suppression"); => return 21

 

BuildPerk(22, 1, "ShredderRocket"); => return 22

 

3

 

BuildPerk(23, 0, "RapidReaction"); => return 23

BuildPerk(91, 0, "HEATAmmo"); => return 91

 

And so on and so on. The build ends with:

 

BuildPerk(93, 0, "Rocketeer"); => return 93

 

Which is in the final branch. So all the Heavy Abilities can most likely be modded just by switching the numbers. Simple enough ey? But also you'll have to start a new game which is most likely in this case. So I'm gonna change the basic heavy ability (as soon as I get a hang of these damn hex editors....) and see if it works.

Link to comment
Share on other sites

It even works for already created soldiers.. so i loaded up an old game and my heavies got run and gun haha.

 

I might just have to mkae my own hybrid classes now.. I'm going to try to add abilities from say the psi tree and see what happens... *I think aliens have abilities, not perks... so probably won't work.. hmm

 

EDIT: They do have "perks" but i tried to get my heavy mind merge, but he can't use it...

Edited by tbkiah
Link to comment
Share on other sites

Filly we reached a point when we can just edit the damn things. Might as well experiment more with them. Like maybe check if we can add more choices like 3 per rank. Maybe even expand with more ranks. Who knows, who knows. Right now I just want to put everything in to proper order. I hated how everyone was basically limited to the move / shoot mechanic. Now I can finally add a proper choice between bullet swarm and rapid fire on rank 5 to each and every single class out there. All that hard work finally paying off.

 

EDIT: I wouldn't mess with PSI abilities too much -> they are definitely restricted somehow to your PSI operatives, but adding new PSI leveles and abilities to the PSI Tree like "PSI Lance" might just work. How ever it would require editing other files.

Edited by Nolanoth
Link to comment
Share on other sites

We are not at the point to actually add things to the bytecode, Or at least i am not.. It will throw an Error, where you added too much to the bytecode.

 

So unless you know how to change the bytecode to allow it to be larger, we can't add anything, simply create hybrid classes..

 

Which if you know how to add to the bytecode without errors, please less me know!

 

ALL i did was swap 1 ability for another.

 

 

Edit: You are right, i added rift to the heavy tree and then tried to use my non-psi guy and he was able to use the ability, but it did not create an effect.

Edited by tbkiah
Link to comment
Share on other sites

  • Recently Browsing   0 members

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