Author Topic: [OXCE] Randomized Stat Caps for Soldiers  (Read 999 times)

Offline Firaa

  • Squaddie
  • *
  • Posts: 8
    • View Profile
[OXCE] Randomized Stat Caps for Soldiers
« on: September 18, 2019, 10:31:05 pm »
I've played an embarrassing amount of X-Com: UFO Defense in my life, and probably so have most of you. But, in my opinion, a lot of mods have started to run into a problem with the vanilla mechanics that didn't really become an issue itself in the original game - late-game stat caps. I have a lot of fun outfitting soldiers in the early/mid-game of basically every mod I've played. I enjoy micromanaging soldiers to have effective and unique loadouts, and the sheer girth of equipment lists in many mods really feed into that enjoyment. Then, when the end-game rolls around, I end up having a few common loadouts that get pasted onto my ever-growing group of well-trained veterans, as everyone's stats begin to become... samey. I've played a lot with this script active, and it has made veterans so much more exciting for me, since I was dealing with soldiers who had variable stats once again. Some soldiers will make better snipers, heavy weapon specialists, or grenadiers than others, and you will encounter the rare soldier who is truly elite. Anyway, I hope someone else gets some enjoyment out of this.

How it Works
Tags are assigned to the soldier ruleset. These tags are a random 'penalty', which stats cannot grow beyond. By raising the stat caps by 10 and applying a random penalty between 0 to 20, you effectively create a random stat that is either up to 10 lower or 10 higher than the original stat cap. When a battle begins, this script calculates the stat caps for any soldiers present who have not yet been assigned stat caps. When the battle ends, after experience is awarded, the script 'trims the fat'. This script is easily applied to any mod, and is safe to add to any in-progress game.

A secondary function is that this script also generates an "intelligence" tag for each soldier. This is a multiplier applied to all experience earned, meaning some soldiers will just grow faster than others, and some soldiers will grow slower than normally. This intelligence modifier is assigned to a soldier at the same time they are initialized with their stat caps, and is completely invisible. The only way to know a soldier's intelligence modifier is via their actual growth rate. If you don't like this, you can easily disable it by opening script.rul and deleting the line near the end of the document that includes the text "awardExperience" and everything after it.

This script trims excess stats at the end of combat, so if you play with training facilities, make sure your training caps aren't higher than the minimum stat caps. This script also does not affect Psi-strength or Psi-skill. It also doesn't affect Bravery, since some people will just have better vision than others, but everybody has the capacity to be completely and utterly mentally broken desensitized to high-impact alien violence. Also, I assume that anyone who trains their entire force's bravery to capacity is an ABSOLUTE PSYCHOPATH. :P

Known Issues
- After a battle, the experience screen may show secondary stats (TUs, Stamina, Strength) as a negative change. This is only a display error, and these stats are at their current cap.

Requirements
OXCE 5.6.3 or higher. You MUST be using one of the OXCE test builds for this mod to function! You can either compile the current build yourself by following the instructions in the OXCE forum, or download one of the recent test builds posted by Meridian across various posts.

Attached Downloads
Standard - The vanilla soldier version. Soldiers are given a random stat cap that is 10 above or below the old stat cap. You will most likely not notice this mod in a normal vanilla playthrough (although it is fully functional for it), what with the limited gear options and comparatively short campaign, but this download will work with any mod that uses the default soldier, like XenoOps, or FMP.
40k - This version is already configured for the 40k mod. Guardsmen have more tame stat ranges, while units like Ogryn, Sisters of Battle, and Space Marines can generate certain stat caps at much greater ranges. Tags aren't modified when a soldier is transformed, so units will retain their strengths and weaknesses when they become officers/dreadnoughts while still gaining the benefits of the increased stat caps. This means that some soldiers are clearly superior candidates for advancement!

Offline peirceg

  • Captain
  • ***
  • Posts: 54
    • View Profile
Re: [OXCE] Randomized Stat Caps for Soldiers
« Reply #1 on: May 09, 2020, 06:41:51 pm »
Hi I edited around and got this working for the xpiratez mod. However for some reason soldiers are not gaining any primary stats, is there anything you think I might have missed?

Offline vadracas

  • Colonel
  • ****
  • Posts: 267
  • Just another player/modder combo.
    • View Profile
Re: [OXCE] Randomized Stat Caps for Soldiers
« Reply #2 on: May 09, 2020, 07:00:34 pm »
Hi I edited around and got this working for the xpiratez mod. However for some reason soldiers are not gaining any primary stats, is there anything you think I might have missed?

Upload file please?

Offline peirceg

  • Captain
  • ***
  • Posts: 54
    • View Profile
Re: [OXCE] Randomized Stat Caps for Soldiers
« Reply #3 on: May 10, 2020, 06:51:31 am »
Seems to load with it. deleted the end bit because it wasnt giving out firing accuracy experience.

Also tested slightly with the 40k version in the 40k mod, doesnt seem to be giving out xp there either.
« Last Edit: May 10, 2020, 07:06:53 am by peirceg »