XCOM 2
Armor Chance for Unarmored Units [WOTC]
48 Comments
zin 27 Apr, 2023 @ 5:24pm 
Ah, yes, very simple. But me, I’m bad at maths, once again. Thank you!
Alex Nares  [author] 27 Apr, 2023 @ 5:08pm 
Yes, for 33.33% chance of 1 Armor:

+RandomizedBaseStats=(StatType=eStat_ArmorMitigation, StatAmount=-1, RandStatAmount=3)
zin 27 Apr, 2023 @ 10:00am 
Hi, I can’t figure out how to set a 30–35% chance of 1 armour.
Do you know of a configuration that results in that (perhaps, 33.33% chance of 1 armour)?

I came up with this:
+RandomizedBaseStats=(StatType=eStat_ArmorMitigation, StatAmount=-6, RandStatAmount=9)

That’s a 22.22% chance of 1–2 armour, which I use for Faceless, which is nice.
An Essential Hiro 16 Apr, 2023 @ 8:15am 
Oh alright then, no worries!
Alex Nares  [author] 16 Apr, 2023 @ 5:06am 
Thanks, but sorry, I am no longer modding XCOM 2.
An Essential Hiro 15 Apr, 2023 @ 10:46am 
Any chance of adding frost legion enemies? Also, I've noticed that the Advent Demoman from LW2/LWOTC is not on the list. Great mod though, loved configuring it to up the difficulty curve.
zin 12 Apr, 2023 @ 7:45pm 
Oop! You’re right! I did forget to put a hyphen before the 1. The weird thing is, I’m pretty sure I used to have that, but I changed it for some reason.

And I had this configuration for 120 enemies… welp! Thanks for the help!

It took me a while to understand how the mod works, but thankfully I got it eventually.
Alex Nares  [author] 12 Apr, 2023 @ 7:34pm 
That's because if you have this:

+RandomizedBaseStats=(StatType=eStat_ArmorMitigation, StatAmount= 1 , RandStatAmount= 4 )

That means they start with 1 armor (StatAmount=1) and gain a random amount from 1-4 (RandStatAmount=4) then always -1 afterward. So they gain 0-3 which would result in 4 Armor with their base armor of 1. You probably forgot to put the " - " in front of the 1 (to make it -1 instead of +1).

But all the other stats are correct, great job posting a chart. Looks like you have a correct understanding of how the stats work!
zin 12 Apr, 2023 @ 2:27pm 
I have a little problem. I’ve encountered Lost Dashers with 4 armour; however, I’ve set them to have a 50% chance of 1–2 armour:
+RandomizedBaseStats=(StatType=eStat_ArmorMitigation, StatAmount= 1 , RandStatAmount= 4 )

I don’t understand why this is happening. Is this due to this mod, you think? I also have WorldWarLost, but that only gives Brutes armour as far as I can tell.
zin 12 Apr, 2023 @ 1:31pm 
Other options:

16.66% chance of 1 armour (default):
StatAmount= -4 , RandStatAmount= 6

20% chance of 1 armour:
StatAmount= -3 , RandStatAmount= 5

25% chance of 1 armour:
StatAmount= -2 , RandStatAmount= 4
zin 12 Apr, 2023 @ 1:31pm 
Here are all the configurations I’m using for various enemies for anyone interested:

50% chance of 1 armour:
StatAmount= 0 , RandStatAmount= 2

33.33% chance of 1–2 armour:
StatAmount= -3 , RandStatAmount= 6

50% chance of 1–2 armour:
StatAmount= -1 , RandStatAmount= 4

50% chance of 1–3 armour:
StatAmount= -2 , RandStatAmount= 6

60% chance of 1–3 armour:
StatAmount= -1 , RandStatAmount= 5

66.66% chance of 1–2 armour:
StatAmount= 0 , RandStatAmount= 3

100% chance of 1 armour:
StatAmount= 1 , RandStatAmount= 0

100% chance of 2 armour:
StatAmount= 2 , RandStatAmount= 0

100% chance of 3 armour:
StatAmount= 3 , RandStatAmount= 0 )

