Jump to content

Stun Chance mod


Amineri

Recommended Posts

I've worked up a fairly small modlet that adjusts Arc Thrower stun chances based on the current difficulty setting.

 

The adjustment works thusly:

  • Easy Difficulty (0) -- unchanged (e.g. 90% stun chance against 1 HP target)
  • Normal Difficulty (1) -- 5/6 of regular chance (e.g. 75% stun chance against 1 HP target)
  • Classic Difficulty (2) -- 4/6 of regular chance (e.g. 60% stun chance against 1 HP target)
  • Impossible Difficulty (3) -- 3/6 of regulr chance (e.g. 45% stun chance against 1 HP target)

The updated chance to stun is displayed in the Tactical HUD info panel (although currently the targeting reticle still shows the unadjusted number).

 

I've verified that both stunning and failing to stun (on impossible difficulty against a 3 HP target, with a 35% chance to stun) are possible. Dynamically changing difficulties in the middle of a mission will correctly change the stun chances.

 

The chance-to-stun modifies the same section of code as the Rocket Scatter mod, so there are two "before" versions ... vanilla and "with Rocket Scatter Mod" installed.

 

If this is installed without the Rocket Scatter mod, the usual 90% scatter display will instead display as 90.0000 scatter. This mod must be installed after the Rocket Scatter mod.

 

hex changes:

 

 

Cumulative changes to make stun chance adjust with difficulty, and to display the updated stun chance

XGTacticalGameCore.TryStunned

Adjust Stunning difficulty by 100% to 50% based on difficulty -- 100% for Easy, 83.3% for Normal, 66.7% for Classic, 50% for Impossible

Vanilla original hex:
0F 00 1D 77 00 00 AC 38 3F 1B DE 0E 00 00 00 00 00 00 00 21 77 00 00 19 00 1E 77 00 00 09 00 41 BC 00 00 00 01 41 BC 00 00 19 00 1E 77 00 00 09 00 E2 82 00 00 00 01 E2 82 00 00 16 1E 00 00 C8 42 16 07 14 01 82 77 2E DA 72 00 00 19 1C 69 FC FF FF 16 09 00 B9 F9 FF FF 00 01 B9 F9 FF FF 2A 16 18 3F 00 19 2E DA 72 00 00 19 1C 69 FC FF FF 16 09 00 B9 F9 FF FF 00 01 B9 F9 FF FF 0A 00 15 6F 00 00 00 2D 01 15 6F 00 00 16 0F 00 1D 77 00 00 1E 00 00 C8 42 
	
Long War 1.08 hex:
0F 00 1D 77 00 00 AC 38 3F 1B DE 0E 00 00 00 00 00 00 00 21 77 00 00 19 00 1E 77 00 00 09 00 41 BC 00 00 00 01 41 BC 00 00 19 00 1E 77 00 00 09 00 E2 82 00 00 00 01 E2 82 00 00 16 1E 00 00 3E 43 16 07 14 01 82 77 2E DA 72 00 00 19 1C 69 FC FF FF 16 09 00 B9 F9 FF FF 00 01 B9 F9 FF FF 2A 16 18 3F 00 19 2E DA 72 00 00 19 1C 69 FC FF FF 16 09 00 B9 F9 FF FF 00 01 B9 F9 FF FF 0A 00 15 6F 00 00 00 2D 01 15 6F 00 00 16 0F 00 1D 77 00 00 1E 00 00 C8 42 

new hex:
0F 00 1D 77 00 00 AC 38 3F 90 1B DE 0E 00 00 00 00 00 00 00 21 77 00 00 19 00 1E 77 00 00 09 00 41 BC 00 00 00 01 41 BC 00 00 19 00 1E 77 00 00 09 00 E2 82 00 00 00 01 E2 82 00 00 16 93 2C 06 01 66 76 00 00 16 16 1E 00 00 16 44 16 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 01 66 76 00 00 01 66 76 00 00 01 66 76 00 00 01 66 76 00 00 01 66 76 00 00 01 66 76 00 00 01 66 76 00 00 01 66 76 00 00 01 66 76 00 00 01 66 76 00 00 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 


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

UITacticalHUD_InfoPanel.Update

