OpenXcom Forum

Modding => OpenXcom Extended => OXCE Suggestions DONE => Topic started by: Meridian on September 15, 2019, 01:40:42 pm

Title: [DONE] [Suggestion] Soldier bonuses (from transformations and commendations)
Post by: Meridian on September 15, 2019, 01:40:42 pm
Quote
ohartenstein23Today at 2:27 PM
@Meridian The problem Solarius was having with transformations was that he wanted to use them to represent a number of advanced trainings unlocked by research to provide bonus stats; since they didn't change the soldier type and therefore the stat caps, if a player used them before a soldier reached the caps, they would have lower total stats than if they waited until the caps to use the training transformations. Using a new soldier type for each one was rejected since these trainings weren't mutually exclusive or to be done in a fixed order - Solarius had hoped that these would act like stat bonuses on an armor, but permanently attached to the soldier.

One possible solution we thought of would be to create a new ruleset data structure for bonuses added by transformations and commendations: these bonuses would be named by a unique type and define a set of parameters similar to an armor ruleset, then transformations and commendations could refer to them by that type. On creation of a battle unit from a soldier, these stats would be added to to what the unit's armor adds to the unit's stats, including trainable stats like TUs, firing, etc., as well as NV and recoveries.

A ruleset example might look like:
soldierBonuses:
  - name: STR_KARATE_TRAINING
    stats: # gives stats that don't count toward stat caps
      reactions: 5
      melee: 10
    recovery: # adds to recovery from armor
      energy:
        tuMax: 0.05 # extra energy recovery in all armors


soldierTransformation:
  - name: STR_TRAIN_IN_KARATE
    soldierBonusType: STR_KARATE_TRAINING
Title: Re: [DONE] [Suggestion] Soldier bonuses (from transformations and commendations)
Post by: Meridian on September 15, 2019, 01:41:01 pm
Soldiers can now collect bonuses.
Bonuses can be manually awarded by the player via soldier transformations; or automatically awarded together with a soldier commendation/medal.
Bonuses of the same name/type don't stack.
(Different bonuses changing the same attributes do stack.)

Bonuses can improve soldier stats (even over any maximum), regeneration of resources every turn and visibility at dark (until global maximum).

Since OXCE 7.1.4 also armor values can be modified.

Here is an example of a very long bonus:

Code: [Select]
soldierBonuses:
  - name: STR_FIRST_TEST
    visibilityAtDark: 20     # +20 tiles
    stats:
      tu: 99                 # +99 TUs
      stamina: 0
      health: 99
      bravery: 0
      reactions: 0
      firing: 0
      throwing: 0
      strength: 99
      psiStrength: 0
      psiSkill: 0
      melee: 0
      mana: 0
    recovery:
      time:
        flatOne: -10
      energy:
        flatOne: 100
      morale:
        flatOne: -15       # -15 morale per turn
      health:
        flatOne: -5
      mana:
        flatOne: -1
      stun:
        flatOne: 4

These bonuses can be assigned to soldiers via transformations:

Code: [Select]
soldierTransformation:
  - name: STR_TEST_TRANSFORM
    keepSoldierArmor: true
    createsClone: false
    allowsDeadSoldiers: false
    allowsLiveSoldiers: true
    allowsWoundedSoldiers: true
    allowedSoldierTypes:
      - STR_SOLDIER
    cost: 0
    recoveryTime: 1
#    flatOverallStatChange:
#      tu: 99
#      health: 99
#      strength: 99
    reset: false                                  # don't reset previous transformations or previous bonuses
    soldierBonusType: STR_FIRST_TEST              # bonus to assign
    lowerBoundAtMinStats: true
    upperBoundAtMaxStats: false
    upperBoundAtStatCaps: true
#    requiredItems:
#      STR_UNIQUE_ITEM: 1