100% chance of 1–2 armour:
StatAmount= 1 , RandStatAmount= 2

100% chance of 1–3 armour:
StatAmount= 1 , RandStatAmount= 3
zin 8 Apr, 2023 @ 6:49am 
Oh yes, I’m dumb! Thank you.
Alex Nares  [author] 7 Apr, 2023 @ 10:07pm 
For 50% chance of 1 Armor:

+RandomizedBaseStats=(StatType=eStat_ArmorMitigation, StatAmount= 0 , RandStatAmount= 2 )

Because the starting armor is 0, then it adds a random range from 1-2 (because RandStatAmount= 2), then always subtract -1.
zin 7 Apr, 2023 @ 3:23pm 
Okay, I think that’s actually impossible with this configuration.
zin 7 Apr, 2023 @ 10:29am 
Thank you. I recently understood how it works. However, I was wondering how to get a 50% chance of 1 armour? Still can’t figure that out.
Alex Nares  [author] 6 Apr, 2023 @ 6:36pm 
It's no problem asking questions. You got that line correct. Starting with -1 Armor and then adding a random amount from 0-3 (because that's RandStatAmount = 4 maximum armor added -1). That will result in enemies getting 0 Armor 50% of the time (because it could roll -1 or 0), then 50% chance to roll 1, or 2.
zin 5 Apr, 2023 @ 1:00pm 
Wait, hold on, I think I figured it out.

+RandomizedBaseStats=(StatType=eStat_ArmorMitigation, StatAmount= -1 , RandStatAmount= 4 )

That’s a 2/4 chance, or a 50% chance, for 1–2 armour. This should mean that any units that do NOT already have armour should spawn with either 1 or 2 armour, 50% of the time, correct?
zin 5 Apr, 2023 @ 12:20pm 
Sorry for asking so many questions, but this is one of my favourite mods for making the game harder in a subtle way.

Just wondering, could you provide me with the correct line to make it so that all unarmoured enemies have a 50% chance to get 1 OR 2 armour (assuming it’d be a 50/50 chance to get either 1 or 2 armour – and a 50% total chance to get any additional armour)? Much appreciated!
Alex Nares  [author] 3 Apr, 2023 @ 6:41pm 
Sorry, I don't know
zin 3 Apr, 2023 @ 3:19am 
Whilst it may not work with modded enemies by default, do you know if it works with LWotC?
zin 26 Mar, 2023 @ 1:00pm 
Thank you!
Alex Nares  [author] 26 Mar, 2023 @ 12:48pm 
No that's 50% (and sometimes will be 2 or 3 armor). Because you're starting with -2 (which results in 0 armor), and then a random number from 0-5 is added to your -2.

To make it 25% chance to have 1 armor (and no more than 1 armor), do this:

+RandomizedBaseStats=(StatType=eStat_ArmorMitigation, StatAmount= -2 , RandStatAmount= 4 )
zin 26 Mar, 2023 @ 12:16pm 
+RandomizedBaseStats=(StatType=eStat_ArmorMitigation, StatAmount= -2 , RandStatAmount= 6 )

This is 25%/26%, right?
Alex Nares  [author] 25 Mar, 2023 @ 7:48am 
Yes, but if you saved your game halfway through a tactical mission, you won't see changes until the next mission.
zin 24 Mar, 2023 @ 10:55am 
Does it work mid-campaign?
Alex Nares  [author] 20 Mar, 2023 @ 9:35pm 
Correct! You got it. The eStat "ArmorMitigation" is the number of armor points they will start with (however, a negative number means 0 armor). The RandStatAmount is a random number from 1 to X (where X is the number in the RandStatAmount) and this number gets added to the base armor value per spawn and then subtracts -1. So really, if that random stat is 5, then that means 0 to 4 armor gets randomly added to the base value of -3, resulting in 0 armor 80% of the time and 1 Armor 20% of the time.

Answering your first question (does this work for mods adding custom enemies)... only if those enemies are in the INI and have a similar setup for Armor Mitigation. You can add them yourself if they aren't in there already (I'm not actively modding XCOM these days).