UI Change to display updated stun chance

vanilla hex: (0xC94)
07 EC 03 97 00 E4 25 00 00 25 16 07 58 03 97 36 35 D2 25 00 00 D8 25 00 00 00 00 00 DD 25 00 00 25 16 06 58 03 07 E9 03 82 82 77 00 DF 25 00 00 2A 16 18 22 00 77 19 00 DF 25 00 00 09 00 DD 82 00 00 00 01 DD 82 00 00 2A 16 16 18 35 00 19 19 00 DF 25 00 00 09 00 DD 82 00 00 00 01 DD 82 00 00 0A 00 E7 7C 00 00 00 1B 13 64 00 00 00 00 00 00 16 16 1C 1B 26 00 00 01 9B 25 00 00 70 38 53 00 E4 25 00 00 1F 25 00 16 16 06 7D 04 07 7D 04 82 82 77 00 DF 25 00 00 2A 16 18 22 00 77 19 00 DF 25 00 00 09 00 DD 82 00 00 00 01 DD 82 00 00 2A 16 16 18 35 00 19 19 00 DF 25 00 00 09 00 DD 82 00 00 00 01 DD 82 00 00 0A 00 E7 7C 00 00 00 1B 13 64 00 00 00 00 00 00 16 16 1C 1B 26 00 00 01 9B 25 00 00 70 38 53 00 E3 25 00 00 1F 25 00 16 16 07 6E 05 82 82 82 97 00 E5 25 00 00 1D FF FF FF FF 16 18 0D 00 77 00 DF 25 00 00 2A 16 16 18 35 00 19 19 00 DF 25 00 00 09 00 DD 82 00 00 00 01 DD 82 00 00 0A 00 E3 7C 00 00 00 1B 15 64 00 00 00 00 00 00 16 16 18 6A 00 81 19 19 00 DF 25 00 00 09 00 41 BC 00 00 00 01 41 BC 00 00 3D 00 2C 34 00 00 00 1B B3 3C 00 00 00 00 00 00 19 19 00 DF 25 00 00 09 00 DD 82 00 00 00 01 DD 82 00 00 09 00 E2 7B 00 00 00 01 E2 7B 00 00 16 16 16 1C 21 26 00 00 01 97 25 00 00 70 38 53 00 E5 25 00 00 1F 25 00 16 16 06 7C 05 1C 21 26 00 00 1F 00 1F 00 16 07 A1 06 82 82 82 82 77 00 DF 25 00 00 2A 16 18 20 00 19 00 DF 25 00 00 0A 00 65 83 00 00 00 1B 67 3D 00 00 00 00 00 00 16 16 18 38 00 9B 19 19 00 DF 25 00 00 09 00 DD 82 00 00 00 01 DD 82 00 00 09 00 E2 7B 00 00 00 01 E2 7B 00 00 2C 05 16 16 18 38 00 9B 19 19 00 DF 25 00 00 09 00 DD 82 00 00 00 01 DD 82 00 00 09 00 E2 7B 00 00 00 01 E2 7B 00 00 2C 46 16 16 18 38 00 9B 19 19 00 DF 25 00 00 09 00 DD 82 00 00 00 01 DD 82 00 00 09 00 E2 7B 00 00 00 01 E2 7B 00 00 2C 06 16 16 1C F7 25 00 00 A8 70 01 98 25 00 00 1F 3A 00 16 19 00 E8 25 00 00 0A 00 20 7C 00 00 00 1B 6E 33 00 00 00 00 00 00 16 16 1F 00 16 06 CC 06 1C F7 25 00 00 19 00 E8 25 00 00 0A 00 20 7C 00 00 00 1B 6E 33 00 00 00 00 00 00 16 1F 00 16 


