OpenXcom Forum

Modding => Help => Topic started by: Keth01 on April 17, 2018, 01:19:22 pm

Title: Limiting access to some armours?
Post by: Keth01 on April 17, 2018, 01:19:22 pm
Hi all,

I'm mulling over having constructable android soldiers in my mod who are recruitable after certain research is unlocked. To balance them and add uniqueness I was thinking of building a lot of their abilities into their armour stats (and thus preventing them from wearing other armour as a balancing strategy).

Is there an elegant way to accomplish this in any of the current builds?
Title: Re: Limiting access to some armours?
Post by: ohartenstein23 on April 17, 2018, 01:54:27 pm
Yes, this is done already in Piratez with many different soldier types and in X-Com Files with dogs and tanks. The most important part is maintaining a list of unit types on each armor that can wear it.
Title: Re: Limiting access to some armours?
Post by: Meridian on April 17, 2018, 02:02:47 pm
Yes, it is available in all current builds.

Just define (for each armor), which soldier types are allowed to use it (attribute "units").

E.g.

Code: [Select]
armors:
  - type: STR_MY_SPECIAL_ARMOR
    units:
      - STR_SOLDIER_TYPE_A
      - STR_SOLDIER_TYPE_B

soldiers:
  - type: STR_SOLDIER_TYPE_A
    requires:
      - STR_TECH_TO_UNLOCK_SOLDER_TYPE_A
Title: Re: Limiting access to some armours?
Post by: Keth01 on April 18, 2018, 07:57:50 am
That's beautifully straightforward. Thanks guys!