To remove this effect from the Lost, delete all of the Lost enemies in this mod from the CharacterStats INI.
zin 20 Mar, 2023 @ 9:48am 
I changed all these lines in XCOMGameData_CharacterStats.ini in the mod folder within the workshop folder in the Steam files:
+RandomizedBaseStats=(StatType=eStat_ArmorMitigation, StatAmount= -4 , RandStatAmount= 6 )

to:
+RandomizedBaseStats=(StatType=eStat_ArmorMitigation, StatAmount= -3 , RandStatAmount= 5 )

This makes all unarmoured enemies have a 20% chance, instead of a 17% chance, to get one armour point, correct?
zin 20 Mar, 2023 @ 7:31am 
Hi, love the mod; exactly what I was looking for!

Was just wondering, does this work for mods that add custom enemy types – such as A Better ADVENT: WotC?

Also, could you please show me how I could change the chance to something higher, such as 20 or 25%, and exclude The Lost? Thank you!
Alex Nares  [author] 10 Aug, 2021 @ 8:30pm 
Actually I believe the Advent Heavy doesn't come with armor. Just an LMG. That's why it was included.
Odd 10 Aug, 2021 @ 2:49pm 
Hey Alex! Just tried this mod and had an Advent Heavy show up with 0 armor when it should have 1 at base level. Just wondering what might be causing this. I sent you a friend request as I'm using this mod in a current YT run so was hoping to have a quick chat and try to understand it.
steven777 6 Jul, 2021 @ 5:25am 
Thanks - adds to gameplay.
Alex Nares  [author] 10 Oct, 2020 @ 11:10pm 
You can make it 100% by changing "StatAmount" to 1 and "RandStatAmount" to 1.
Oblivious Naga 16 Sep, 2020 @ 6:48am 
Thankis. done something similar with a different mod so I know its doable. Mite make lost super OP but thats half the fun
Alex Nares  [author] 16 Sep, 2020 @ 5:02am 
lmost correct but not quite. Put StatAmount to 1 -- this means the enemy starts with 1 Armor minimum.

And set RandStatAmount for 1 -- this means the game will choose a random number (starting from 0) with a range of 1 possible number ( only 0).

Overall, this would mean that each enemy starts with 1 Armor, then adding a random amount of additional Armor points ranging from 0 to 0.
Oblivious Naga 15 Sep, 2020 @ 7:44am 
So if I want to 100% it I would have to set the stat amount to 1 and random stat amount to 0?
Alex Nares  [author] 14 May, 2020 @ 11:22am 
Anytime, let me know if you have any more questions or ideas.
CptnHappyTimePie 14 May, 2020 @ 11:20am 
I was physically hurting my brain when I tried to figure out the math/logic for the settings but I've got there in the end. Thank you again for the mods and taking the time to help, much appreciated
Alex Nares  [author] 14 May, 2020 @ 11:18am 
No, the way you have it would give Soldiers a random amount of Armor from 0-4. "StatAmount" is the lowest that the stat can be (in this case, minimum of 0 Armor). Then, "RandStatAmount" adds to the number randomly (including possibly adding 0), so by having a 5 there, it will randomly add up to 5 numbers; either 0, 1, 2, 3, or 4 Armor. <-- There's 5 numbers there)

To make Armor chance 20%, reduce "StatAmount" to -3, then increase the "RandStatAmount" to 5, so the game will randomly add 0, 1, 2, 3, or 4. In that case, the first 4 numbers would result in 0 Armor, with only a roll of 4 adding 1 Armor. BUT as you stated before, you noticed soldiers having less Armor than they should have, that's because if a negative number is rolled, it subtracts from any advanced armor (such as the Armor bonus from Predator Armor, etc). But any numbers lower than 0 will be 0.
CptnHappyTimePie 14 May, 2020 @ 10:51am 
I actually miss random Xcom Soldiers getting +1 armor now :/ Would setting the following result in a 20% chance for recruits to gain +1 Armor?

