Author Topic: [SOLVED]How to apply alienItemLevels to allied soldiers?  (Read 3875 times)

Offline efrenespartano

  • Commander
  • *****
  • Posts: 748
  • I know a lot about the law and other lawyerings.
    • View Profile
[SOLVED]How to apply alienItemLevels to allied soldiers?
« on: March 15, 2019, 01:04:47 am »
Hi all!

I am trying to understand how to apply the alienItemLevels to the soldiers that will accompany the player in new missions that I am working on. I understand how they work for aliens (after a lot of searching here in the forum and in the UFOpedia Ruleset Reference Page), but I do not really know how to apply it to civilians!

I share a bit of the code to illustrate them:

Code: [Select]
units:
  - type: STR_BRITISH_RIFLEMAN_NPC
    race: STR_HUMANS
    rank: STR_LIVE_SOLDIER
    stats:
      tu: 50
      stamina: 100
      health: 35
      bravery: 100
      reactions: 40
      firing: 65
      throwing: 50
      strength: 45
      psiStrength: 35
      psiSkill: 0
      melee: 20
    armor: STR_BRITISH_FIELD_UNIFORM
    standHeight: 22
    kneelHeight: 14
    value: 10
    deathSound: [44, 45, 46]
    intelligence: 6
    aggression: 0
    builtInWeaponSets:
        - STR_SMLE_MKIII
        - STR_SMLE_MKIII_CLIP
        - STR_SMLE_MKIII_CLIP
        - STR_WEBLEY_REVOLVER
        - STR_WEBLEY_REVOLVER_CLIP
        - STR_MILLS_BOMB
      -
        - STR_SMLE_MKIII
        - STR_SMLE_MKIII_CLIP
        - STR_SMLE_MKIII_CLIP
        - STR_BANDAGES
        - STR_MILLS_BOMB
        - STR_MILLS_BOMB
      -
        - STR_FARQHUAR_HILL
        - STR_FARQHUAR_HILL_CLIP
        - STR_FARQHUAR_HILL_CLIP
        - STR_MILLS_BOMB
      -
        - STR_FARQHUAR_HILL
        - STR_FARQHUAR_HILL_CLIP
        - STR_FARQHUAR_HILL_CLIP
        - STR_WEBLEY_REVOLVER
        - STR_WEBLEY_REVOLVER_CLIP
        - STR_MILLS_BOMB

The Farqhuar-Hill is an "experimental" rifle that the player needs to investigate to use it, so I want to define its use after a certain time so that the player does not find it in the hands of an NPC at the beginning of the game. A potential solution was this one that I wrote, the experimental rifle would start appearing after the third month:

Code: [Select]
alienItemLevels:
  - [0, 0, 0, 0, 0, 1, 1, 1, 1, 1]
  - [0, 0, 0, 0, 0, 1, 1, 1, 1, 1]
  - [0, 0, 1, 1, 1, 2, 2, 2, 3, 3]

Where do I place the alienItemLevels section? Is there a problem if I put this in the ruleset where I define the allied civilians and their weapons and define another alienItemLevels in another ruleset, along with the alien weapons?

Thanks in advance!
« Last Edit: March 22, 2019, 12:34:11 am by efrenespartano »

Offline Hobbes

  • Commander
  • *****
  • Posts: 2101
  • Infiltration subroutine in progress
    • View Profile
Re: How to apply alienItemLevels to allied soldiers?
« Reply #1 on: March 15, 2019, 03:03:09 am »
You can't assign alienItemLevels to civilians, those are used with the items defined in alienDeployments.rul.

With builtInWeaponSets the game will simply pick a random set of items of those listed to equip the unit (if used it also overrides any sets defined through alienDeployments)


Offline efrenespartano

  • Commander
  • *****
  • Posts: 748
  • I know a lot about the law and other lawyerings.
    • View Profile
Re: How to apply alienItemLevels to allied soldiers?
« Reply #2 on: March 15, 2019, 05:01:02 am »


You can't assign alienItemLevels to civilians, those are used with the items defined in alienDeployments.rul.

With builtInWeaponSets the game will simply pick a random set of items of those listed to equip the unit (if used it also overrides any sets defined through alienDeployments)

Oh! I see.

Well, I think I should made different allied civillians to resemble each weapon Tier.

Thank you so much for the quick answer, Hobbes!

Enviado desde mi Blade A510 mediante Tapatalk


Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11408
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: How to apply alienItemLevels to allied soldiers?
« Reply #3 on: March 15, 2019, 01:32:54 pm »
Item sets do not override alien deployments. Both lists are used.

Offline Hobbes

  • Commander
  • *****
  • Posts: 2101
  • Infiltration subroutine in progress
    • View Profile
Re: How to apply alienItemLevels to allied soldiers?
« Reply #4 on: March 15, 2019, 03:47:02 pm »
Item sets do not override alien deployments. Both lists are used.

On Area 51 I have 3 races (Spacefarer, Phaser and Overlord) that use builtInWeaponSets. They always spawn only with their builtInWeaponSets, even though they use the vanilla alienDeployments that assign plasma weapons to all the non-terror aliens.

This is related to coding logic/sequence: if there are two different lists A and B, the code will first assign weapons according to A, but if  list B is present, then it overrides and uses instead list B.

Otherwise, if both lists were used, then it would either assign both items on list A and B, or it would still have to choose between A or B. Considering that choosing between items on A is dependent on game progression (alienItemLevels) and B chooses completely randomly, you have two different criteria for choosing, and trying to use both is chaos.

I just asked Warboy on Discord to confirm this issue.
« Last Edit: March 15, 2019, 03:56:07 pm by Hobbes »

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11408
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: How to apply alienItemLevels to allied soldiers?
« Reply #5 on: March 16, 2019, 04:35:02 pm »
Hmm, but I clearly saw it happening. However, indeed it shouldn't work for weapons specifically - but generic items are okay.

Offline Hobbes

  • Commander
  • *****
  • Posts: 2101
  • Infiltration subroutine in progress
    • View Profile
Re: How to apply alienItemLevels to allied soldiers?
« Reply #6 on: March 17, 2019, 05:19:37 am »
I was incorrect in my latest post - the 3 races I mentioned use LivingWeapon, not builtItWeapons. But Meridian looked at the code and I'll quote his answer:

Quote
just after quick look, it does:
1/ built in weapons first
2/ livingWeapon OR deployment weapons second
if there are "conflicts", first come first served...

So yeah, like I said builtInWeapons override deployment weapons


Offline efrenespartano

  • Commander
  • *****
  • Posts: 748
  • I know a lot about the law and other lawyerings.
    • View Profile
Re: How to apply alienItemLevels to allied soldiers?
« Reply #7 on: March 22, 2019, 12:33:57 am »
Good to know!

I made a separate allied civilian with upgraded weapons in a different alienDeployment, to simulate the escalation in war and that soldiers receive new weapons as a result of this.

Thank you for helping me with this question, Hobbes & Solarius Scorch!  ;D