aliens

Author Topic: Stats by Rank / Promotion  (Read 2139 times)

Offline 1eyedking

  • Squaddie
  • *
  • Posts: 3
    • View Profile
Stats by Rank / Promotion
« on: March 22, 2020, 10:20:15 pm »
Hi everyone, long time lurker here. I've tried searching for this solution but haven't been able to find it anywhere, so here goes my query to the more knowledgeable people:

I'm trying to script a mod where soldiers have fixed stats defined by rank or promotion automatically, but so far I haven't been able to pinpoint the variables for scripting this in.

Can this be done at all?

Any help is greatly appreciated :)

« Last Edit: March 22, 2020, 11:59:09 pm by 1eyedking »

Offline memmaker

  • Captain
  • ***
  • Posts: 95
    • View Profile
Re: Stats by Rank / Promotion
« Reply #1 on: March 23, 2020, 02:29:26 am »
If I am not mistaken, you could do this without scripting by using soldier transformation.
You could have soldier transformations bound to a specific rank and give the resulting soldiers specific stats.

Offline 1eyedking

  • Squaddie
  • *
  • Posts: 3
    • View Profile
Re: Stats by Rank / Promotion
« Reply #2 on: March 23, 2020, 04:43:25 am »
I read some documentation about soldierTransformation, but stats are a bonus and not a fixed set amount. They're not automatic either :(

Is there a way to make stats fixed (rather than a +bonus) and apply changes automatically for each promotion?

Offline 1eyedking

  • Squaddie
  • *
  • Posts: 3
    • View Profile
Re: Stats by Rank / Promotion
« Reply #3 on: March 25, 2020, 12:05:43 am »
I've made a small mod with the following changes, may speed up someone's modding who wants to do something similar:
  • All soldiers start with fixed average stats = (min+max)/2. Soldiers can't increase stats beyond next promotion's limit, incentivizing to transform immediately after promotion. File: soldiers.rul
  • Soldiers increase their stats with rank. Higher rank bonuses overrule lower rank bonuses. Stats increase lineally towards the maximum cap, reached at Commander rank. File: stats_rank.rul
Still there must be a way for this to be made cleaner/automatic via scripting

Any help is welcome!!

Edit: Added TFTD version as well, fixed some issues. Added contingency stats-1 stats+1 transformations in case soldiers not promoting automatically.
« Last Edit: March 26, 2020, 08:21:07 pm by 1eyedking »