Rocket Scatter modlet hex: (virtual 0xEB)
07 16 05 82 77 00 DF 25 00 00 2A 16 18 22 00 77 19 00 DF 25 00 00 09 00 DD 82 00 00 00 01 DD 82 00 00 2A 16 16 07 B5 03 19 19 00 DF 25 00 00 09 00 DD 82 00 00 00 01 DD 82 00 00 0A 00 E7 7C 00 00 00 1B 13 64 00 00 00 00 00 00 16 1C 1B 26 00 00 01 9B 25 00 00 70 38 53 FA 00 E4 25 00 00 25 16 1F 25 00 16 16 07 05 05 82 82 82 97 00 E5 25 00 00 1D FF FF FF FF 16 18 0D 00 77 00 DF 25 00 00 2A 16 16 18 35 00 19 19 00 DF 25 00 00 09 00 DD 82 00 00 00 01 DD 82 00 00 0A 00 E3 7C 00 00 00 1B 15 64 00 00 00 00 00 00 16 16 18 6A 00 81 19 19 00 DF 25 00 00 09 00 41 BC 00 00 00 01 41 BC 00 00 3D 00 2C 34 00 00 00 1B B3 3C 00 00 00 00 00 00 19 19 00 DF 25 00 00 09 00 DD 82 00 00 00 01 DD 82 00 00 09 00 E2 7B 00 00 00 01 E2 7B 00 00 16 16 16 07 DF 04 19 00 E8 25 00 00 0C 00 44 7C 00 00 00 1B 9A 36 00 00 00 00 00 00 24 2D 16 1C 21 26 00 00 01 9D 25 00 00 70 70 38 53 91 00 E5 25 00 00 2C 0A 16 1F 2E 00 16 38 53 FD 00 E5 25 00 00 2C 0A 16 16 16 06 02 05 1C 21 26 00 00 01 97 25 00 00 70 38 53 00 E5 25 00 00 1F 25 00 16 16 06 13 05 1C 21 26 00 00 1F 00 1F 00 16 06 24 05 1C 21 26 00 00 1F 00 1F 00 16 0B 0B 0B 0B 0B 0B 0B 0B 0B 00 E5 25 00 00 00 E5 25 00 00 00 E5 25 00 00 00 E5 25 00 00 00 E5 25 00 00 00 E5 25 00 00 00 E5 25 00 00 00 E5 25 00 00 0B 0B 0B 0B 0B 0B 0B 07 A1 06 82 82 82 82 77 00 DF 25 00 00 2A 16 18 20 00 19 00 DF 25 00 00 0A 00 65 83 00 00 00 1B 67 3D 00 00 00 00 00 00 16 16 18 38 00 9B 19 19 00 DF 25 00 00 09 00 DD 82 00 00 00 01 DD 82 00 00 09 00 E2 7B 00 00 00 01 E2 7B 00 00 2C 05 16 16 18 38 00 9B 19 19 00 DF 25 00 00 09 00 DD 82 00 00 00 01 DD 82 00 00 09 00 E2 7B 00 00 00 01 E2 7B 00 00 2C 46 16 16 18 38 00 9B 19 19 00 DF 25 00 00 09 00 DD 82 00 00 00 01 DD 82 00 00 09 00 E2 7B 00 00 00 01 E2 7B 00 00 2C 06 16 16 1C F7 25 00 00 A8 70 01 98 25 00 00 1F 3A 00 16 19 00 E8 25 00 00 0A 00 20 7C 00 00 00 1B 6E 33 00 00 00 00 00 00 16 16 1F 00 16 06 CC 06 1C F7 25 00 00 19 00 E8 25 00 00 0A 00 20 7C 00 00 00 1B 6E 33 00 00 00 00 00 00 16 1F 00 16 