+RandomizedBaseStats=(StatType=eStat_ArmorMitigation, StatAmount= 0 , RandStatAmount= 5 )
Alex Nares  [author] 14 May, 2020 @ 10:43am 
Thanks for pointing those out, I forgot to remove those from the list (will do that later today). Yes, SparkSoldier is XCOM Sparks.
CptnHappyTimePie 14 May, 2020 @ 10:14am 
Went ahead and changed to 20% on my end, much better now.

Also finally think I've found the cause of my Soldiers randomly having -2 -1 or +1 Armor :/ I excluded the following because they're Xcom units not ADVENT:

[Soldier_Diff_0 X2CharacterTemplate]
[Soldier_Diff_1 X2CharacterTemplate]
[Soldier_Diff_2 X2CharacterTemplate]
[Soldier_Diff_3 X2CharacterTemplate]

( Unsure if these are Xcom or not so excluded anyway )
[SparkSoldier_Diff_0 X2SparkCharacterTemplate_DLC_3]
[SparkSoldier_Diff_1 X2SparkCharacterTemplate_DLC_3]
[SparkSoldier_Diff_2 X2SparkCharacterTemplate_DLC_3]
[SparkSoldier_Diff_3 X2SparkCharacterTemplate_DLC_3]

Was driving me mad for ages
CptnHappyTimePie 14 May, 2020 @ 8:01am 
Amazing response and thank you for the detailed instructions on what to edit, really helped.

Going to wait until your official update, love the concept of the mod but with A Better Barracks PLUS in combination with Diverse Enemy by Force Level (manually edited in ADVENTs favor) the result has been fun, but overall mixed.

(still playing with default squad of 4 on Legend, have it set to max upgrade GTS to total of 8 squad)
Alex Nares  [author] 14 May, 2020 @ 7:14am 
I'm going to update it later today so that the chance of armor is 16.67% because I noticed that 25% might be a little too strong.
Alex Nares  [author] 14 May, 2020 @ 6:49am 
[Read previous post]

It says "StatAmount=-2" which means, the unit will start with -2 Armor. Then you see "RandStatAmount=4" which means it will randomly select between 4 numbers to add (including 0), so in this case it is 0, 1, 2, or 3.

To make Armor chance 20%, reduce "StatAmount" to -3, then increase the "RandStatAmount" to 5, so the game will randomly add 0, 1, 2, 3, or 4. In that case, the first 4 numbers would result in 0 Armor, with only a roll of 4 adding 1 Armor.

The closest you can get to 15% is actually 14.28%. You would have to reduce "StatAmount" to -5, then increase "RandStatAmount" to 7. The game will roll 0, 1, 2, 3, 4, 5, or 6 and only give 1 Armor on a 6.

You will need to edit each character template, as your edits would only apply to the character that you are editing. Best way to do this is to use "Find and Replace" feature to mass-replace all text in the entire document.
Alex Nares  [author] 14 May, 2020 @ 6:49am 
Yes - but not in the same way that you're thinking. It isn't a %-based parameter. Currently I have it set so that when a unit spawns, they spawn with a default of -2 Armor (yes a negative number of Armor). Then the game adds a random number of Armor from 0-3. If the final result is less than 0, then the game defaults it to 0.

So if the game rolls 0, 1, or 2, it results in 0 Armor. If the game rolls a 3, then that results in 1 Armor (because if you add -2 and 3, you get 1). All things considered, it is a 25% chance of getting 1 Armor.

So if you wanted to change it to 20% or 15%, go into the mod's folder and open CharacterStats.ini. You'll notice that each character has a line that says "RandomizedBaseStats=(StatType=eStat_ArmorMitigation) <--- This is the Armor stat.

Continued on next post.
CptnHappyTimePie 14 May, 2020 @ 4:52am 
Is there a way to manually edit the chance down to 15% or 20% through ini edits?
Alex Nares  [author] 9 May, 2020 @ 5:21pm 
That is a possibility. I will add it to my mod "wish list".
Dad By Daylight 9 May, 2020 @ 12:00pm 
This is great. Do you think a variation of this regarding crit chance would be possible? Making certain enemies randomly more lethal would be fun.