Jump to content

Arc Thrower Stun Chance?


daeger

Recommended Posts

Hmm okay, that's all very interesting, I'm looking through the file now. The only problem is once I've made the chance I think will work, I'm not exactly sure HOW to make the change, there doesn't seem to be any way to import the changes back into the upk file with UE Explorer.

 

I edited a few parts of my previous post to make my post more clear. You should re-read it.

 

 

As for modifying UPK files. Go here and download the modding tools:

 

http://forums.nexusmods.com/index.php?/topic/820867-here-are-upk-modding-tools/

 

Check the ReadMe. It contains a tutorial. Try to complete the tutorial. Once you've done it, then you'll understand the basics and how it all works.

Edited by BlackAlpha
Link to comment
Share on other sites

Hmm okay, that's all very interesting, I'm looking through the file now. The only problem is once I've made the chance I think will work, I'm not exactly sure HOW to make the change, there doesn't seem to be any way to import the changes back into the upk file with UE Explorer.

 

I edited a few parts of my previous post to make my post more clear. You should re-read it.

 

 

As for modifying UPK files. Go here and download the modding tools:

 

http://forums.nexusmods.com/index.php?/topic/820867-here-are-upk-modding-tools/

 

Check the ReadMe. It contains a tutorial. Try to complete the tutorial. Once you've done it, then you'll understand the basics and how it all works.

I have been reading it. It's just a little hard to follow. I gather you have to view the data as hex in ueexplorer so you can apply it to the files you unpacked... but my understanding of the finer details is not so great. It's really weird and round-about. I'll keep trying.

Edited by daeger
Link to comment
Share on other sites

I slept on it and I re-read the tutorial today. I do believe I'm set up exactly as the tutorial describes. However, it would seem what I want to do is quite a bit more advanced than what the tutorial teaches me how to do. There are no integers for me to look for to even properly get my bearings except for 100, which is a 3 digit number and not a 2 digit, so I'm not sure how that would look in the hex.

 

I tried taking a look at the Bytecode table but it doesn't really go into the difference between HEX values and constants. I don't get why all the constants start with "0x".

 

This is giving me such a headache, no wonder it takes forever to get anything done when changing the UPK files.

 

Let's say I wanted to find return "fRoll < fStunChance;" in the hex code. What exactly should I be looking for?

 

I'm thinking it should read "return (fRoll + 10) < fStunChance;", which would effectively give the arc thrower 10% more stun chance if I'm understanding correctly.

 

That would give me the desired result at least, but it wouldn't really change the game's projected chance it gives you, so even when it says you have a 90% chance you actually have 100%. I'm not sure how you'd work around that. I guess you'd edit "fStunChance = float(CalcStunChance(kVictim, kFireAction.m_kUnit, kFireAction.m_kWeapon)) / 100.00;". Maybe if I changed the 100 to be 90 instead? I don't know.

 

Please share your insight when you can.

Edited by daeger
Link to comment
Share on other sites

I slept on it and I re-read the tutorial today. I do believe I'm set up exactly as the tutorial describes. However, it would seem what I want to do is quite a bit more advanced than what the tutorial teaches me how to do. There are no integers for me to look for to even properly get my bearings except for 100, which is a 3 digit number and not a 2 digit, so I'm not sure how that would look in the hex.

 

The tutorial simply teaches you how to make an easy modification to the code and it teaches you all the steps necessary to apply the modification and make it run. That's why you need to follow the tutorial and understand all the necessary steps.

 

 

Let's say I wanted to find return "fRoll < fStunChance;" in the hex code. What exactly should I be looking for?

 

The easiest way is to open the UPK file in UE Explorer. Go to the code. Right click on the file (in the list on the left), and choose "View Buffer". This will open up the HEX viewer inside UE Explorer. When you click on a HEX value of a variable, it should show on the left in the Object field the variable name. So near the end of the code, you should be able to find fRoll and fStunChance.

 

Also, on the left in the HEX view you can see information about the data you've selected. Using that information you can decide what exact part of the code you've selected.

 

 

I'm thinking it should read "return (fRoll + 10) < fStunChance;", which would effectively give the arc thrower 10% more stun chance if I'm understanding correctly.

 