The reset flag can be used to clear the bonuses gained by previous transformations. It also clears the list of previously performed transformations.
For example:
1. you train karate and gain a bonus
2. then you transform the guy into a MEC and want to lose all the previous bonuses (since MECs can't benefit from karate training... I hope)

Note: stats gained by "classic" transformations (i.e. those that are NOT bonuses) will NOT be reset; only bonuses can be reset

Or via commendations:

Code: [Select]
commendations:
  - type: STR_MEDAL_ALIENS_KILLED
    description: STR_MEDAL_ALIENS_KILLED_DESCRIPTION
    sprite: 1
    soldierBonusTypes: [STR_KILL1, STR_KILL2, STR_KILL3, STR_KILL4]           # various bonuses for various decoration levels
    criteria:
      killsWithCriteriaCareer: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
    killCriteria:
      -
        - [1, ["STATUS_DEAD", "FACTION_HOSTILE"]]

Bonuses are defined per decoration level.
You don't need to define all decoration levels... if a soldier has higher decoration level than defined, the highest available is used.

Test build: https://lxnt.wtf/oxem/builds//Extended/Extended-5.6.4-c50d95558-2019-09-15-win64.7z
Title: Re: [DONE] [Suggestion] Soldier bonuses (from transformations and commendations)
Post by: Meridian on September 15, 2019, 01:42:59 pm
GUI stuff.
Title: Re: [DONE] [Suggestion] Soldier bonuses (from transformations and commendations)
Post by: Meridian on September 15, 2019, 01:55:57 pm
Attached is a simple mod for testing.

Test build: https://lxnt.wtf/oxem/builds//Extended/Extended-5.6.4-c50d95558-2019-09-15-win64.7z
Title: Re: [DONE] [Suggestion] Soldier bonuses (from transformations and commendations)
Post by: Solarius Scorch on September 15, 2019, 02:12:38 pm
(https://i.imgflip.com/110of2.jpg)

You're too good for this world.
Title: Re: [DONE] [Suggestion] Soldier bonuses (from transformations and commendations)
Post by: Nord on September 15, 2019, 08:11:20 pm
Dunno yet how to implement such thing... but it MUST be useful.
Also, how about random bonuses?
Title: Re: [DONE] [Suggestion] Soldier bonuses (from transformations and commendations)
Post by: Solarius Scorch on September 17, 2019, 12:58:10 am
I have already spent a lot of time on this feature, working with Dioxine on Piratez. It's as great as it sounds.

One additional request: from the menu where all bonuses are displayed (small button), could it be possible to middle-click a bonus and have a stat page ("anal") displayed? Otherwise there will be a lot of typing in commendation descriptions...
Title: Re: [DONE] [Suggestion] Soldier bonuses (from transformations and commendations)
Post by: Meridian on September 17, 2019, 09:53:21 am
One additional request: from the menu where all bonuses are displayed (small button), could it be possible to middle-click a bonus and have a stat page ("anal") displayed? Otherwise there will be a lot of typing in commendation descriptions...

A normal ufopedia page or something more complicated?
Title: Re: [DONE] [Suggestion] Soldier bonuses (from transformations and commendations)
Post by: Solarius Scorch on September 17, 2019, 03:37:37 pm
A normal ufopedia page or something more complicated?

Something like the INFO/ANAL section, I'd say. It should list all bonuses fairly clearly.

A Pedia page would require making a lot of pages (up to 10 per commendation...) and manually keeping them all updated. This is not something I am prepared to do, to be honest.
Title: Re: [DONE] [Suggestion] Soldier bonuses (from transformations and commendations)
Post by: Meridian on September 17, 2019, 05:36:32 pm
Like this?
Title: Re: [DONE] [Suggestion] Soldier bonuses (from transformations and commendations)
Post by: Meridian on October 11, 2019, 04:04:01 pm
Two more features:
1. soldier transformations can now require commendations as a pre-requisite
2. soldier transformations can now require a minimum soldier rank

Example:

Code: [Select]
soldierTransformation:
  - name: STR_TEST_TRANSFORM
    requiredCommendations:
      STR_MEDAL_ORIGINAL8_NAME: 0     # no decoration needed
      STR_MEDAL_ALIENS_KILLED: 1      # at least first bronze pin

Code: [Select]
soldierTransformation:
  - name: STR_TEST_TRANSFORM
    minRank: 1     # 0 = rookie, 5 = commander
Title: Re: [DONE] [Suggestion] Soldier bonuses (from transformations and commendations)
Post by: Ethereal on October 11, 2019, 07:05:30 pm
And it is possible to make so that bonuses were given together with a rank automatically?
Title: Re: [DONE] [Suggestion] Soldier bonuses (from transformations and commendations)
Post by: ohartenstein23 on October 11, 2019, 07:49:19 pm
And it is possible to make so that bonuses were given together with a rank automatically?

You'd have to check with the commendations code whether a commendation can be given for reaching a certain rank, and then have a bonus tied to that.

If you're okay with something that requires a bit of player input, you could do it with transformations:

This could even be used to make an XCOM2012-style branching promotion system where the primary stat gains are determined by the player through rank-up transformations.
Title: Re: [DONE] [Suggestion] Soldier bonuses (from transformations and commendations)
Post by: Ethereal on October 11, 2019, 09:39:21 pm
I do not use commendations. Using transformations, you can give any bonuses without it. Here are the requirements for the rank previously were not.

By the way, if there is a bonus to regeneration and visibility at dark, like armor, can it be possible to expand the option for all the characteristics of the armor, so they can be used as a bonus?
Title: Re: [DONE] [Suggestion] Soldier bonuses (from transformations and commendations)
Post by: Meridian on October 12, 2019, 12:26:57 am
And it is possible to make so that bonuses were given together with a rank automatically?

I think this can be done already using scripts, not 100% sure.
(changing stats based on rank... without needing bonuses as such)

By the way, if there is a bonus to regeneration and visibility at dark, like armor, can it be possible to expand the option for all the characteristics of the armor, so they can be used as a bonus?

No... stats, regen and visibility are tracked on each unit separately... that's why I could affect them with bonuses.
Other attributes defined by armor are only on the armor itself, not on each unit, so they are the same for all units (having the same armor) and cannot be changed individually.
Title: Re: [DONE] [Suggestion] Soldier bonuses (from transformations and commendations)
Post by: wcho035 on October 12, 2019, 04:05:38 am
Do you have a link for the latest test build for this Meridian?

I tried to download the latest one, but I am getting segmentation faults and the older versions doesn't.
Title: Re: [DONE] [Suggestion] Soldier bonuses (from transformations and commendations)
Post by: Ethereal on October 12, 2019, 05:37:36 am
No... stats, regen and visibility are tracked on each unit separately... that's why I could affect them with bonuses.
Other attributes defined by armor are only on the armor itself, not on each unit, so they are the same for all units (having the same armor) and cannot be changed individually.

Does this apply to "visibilityAtDay", "psi-heatVision", "camouflageAt", "psiDefence", "meleeDodge", "antiCamouflageAt"?
Title: Re: [DONE] [Suggestion] Soldier bonuses (from transformations and commendations)
Post by: Meridian on October 12, 2019, 11:11:56 am
Does this apply to "visibilityAtDay", "psi-heatVision", "camouflageAt", "psiDefence", "meleeDodge", "antiCamouflageAt"?

No, it does not apply to: "visibilityAtDay"

Yes, it does apply to: "psi-heatVision", "camouflageAt", "psiDefence", "meleeDodge", "antiCamouflageAt"
Title: Re: [DONE] [Suggestion] Soldier bonuses (from transformations and commendations)
Post by: Ethereal on October 12, 2019, 01:36:25 pm
No: "visibilityAtDay"

Yes: "psi-heatVision", "camouflageAt", "psiDefence", "meleeDodge", "antiCamouflageAt"

Understood. How and where will such bonuses be displayed?
Title: Re: [DONE] [Suggestion] Soldier bonuses (from transformations and commendations)
Post by: Meridian on October 12, 2019, 02:34:05 pm
Understood.

I have answered the question: "Does this apply to "visibilityAtDay", "psi-heatVision", "camouflageAt", "psiDefence", "meleeDodge", "antiCamouflageAt"?"

The answer is "Yes"...or in full sentence "Yes, this does apply to all those attributes" (except visibilityAtDay).

Where "this" = "No... stats, regen and visibility are tracked on each unit separately... that's why I could affect them with bonuses. Other attributes defined by armor are only on the armor itself, not on each unit, so they are the same for all units (having the same armor) and cannot be changed individually."

How and where will such bonuses be displayed?

As written above, there are no such bonuses and they are not displayed anywhere.
Title: Re: [DONE] [Suggestion] Soldier bonuses (from transformations and commendations)
Post by: Meridian on May 14, 2020, 06:55:37 pm
Update: The soldier bonuses in the soldier bonuses overview window are now sorted by a newly added "listOrder" attribute.

Example:

Code: [Select]
soldierBonuses:
  - name: STR_THIRD
    listOrder: 30
  - name: STR_SECOND
    listOrder: 20
  - name: STR_FOURTH
    listOrder: 40
  - name: STR_FIRST
    listOrder: 10
Title: Re: [DONE] [Suggestion] Soldier bonuses (from transformations and commendations)
Post by: krautbernd on July 22, 2020, 12:09:21 pm
Question:

What exactely are the hard limits for stat bonuses awarded via commendations, and can they be defined somewhere?
Title: Re: [DONE] [Suggestion] Soldier bonuses (from transformations and commendations)
Post by: Yankes on July 22, 2020, 02:16:51 pm
I would need check, but scripts are responsible for summing final bonus values, and one goal was to add limits to values it returns.
Title: Re: [DONE] [Suggestion] Soldier bonuses (from transformations and commendations)
Post by: Meridian on July 23, 2020, 12:48:58 am
Bonuses can improve soldier stats (even over any maximum), regeneration of resources every turn and visibility at dark (until global maximum).

Visibility limits are at global mod maximum (e.g. vanilla 20, piratez 40, etc.).

Regen stats are unlimited, but final resource values don't go over their maximum. E.g. morale regen of +100000 doesn't give more than 100 final morale.

Other stats are practically unlimited.
Title: Re: [DONE] [Suggestion] Soldier bonuses (from transformations and commendations)
Post by: Meridian on October 24, 2021, 06:22:34 pm
Since OXCE 7.1.4, also armor values can be modified by soldier bonuses.

Code: [Select]
soldierBonuses:
  - name: STR_ARMOR_BUFF_BONUS
    frontArmor: 200
    leftArmorDiff: -100
    sideArmor: 400
    rearArmor: 500
    underArmor: 600
Title: Re: [DONE] [Suggestion] Soldier bonuses (from transformations and commendations)
Post by: Nord on October 24, 2021, 08:49:31 pm
Great, but why armors?
IMHO, it is more potent to affect psiVision or resistances.
Title: Re: [DONE] [Suggestion] Soldier bonuses (from transformations and commendations)
Post by: Meridian on October 24, 2021, 09:03:12 pm
Great, but why armors?

Because it was easy to do.

IMHO, it is more potent to affect psiVision or resistances.

Affecting resistances is practically not possible.
Not without a HUGE rework anyway.

psiVision would need a small rework too, but not too big... I can add that in future if needed
Title: Re: [DONE] [Suggestion] Soldier bonuses (from transformations and commendations)
Post by: Yankes on October 25, 2021, 01:31:34 am
Remember that y-scripts are aware of bonuses, this mean you can add nearly any logic linked to it and affect most of scripted parts.
Title: Re: [DONE] [Suggestion] Soldier bonuses (from transformations and commendations)
Post by: Nord on October 25, 2021, 09:59:03 am
Because it was easy to do.
This is an important argument.
Quote
psiVision would need a small rework too, but not too big... I can add that in future if needed
No thanks, not without this (https://openxcom.org/forum/index.php/topic,10190.0.html).
And as Yankes say, desired effects can be achieved by scripts.
Title: Re: [DONE] [Suggestion] Soldier bonuses (from transformations and commendations)
Post by: Finnik on October 25, 2021, 12:47:08 pm
Remember that y-scripts are aware of bonuses, this mean you can add nearly any logic linked to it and affect most of scripted parts.

Can I alter vision (heatVision, psiVision, visibilityAtDark) with YS?
Title: Re: [DONE] [Suggestion] Soldier bonuses (from transformations and commendations)
Post by: Meridian on October 25, 2021, 12:55:08 pm
Can I alter vision (heatVision, psiVision, visibilityAtDark) with YS?

No, you cannot alter any attributes of Armor.
Armor is a read-only "globally shared" entity.

But you can use hooks on hitUnit, damageUnit, visibilityUnit, etc. to change the algorithms so that they don't use only Armor attributes, but also additionally your custom BattleUnit tags.
Title: Re: [DONE] [Suggestion] Soldier bonuses (from transformations and commendations)
Post by: Yankes on October 25, 2021, 01:34:07 pm
No, you cannot alter any attributes of Armor.
Armor is a read-only "globally shared" entity.

But you can use hooks on hitUnit, damageUnit, visibilityUnit, etc. to change the algorithms so that they don't use only Armor attributes, but also additionally your custom BattleUnit tags.
This, I would never permit altering armor data during play as it would be asking for troubles.
Title: Re: [DONE] [Suggestion] Soldier bonuses (from transformations and commendations)
Post by: zee_ra on September 19, 2022, 12:47:51 am
I have answered the question: "Does this apply to "visibilityAtDay", "psi-heatVision", "camouflageAt", "psiDefence", "meleeDodge", "antiCamouflageAt"?"

The answer is "Yes"...or in full sentence "Yes, this does apply to all those attributes" (except visibilityAtDay).

Where "this" = "No... stats, regen and visibility are tracked on each unit separately... that's why I could affect them with bonuses. Other attributes defined by armor are only on the armor itself, not on each unit, so they are the same for all units (having the same armor) and cannot be changed individually."

As written above, there are no such bonuses and they are not displayed anywhere.

Could you please clarify, if the bonuses are calculated as formulaes?

If so, which bonuses?  The Ruleset Reference mentions that recovery.XXX bonuses could be.  I wonder, if stats.tu, stats.bravery, etc. also could?  I assume, the vibilityAtDark, psiVision, camouflageAtDark, camouflageAtDay, psiCamouflage, antiCamouflageAtDark, antiCamouflageAtDay, heatVision, frontArmor, sideArmor, rearArmor, underArmor could all be affected by a formula.  So, for example, something like this should be entirely possible:

Code: [Select]
    psiVision:
      psiStrength: 0.25
    frontArmor:
      psiStrength: [ 0.0 , 0.001 ]

Is such definition possible?  Would it yield dynamic bonuses based on the current parameter (e.g. psiStrength in a case under consideration) values?

Your input and perspective would be appreciated.

UPDATE.

Apparently, the formulae (mapping from current parameter values) only work for the recovery.* and psiDefense params.  I wonder, if that is indeed the case.  If so, is there an argument against the implementation of these parameters as mappings (i.e. computable dynamically)?  Is there a reason why only some parameters were made dynamic?  Would it be very hard to implement those parameters as dynamic?  Are they hard-coded in the VM?  Or, perhaps, they're specified through some low-level config?

I would also like to clarify, whether those params are additive.  In particular, all params related to visibility, namely antiCamouflageAtDay, antiCamouflageAtNight, camouflageAtDay, camouflageAtNight, heatVision, psiVision, psiCamouflage, and visibilityAtDark.  Do those bonuses add across all commendations?  Would e.g. heavVision = 60 and heatVision = 20 from different soldier bonuses yield heatVision == 80?  And, when those two soldier bonuses are combined with a heatVision = 20 bonus from armor, would I have heatVision == 100?
Title: Re: [DONE] [Suggestion] Soldier bonuses (from transformations and commendations)
Post by: Meridian on September 20, 2022, 04:13:54 pm
Could you please clarify, if the bonuses are calculated as formulaes?

No, they are not all calculated as formulaes.

If so, which bonuses?

All bonuses under the "recovery" section (time, energy, morale, health, mana, stun).


The Ruleset Reference mentions that recovery.XXX bonuses could be.  I wonder, if stats.tu, stats.bravery, etc. also could?

No.

I assume, the vibilityAtDark, psiVision, camouflageAtDark, camouflageAtDay, psiCamouflage, antiCamouflageAtDark, antiCamouflageAtDay, heatVision, frontArmor, sideArmor, rearArmor, underArmor could all be affected by a formula.  So, for example, something like this should be entirely possible:

Code: [Select]
    psiVision:
      psiStrength: 0.25
    frontArmor:
      psiStrength: [ 0.0 , 0.001 ]

Is such definition possible?

No.

Would it yield dynamic bonuses based on the current parameter (e.g. psiStrength in a case under consideration) values?

No.

Apparently, the formulae (mapping from current parameter values) only work for the recovery.* and psiDefense params.  I wonder, if that is indeed the case.

no, `psiDefense` param doesn't exist

If so, is there an argument against the implementation of these parameters as mappings (i.e. computable dynamically)?

Yes.

Is there a reason why only some parameters were made dynamic?

Yes.

Would it be very hard to implement those parameters as dynamic?

Some yes, some no.

Are they hard-coded in the VM?

What's a VM?

Or, perhaps, they're specified through some low-level config?

No.

I would also like to clarify, whether those params are additive.  In particular, all params related to visibility, namely antiCamouflageAtDay, antiCamouflageAtNight, camouflageAtDay, camouflageAtNight, heatVision, psiVision, psiCamouflage, and visibilityAtDark.

The only parameter that exists is `visibilityAtDark` and it is additive.

The other parameters don't exist.

Do those bonuses add across all commendations?

Yes.

Would e.g. heavVision = 60 and heatVision = 20 from different soldier bonuses yield heatVision == 80?

No, parameter `heatVision` doesn't exist.

And, when those two soldier bonuses are combined with a heatVision = 20 bonus from armor, would I have heatVision == 100?

No, parameter `heatVision` doesn't exist.
Title: Re: [DONE] [Suggestion] Soldier bonuses (from transformations and commendations)
Post by: StarMan on September 20, 2022, 08:31:50 pm
Is this going to be part of oxce in the future or is there a mod for this?
Title: Re: [DONE] [Suggestion] Soldier bonuses (from transformations and commendations)
Post by: Meridian on September 20, 2022, 08:51:31 pm
This is part of oxce already.
Title: Re: [DONE] [Suggestion] Soldier bonuses (from transformations and commendations)
Post by: Aldorn on February 26, 2023, 03:15:00 pm
This is part of oxce already.

Meridian,

I read this full thread, your posts included, but I still would have two question about Commendations and SoldierBonuses

Let's assume I have a commendation as follow:
10 levels of commendation with 4 levels of bonuses:
- Commendation L1 to L4 => SoldierBonus L1
- Commendation L5 to L7 => SoldierBonus L2
- Commendation L8 to L9 => SoldierBonus L3
- Commendation L10 => SoldierBonus L4

Code: [Select]
commendations:
  - type: STR_COMMENDATION_ALIENS_KILLED #Total number of kills across a soldier's career that meet the specified criteria
    description: STR_COMMENDATION_ALIENS_KILLED_DESCRIPTION
    sprite: 1
    criteria:
      killsWithCriteriaCareer: [10, 20, 30, 40, 50, 75, 100, 200, 300, 500]
    soldierBonusTypes: [STR_SB_COMMENDATION_ALIENS_KILLED1, STR_SB_COMMENDATION_ALIENS_KILLED1, STR_SB_COMMENDATION_ALIENS_KILLED1, STR_SB_COMMENDATION_ALIENS_KILLED1, STR_SB_COMMENDATION_ALIENS_KILLED2, STR_SB_COMMENDATION_ALIENS_KILLED2, STR_SB_COMMENDATION_ALIENS_KILLED2, STR_SB_COMMENDATION_ALIENS_KILLED3, STR_SB_COMMENDATION_ALIENS_KILLED3, STR_SB_COMMENDATION_ALIENS_KILLED4]
    killCriteria:
      -
        - [1, ["STATUS_DEAD", "FACTION_HOSTILE"]]

soldierBonuses:
  - name: STR_SB_COMMENDATION_ALIENS_KILLED1
    stats:
      tu: 5
  - name: STR_SB_COMMENDATION_ALIENS_KILLED2
    stats:
      health: 5
  - name: STR_SB_COMMENDATION_ALIENS_KILLED3
    stats:
      tu: 5
  - name: STR_SB_COMMENDATION_ALIENS_KILLED4
    stats:
      health: 5

Questions:
1) Do I need to declare
Code: [Select]
soldierBonusTypes: [STR_SB_COMMENDATION_ALIENS_KILLED1, STR_SB_COMMENDATION_ALIENS_KILLED1, STR_SB_COMMENDATION_ALIENS_KILLED1, STR_SB_COMMENDATION_ALIENS_KILLED1, STR_SB_COMMENDATION_ALIENS_KILLED2, STR_SB_COMMENDATION_ALIENS_KILLED2, STR_SB_COMMENDATION_ALIENS_KILLED2, STR_SB_COMMENDATION_ALIENS_KILLED3, STR_SB_COMMENDATION_ALIENS_KILLED3, STR_SB_COMMENDATION_ALIENS_KILLED4]
or may I perhaps make it shorter
Code: [Select]
soldierBonusTypes: [STR_SB_COMMENDATION_ALIENS_KILLED1, , , , STR_SB_COMMENDATION_ALIENS_KILLED2, , , STR_SB_COMMENDATION_ALIENS_KILLED3, , STR_SB_COMMENDATION_ALIENS_KILLED4]
or even another solution ?


2) In given example, will the 10th level of Commendation provide cumulative bonus of
- tu +10
- health +10

or only the bonus attached to the 10th level
- health +5

Said differently, if I want a cumulative result, would I have to declare
Code: [Select]
soldierBonuses:
  - name: STR_SB_COMMENDATION_ALIENS_KILLED1
    stats:
      tu: 5
  - name: STR_SB_COMMENDATION_ALIENS_KILLED2
    stats:
      tu: 5
      health: 5
  - name: STR_SB_COMMENDATION_ALIENS_KILLED3
    stats:
      tu: 10
      health: 5
  - name: STR_SB_COMMENDATION_ALIENS_KILLED4
    stats:
      tu: 10
      health: 10

(It may have to do with reset option, but not sure how to make it work properly)

PS: Commendation and SoldierBonuses modding is really great  ::)
Title: Re: [DONE] [Suggestion] Soldier bonuses (from transformations and commendations)
Post by: Meridian on February 26, 2023, 07:23:10 pm
Questions:
1) Do I need to declare
Code: [Select]
soldierBonusTypes: [STR_SB_COMMENDATION_ALIENS_KILLED1, STR_SB_COMMENDATION_ALIENS_KILLED1, STR_SB_COMMENDATION_ALIENS_KILLED1, STR_SB_COMMENDATION_ALIENS_KILLED1, STR_SB_COMMENDATION_ALIENS_KILLED2, STR_SB_COMMENDATION_ALIENS_KILLED2, STR_SB_COMMENDATION_ALIENS_KILLED2, STR_SB_COMMENDATION_ALIENS_KILLED3, STR_SB_COMMENDATION_ALIENS_KILLED3, STR_SB_COMMENDATION_ALIENS_KILLED4]
or may I perhaps make it shorter
Code: [Select]
soldierBonusTypes: [STR_SB_COMMENDATION_ALIENS_KILLED1, , , , STR_SB_COMMENDATION_ALIENS_KILLED2, , , STR_SB_COMMENDATION_ALIENS_KILLED3, , STR_SB_COMMENDATION_ALIENS_KILLED4]
or even another solution ?

You can omit the bonuses at the end.
Not in the middle, as far as I remember.
Test to be sure.

2) In given example, will the 10th level of Commendation provide cumulative bonus of
- tu +10
- health +10

or only the bonus attached to the 10th level
- health +5

Each commendation in the soldier's diary has only one level.
Each commendation level provides only one bonus.
There is no automagical cumulation.
Title: Re: [DONE] [Suggestion] Soldier bonuses (from transformations and commendations)
Post by: Aldorn on February 26, 2023, 08:05:26 pm
You are right, I will make tests

Thanks for the answers

And congrats for the good job!