OpenXcom Forum

OpenXcom Forks => OpenXcom Extended (OXCE) => OXCE Suggestions DONE => Topic started by: Yankes on May 16, 2020, 08:02:23 pm

Title: [DONE] Added more options how collections can be overridden
Post by: Yankes on May 16, 2020, 08:02:23 pm
I added new functionality to OXCE nightly:

For many list like `requires` or `requiresBuy` you can use new syntax like:

Base mod:
Code: [Select]
items:
  - type: STR_PISTOL
    requiresBuy:
      - STR_X
      - STR_Y
  - type: STR_PSI_AMP
    requires:
      - STR_X
      - STR_Y

Another mod:
Code: [Select]
items:
  - type: STR_PISTOL
    requiresBuy: !add
      - STR_Z
  - type: STR_PSI_AMP
    requires: !remove
      - STR_Y
Now `STR_PISTOL` need have additionally need `STR_Z` AND `STR_X`, `STR_Y` to buy
But `STR_PSI_AMP` need only `STR_X` from research.

With this you can easier add or remove some positions from list without know full lists.
This reduce many cases where mods extension could easy break by small change in main mod.

For now only two `!add` and `!remove`  basic operations are supported but in future it will be more complex too available (like `!replace`).

As some list have very strick order I could not add for now way to override them but in future depending on demand I could add ways to override them too.
Title: Re: Added more options how collections can be overridden
Post by: Yankes on June 13, 2020, 02:05:09 am
I pushed another expansion of `!add` tags to rule files, added too special  tag `!info` to check what is supported.

Code: [Select]
sometype:
  - type: X
    property: !info
      - A

This will give in logs line like:
Code: [Select]
Options aviable for X at line 3 are: !!seq !add !remove
Title: Re: [DONE] Added more options how collections can be overridden
Post by: Meridian on March 29, 2023, 11:21:39 am
extracted into a separate thread