Modding: Added "non-[filter]" filtering for unit filters

Cleaned up unit filter validations to match actual filters
This commit is contained in:
Yair Morgenstern
2023-11-18 22:16:43 +02:00
parent 2b0568f025
commit dc6413d707
12 changed files with 126 additions and 40 deletions

View File

@ -9,6 +9,18 @@ These are split into two categories:
Note that all of these are case-sensitive!
## General Filter Rules
- All filters accept multiple values in the format: `{A} {B} {C}` etc, meaning "the object must match ALL of these filters"
- For example: `[{Military} {Water}] units`, `[{Wounded} {Armor}] units`, etc.
- No space or other text is allowed between the `[` and the first `{`.
- All filters accept `non-[filter]` as a possible value
- For example: `[non-[Wounded]] units`
- These can be combined by having the values be negative filters
- For example: `[{non-[Wounded]} {Armor}] units`
- These CANNOT be combined in the other way - e.g. `[non-[{Wounded} {Armor}]] units` is NOT valid and will fail to register any units.
- This is because to the player, the text will be `non-Wounded Armor units`, which parses like `[{non-[Wounded]} {Armor}] units`
## civFilter
Allows filtering for specific civs.
@ -46,7 +58,7 @@ The following are allowed to be used:
- Matching [technologyfilter](#technologyfilter) for the tech this unit requires - e.g. `Modern Era`
- Any exact unique the unit has
- Any exact unique the unit type has
- Any combination of the above (will match only if all match). The format is `{filter1} {filter2}` and can match any number of filters. For example: `[{Military} {Water}]` units, `[{non-air} {Armor}]` units, etc. No space or other text is allowed between the `[` and the first `{`.
- Any combination of the above (will match only if all match). The format is `{filter1} {filter2}` and can match any number of filters. For example: `
## mapUnitFilter