new hex (rocket scatter and modified stun chance: (0xC80)
0F 00 E6 25 00 00 19 19 00 DF 25 00 00 09 00 DD 82 00 00 00 01 DD 82 00 00 09 00 E2 7B 00 00 00 01 E2 7B 00 00 07 BD 05 82 77 00 DF 25 00 00 2A 16 18 22 00 77 19 00 DF 25 00 00 09 00 DD 82 00 00 00 01 DD 82 00 00 2A 16 16 07 F2 03 19 19 00 DF 25 00 00 09 00 DD 82 00 00 00 01 DD 82 00 00 0A 00 E7 7C 00 00 00 1B 13 64 00 00 00 00 00 00 16 1C 1B 26 00 00 01 9B 25 00 00 70 38 53 FA 00 E4 25 00 00 25 16 1F 25 00 16 16 07 AC 05 82 82 99 00 E5 25 00 00 25 16 18 35 00 19 19 00 DF 25 00 00 09 00 DD 82 00 00 00 01 DD 82 00 00 0A 00 E3 7C 00 00 00 1B 15 64 00 00 00 00 00 00 16 16 18 6A 00 81 19 19 00 DF 25 00 00 09 00 41 BC 00 00 00 01 41 BC 00 00 3D 00 2C 34 00 00 00 1B B3 3C 00 00 00 00 00 00 00 E6 25 00 00 16 16 16 07 CB 04 19 00 E8 25 00 00 0C 00 44 7C 00 00 00 1B 9A 36 00 00 00 00 00 00 24 2D 16 1C 21 26 00 00 01 9D 25 00 00 38 55 AC 38 3F 00 E5 25 00 00 38 3F 2C 0A 16 16 06 A9 05 07 86 05 19 00 E8 25 00 00 0C 00 44 7C 00 00 00 1B 9A 36 00 00 00 00 00 00 24 24 16 1C 21 26 00 00 01 97 25 00 00 70 38 53 91 90 00 E5 25 00 00 93 2C 06 19 19 2E FE 2C 00 00 19 12 20 4F FE FF FF 0A 00 D8 F9 FF FF 00 1C F6 FB FF FF 16 09 00 98 F9 FF FF 00 01 98 F9 FF FF 09 00 F0 2C 00 00 00 01 F0 2C 00 00 09 00 66 76 00 00 00 01 66 76 00 00 16 16 2C 06 16 1F 25 00 16 16 06 A9 05 1C 21 26 00 00 01 97 25 00 00 70 38 53 00 E5 25 00 00 1F 25 00 16 16 06 BA 05 1C 21 26 00 00 1F 00 1F 00 16 06 CB 05 1C 21 26 00 00 1F 00 1F 00 16 07 72 06 82 82 82 82 77 00 DF 25 00 00 2A 16 18 20 00 19 00 DF 25 00 00 0A 00 65 83 00 00 00 1B 67 3D 00 00 00 00 00 00 16 16 18 0E 00 9B 00 E6 25 00 00 2C 05 16 16 18 0E 00 9B 00 E6 25 00 00 2C 46 16 16 18 0E 00 9B 00 E6 25 00 00 2C 06 16 16 1C F7 25 00 00 A8 70 01 98 25 00 00 1F 3A 00 16 19 00 E8 25 00 00 0A 00 20 7C 00 00 00 1B 6E 33 00 00 00 00 00 00 16 16 1F 00 16 06 9D 06 1C F7 25 00 00 19 00 E8 25 00 00 0A 00 20 7C 00 00 00 1B 6E 33 00 00 00 00 00 00 16 1F 00 16 0B 00 E5 25 00 00 00 E5 25 00 00 00 E5 25 00 00 00 E5 25 00 00 00 E5 25 00 00 0B  

 

 

Link to comment
Share on other sites

While playing around I also found a series of changes that alter the Stun ability in a few different ways. It's possible to put the camera into an overhead view instead of the over-the-shoulder (more like free-aiming).

 

It's also possible to unlock the custom range of the ability. It can be altered to use the weapon range as defined for the ArcThrower in the DGC.ini. These don't alter the display of the Range Indicator Rings around enemy targets that can be stunned. Also note that the Arc Thrower doesn't have any modifications for range or distance -- only enemy HP. This might make balancing a long range Arc Thrower a bit tricky.

 

Anyhow, here are the various hex edits I played with:

In XGAbilityTree.Buildabilities, change the line:

change:
BuildAbility(9, 2, 5, -1, -20, 1,,, 1, 25, 36, 11)
1B 7E 0D 00 00 00 00 00 00 24 09 24 02 2C 05 1D FF FF FF FF 1D EC FF FF FF 24 01 4A 4A 24 01 24 19 24 24 24 0B 4A 4A 4A 4A 4A 4A 4A 4A 4A 16 
   2=eTarget_SingleEnemy, 5 = eRange_Unlimited, -1 duration, -20 reaction, 1 = eEffect_Damage, 1 = eProp_FireWeapon, 25 = eProp_TargetNonRobotic, 36 = eProp_Stun, 11 = eProp_CustomRange

to:
BuildAbility(9, 2, 5, -1, -20, 1,,, 1, 25, 36, 11)
1B 7E 0D 00 00 00 00 00 00 24 09 24 02 2C 05 2C 00 1D EC FF FF FF 24 01 4A 4A 24 01 24 19 24 24 24 0B 4A 4A 4A 4A 24 03 4A 4A 4A 4A 16 0B 0B 
   2=eTarget_SingleEnemy, 5 = eRange_Unlimited, 0 duration, -20 reaction, 1 = eEffect_Damage, 1 = eProp_FireWeapon, 25 = eProp_TargetNonRobotic, 36 = eProp_Stun, 11 = eProp_CustomRange, 3 = eDisplayProp_TopDownCamera

Displays Top-Down camera instead of over-the-shoulder
			
to:
BuildAbility(9, 2, 5, -1, -20, 1,,, 1, 25, 36, 11)
1B 7E 0D 00 00 00 00 00 00 24 09 24 02 2C 05 2C 00 1D EC FF FF FF 24 01 4A 4A 24 01 24 19 24 24 24 00 4A 4A 4A 4A 24 03 4A 4A 4A 4A 16 0B 0B 
   2=eTarget_SingleEnemy, 5 = eRange_Unlimited, 0 duration, -20 reaction, 1 = eEffect_Damage, 1 = eProp_FireWeapon, 25 = eProp_TargetNonRobotic, 36 = eProp_Stun,  3 = eDisplayProp_TopDownCamera

Allows targeting enemies to stun at unlimited ranges

to:
BuildAbility(9, 2, 5, -1, -20, 1,,, 1, 25, 36, 11)
1B 7E 0D 00 00 00 00 00 00 24 09 24 02 2C 01 2C 00 1D EC FF FF FF 24 01 4A 4A 24 01 24 19 24 24 24 00 4A 4A 4A 4A 24 03 4A 4A 4A 4A 16 0B 0B 
   2=eTarget_SingleEnemy, 1 = eRange_Weapon, 0 duration, -20 reaction, 1 = eEffect_Damage, 1 = eProp_FireWeapon, 25 = eProp_TargetNonRobotic, 36 = eProp_Stun,  3 = eDisplayProp_TopDownCamera

Uses range setting on Arc Thrower as set in DGC.ini

The eRange_Unlimited option actually allows the targeting of units that are not in LOS and have not been revealed, which I found rather interesting. I verified that I was able to successfully stun an alien at a range of ~8 tiles with this, and make stun attempts against one at a range of ~15 tiles (it had 10 HP so they all failed ^_^). This initial test used the iRange = 27 setting.

Link to comment
Share on other sites

I played around a bit more and was able to get the stun range rings to use the iRange stat from the ArcThrower.

 

Here's a couple of screenshots showing the increased range and top-down camera, along with the reduced stun chance (note that I still haven't been able to fix the targeting reticle display, although I put in a change that should have).

 

