Author Topic: [DONE][Suggestion] Random soldier recruitment bonuses  (Read 1080 times)

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11721
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
[DONE][Suggestion] Random soldier recruitment bonuses
« on: February 24, 2024, 01:08:06 pm »
Would you please consider adding a random list of transformation bonuses given to a soldier spawned from a project?

Currently we can do this (example from Piratez):

Code: [Select]
    spawnedSoldier:
        transformationBonuses:
          STR_FORMER_SPY_TRAIT: 1

In the requested feature, you could also get something this:

Code: [Select]
    spawnedSoldier:
        transformationBonusesCount: 1
        randomTransformationBonuses:
          STR_FORMER_SPY_TRAIT: 1
          STR_SOME_OTHER_TRAIT: 1
          STR_YET_ANOTHER_TRAIT: 1
          STR_AND_ANOTHER_TRAIT: 1
          STR_AND_ANOTHER_ANOTHER_TRAIT: 1

The flag randomTransformationBonuses determines which transformation bonuses are available to be picked, and transformationBonusesCount tells you how many are picked from this list.

The objective of this request is to enable more variety for recruits gained from irregular sources, as they can have randomish backgrounds, allowing more character individuality/flavour without straying into RPG territory too much. It would also help emphasise the challenges and unique factors of special recruitment, especially with less paramilitary settings (like Piratez or the WIP Cyberpunk mod).

If this gets implemented, it should also be viable to include in the basic recruitment process (buying soldiers), but that's a more radical departure from the basic X-Com concept and at this point I'm not sure myself if it's a good idea.

Online Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9078
    • View Profile
Re: [Suggestion] Random recruitment bonuses
« Reply #1 on: February 24, 2024, 01:42:14 pm »
The feature sounds OK to me.

The syntax will probably have to be different... things like startingBase or spawnedSoldier use the methods used also for loading saved games, which means I can't/shouldn't change them (otherwise I break loading saves). I'll think about it...

Todolisted.

Online Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9078
    • View Profile
Re: [DONE][Suggestion] Random soldier recruitment bonuses
« Reply #2 on: August 10, 2024, 07:12:20 pm »
Done.

Syntax is the same as you proposed.

Since same bonuses don't stack anyway, the number on the right-hand side is mis-used for RNG, as weight.

Example:

Code: [Select]
manufacture:
  - name: STR_RECRUITMENT_SPY
    spawnedPersonType: STR_SOLDIER
    spawnedSoldier:
      rank: 1
      transformationBonusesCount: 3   # default is 1
      randomTransformationBonuses:    # this is a weighted list of soldier bonuses, each item can be chosen only once
        STR_SPY_BONUS_X1: 500         # 50%
        STR_SPY_BONUS_X2: 200         # 20%
        STR_SPY_BONUS_X3: 100         # 10%
        STR_SPY_BONUS_X4: 100         # 10%
        STR_SPY_BONUS_X5: 100         # 10%
    producedItems: {}
    refund: true 
    category: STR_RECRUITMENT
    space: 0
    time: 10
    cost: 0

soldierBonuses:
  - name: STR_SPY_BONUS_X1
  - name: STR_SPY_BONUS_X2
  - name: STR_SPY_BONUS_X3
  - name: STR_SPY_BONUS_X4
  - name: STR_SPY_BONUS_X5

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11721
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: [DONE][Suggestion] Random soldier recruitment bonuses
« Reply #3 on: August 13, 2024, 02:08:10 pm »
It perfect. <3
Thank you!