"fStunChance" is "most likely" the actual stun chance. "fRoll" is most likely the random number the game rolls to perform the check that decides if it fails or not. So you just decreased the stun chance. Read the calculation: Add +10 to fRoll. When fRoll is smaller than fStunChance, return true. Add imaginary numbers to it. Imagine fRoll is 45 and fStunChance is 50 and then perform the calculation.

 

 

That would give me the desired result at least, but it wouldn't really change the game's projected chance it gives you, so even when it says you have a 90% chance you actually have 100%. I'm not sure how you'd work around that. I guess you'd edit "fStunChance = float(CalcStunChance(kVictim, kFireAction.m_kUnit, kFireAction.m_kWeapon)) / 100.00;". Maybe if I changed the 100 to be 90 instead? I don't know.

 

Yes, that's probably the better way to change it because then you most likely also change the percentage shown to the player ingame. That way the player has a better idea ingame of what the actual chance to stun is.

 

As for changing that number. Try it and see what happens. Try to make the final result higher to see if the chance to stun improves ingame.

 

If it does, then I suggest to change the way the final number is calculated. Instead of dividing, I'd multiply. Then you can multiply by numbers like 0.01 (100%), 0.09 (90%), 0.011 (110%), etc. That gives you better control over the final number and allows you to set exactly by how much you want it to improve.

Edited by BlackAlpha
Link to comment
Share on other sites

Talking about stunning aliens - do you know, where are those HP thresholds (double h) burried?

 

I found only help message in XGAbilityTree:

HelpMessages[9]="Can incapacitate enemy targets. Higher chance if the target's health is at <XGAbility:StunHP/> HP or below.".

Only StunHP I found is in XComGame.exe, and the game shows the right number in place of <XGAbility:StunHP/> according to Foundry upgrade.

 

Also did some tests in the game.

 

Muton Elite at 7 of 14 health, flanked, standing next to him

- normal gun hit chance 100%, arc thrower 49%

Muton Elite at 2 of 14 health, flanked, standing next to him

- normal gun hit chance 100%, arc thrower 95%

 

Checking code in XGAbility_Targeted:

simulated function GetShotSummary(out TShotResult kResult, out TShotInfo kInfo)
{
local int iEffects, iMod, coverPerks, coverBonus, iPoison, iEvasionBonus, iBackpackItem;

...
if(ShouldShowPercentage())
{
	kResult.iPossibleDamage = -GetPossibleDamage();
	// End:0x4e4 Loop:False
	if(HasProperty(36))
	{
		// End:0x48f Loop:False
		if(iType == 10)
		{
			kInfo.arrHitBonusStrings.AddItem(m_strDroneHack);
		}
		// End:0x4b8
		else
		{
			kInfo.arrHitBonusStrings.AddItem(m_strChanceToStun);
		}
		kInfo.arrHitBonusValues.AddItem(m_iHitChance);
	}
GetShotSummaryModFromPerks(kResult, kInfo);

AbilityProperty(36) is Stun and (iType == 10) is Ability Drone Hack. Seems the code is counting with iHitChance and in shot overview Hit chance was equal to Stun Chance. So maybe CalcStunChance() returns updated iHitChance.

 

But what happens, if fRoll < fStunChance, where StunChance would be 100%?

Link to comment
Share on other sites

I'm guessing fRoll is capped at 100%. Some players on the official forum reported missing with a 100% chance. People there speculated that it was because ingame, the chance to hit is rounded up from, let's say 99.85%. But personally, I think it's because the fRolls go up to 100, so even with a 100% hit chance, there's a 1% chance you will fail.

 

Don't know about the HP. I assumed it would be inside that function ChanceToStun.

 

 

@daeger

 

Any progress? It seems you are nearly there, just need to modify that number, right?

Link to comment
Share on other sites

I'm guessing fRoll is capped at 100%. Some players on the official forum reported missing with a 100% chance. People there speculated that it was because ingame, the chance to hit is rounded up from, let's say 99.85%. But personally, I think it's because the fRolls go up to 100, so even with a 100% hit chance, there's a 1% chance you will fail.

 

Don't know about the HP. I assumed it would be inside that function ChanceToStun.

 

 

@daeger

 

Any progress? It seems you are nearly there, just need to modify that number, right?

Afraid not, I'm going to be swamped with work all week.

Link to comment
Share on other sites

  • 2 weeks later...
  • Recently Browsing   0 members

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