http://wiki.tesnexus.com/images/1/1e/Stun_Changes.jpg

 

 

Here is a screenshot of a stun occuring, captured using the \slomo 0.1 setting in the dev console:

 

http://wiki.tesnexus.com/images/c/ce/Stun_Changes_in_action.jpg

 

 

 

Balancing a long range Arc Thrower is of course an entirely separate issue. I'm not sure how to proceed on that front. I'd say that trying to adjust the stun chance based on range would work, but it will be a little bit of a pain to fit that distance code into both the UI and TryStunned functions...

 

 

Edit:

And ... yes ... that is a Sniper with Sprinter, Lightning Reflexes, Damn Good Ground and an Assault Rifle. Otherwise known as a scout :)

Edited by Amineri
Link to comment
Share on other sites

  • 2 weeks later...

Hi Amineri!. I'd like to make some changes to the Arc Thrower. Namely, I'm playing the long war mod and want to set the Arc Thrower back to Vanilla settings. I see the hex code above, but it soesnt have the format of the other modlets I've seen by you...so I'm not sure how to add it. Io normally use ToolBoks custom mod feature.

Link to comment
Share on other sites

@ Seraglio -- The hex change that halves the arc thrower chance can be undone with the following:

 

XComGame.upk >> XGTacticalGameCore >> TryStunned
Change the hex string
e2 82 00 00 16 1e 00 00 3e 43 16
to
e2 82 00 00 16 1e 00 00 c8 42 16
Of the top of my head, I'm not sure if it will report correctly, however ...
Link to comment
Share on other sites

JL made a change to suppress the Arc Thrower stun chance from displaying.

 

From my investigation it looked like the change was to ShouldShowPercentage.

 

The following hex change should change the display from "off" (in Long War) to "on"

 

Change is applied to XComGame.upk

In XGAbility_Targeted.ShouldShowPercentage
change:
return (((((GetCategory()) == 1) && !HasProperty(36)) && ...
04 84 84 82 82 9A 1B 74 31 00 00 00 00 00 00 16 26 16 18 0F 00 81 1B 9A 36 00 00 00 00 00 00 24 24 16 16 16 18 1D 00 

to:
return (((((GetCategory()) == 1) && !HasProperty(9)) && ...
04 84 84 82 82 9A 1B 74 31 00 00 00 00 00 00 16 26 16 18 0F 00 81 1B 9A 36 00 00 00 00 00 00 24 09 16 16 16 18 1D 00 

Note that this will always display the vanilla chance. If this is installed without JL's stun-chance change above the displayed stun chance will not match the actual stun chance.

 

----------

 

I haven't been doing very well at keeping up with converting all of my modlets into Custom Mod format, but fortunately Bertilsson has stepped up and volunteered to help out by converting many of them. :)

Link to comment
Share on other sites

Yes it is.

 

Speaking without authority but with lots of experience with using three perks (expanded perk trees mod - now included when applying the custom perk tree via Toolboks from the webtool you linked) and LW 1.08.

 

The mods are moddable. =)

Link to comment
Share on other sites

@ Seragliio73

 

You should be able to use ToolBoks to edit the Long 1.8 perk trees (it does not have the expanded perk trees, so is limited to the 1-2-2-2-2-1-1 layout).

 

As Zybertryx points out, you can apply the larger perk tree mod to Long War 1.8 to have access to the larger perk tree. Bertilsson's tool is perfectly compatible with Long War 1.8.

 

Bertilsson has a specific tool that generates only the perk assignments for the Long War 1.9 beta. (Trying to install the full Expanded Perk Tree mod on top of Long War 1.9 will cause significant problems).

Link to comment
Share on other sites

Ah, yeah 1.9 is monster and incompatible. Good call.

 

@ Amineri

 

However (hehe), and this may surprise you, if you use the new Toolboks to edit LW 1.8 perk trees (or even Vanilla) you can actually get up to a 3 - 3 - 3 - 3 - 3 - 3 - 3 - 3 layout even without the Enhanced Perk Trees mod but in doing so you will experience a UI format issue (a cosmetic only problem) in that your ingame perk tree will display a right-hand bias and any line with only a single perk will display a 'phantom' slot. Functionally it will be fine though. For those reading, the issue was raised (and resolved) on page 12 of this thread: http://forums.nexusmods.com/index.php?/topic/981018-ui-mod-bigger-perk-tree/page-12

 

That said, for non-LW 1.9 mods (and Vanilla) there is really is no good reason to not use the Enhanced Perk Trees mod (and Bertilsson's excellent webtool to generate your own custom class specific hirearchies).

 

Context: I think there's a lot of users who loved Toolboks but stopped using it because it was incompatible with Merciless 1.3 because Toolboks (1.2) lacked support for more than two perks per line (and basically broke their trees). But are now using Toolboks 1.3.x to 'drag-n-drop' their own perks per class - taking advantage of the new built in 'up-to-three' support - yet have not installed the stand alone Enhanced Perk Trees mod and are experiencing the odd UI formatting. I assume this because I was one of them.

 

The solution to the cosmetic issue is to use the Enhanced Perk Trees mod and the solution to using Bertilsson's webtool in any case is to use the Enhanced Perk Trees mod.

 

I believe Bertilsson has now included the EPT mod in the autogenerated text that his Perk Tree Customiser webtool generates.

Edited by Zybertryx
Link to comment
Share on other sites

  • Recently Browsing   0 members

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