New codewords can be used to set AND and NOT operators within category definitions.
cases where you can use:
All place where you fill "unitTypes" definition you can set "categories" and in these you can use this feature.
eg in:
- trnBuilders
- trnModifiers
- trnBonusList
and so on.
"AND(" and ")" : AND codeword makes all categories listed later until ")" codeword treated as inside logical AND brackets, so unit has to have all categories (or not have in case of negations) to be added to proper list.
"NOT" : makes all units in next category excluded from final list, but "NOT" inside AND brackets are treated separately, so categories: ["AND(", "FOOT", "NOT", "MELEE", ")", "MELEE_FOOT"] should have all foot units, but "categories":["FOOT", "NOT", "MELEE", "MELEE_FOOT"] would have no melee foot units.
Example excluding multiple categories from a bigger category
If you want all air units that are not jet planes, not seaplanes than use this form:
{"categories":["AND(", "U_AIR_UNITS", "NOT", "U_JET", "NOT", "U_PLANES_SEAPLANE", "NOT", "U_PLANES_NO_AIRCARRIER", ")"]},
ATTENTION! a category will be evaluated properly ONLY if it has at least one unit assigned to it!
Example:
Affecting living knights, all melee foot and archers, but none of all this can be mechanical:
In json [and(, mounted, melee, not, undead, ), and(, melee, foot, ), archers, not, mechanical]
So normal NOT is global for bonus, but in AND brackets it only excludes within it.
Unit Design - Unit Propery sheet - category logical operators
-
- Site Admin
- Posts: 15754
- Joined: Fri Apr 25, 2014 9:28 pm
- makazuwr32
- Posts: 7835
- Joined: Tue Oct 17, 2017 9:29 am
- Location: Moscow, Russia
Re: Unit Design - Unit Propery sheet - category logical operators
Great!
@Alexander82
@Alexander82
AoF Dev Co-Leadermakazuwr32 wrote: ↑Mon Sep 16, 2019 7:54 amWhen you ask to change something argument why...
Put some numbers, compare to what other races have and so on...
© by Makazuwr32™.
-
- Site Admin
- Posts: 15754
- Joined: Fri Apr 25, 2014 9:28 pm
Re: Unit Design - Unit Propery sheet - category logical operators
ATTENTION! a category will be evaluated properly ONLY if it has at least one unit assigned to it!
Re: Unit Design - Unit Propery sheet - category logical operators
does "trnModifiers" still work?
Re: Unit Design - Unit Propery sheet - category logical operators
No - you must now use trnValidTargets on techs instead.
Support new AoS variant, Age of Galaxy: http://ageofstrategy.net/viewforum.php? ... 608408ebc8
All help will be welcome.
All help will be welcome.
-
- Site Admin
- Posts: 15754
- Joined: Fri Apr 25, 2014 9:28 pm
Re: Unit Design - Unit Propery sheet - category logical operators
new example:
Example excluding multiple categories from a bigger category
If you want all air units that are not jet planes, not seaplanes than use this form:
{"categories":["AND(", "U_AIR_UNITS", "NOT", "U_JET", "NOT", "U_PLANES_SEAPLANE", "NOT", "U_PLANES_NO_AIRCARRIER", ")"]},
Example excluding multiple categories from a bigger category
If you want all air units that are not jet planes, not seaplanes than use this form:
{"categories":["AND(", "U_AIR_UNITS", "NOT", "U_JET", "NOT", "U_PLANES_SEAPLANE", "NOT", "U_PLANES_NO_AIRCARRIER", ")"]},
-
- Site Admin
- Posts: 15754
- Joined: Fri Apr 25, 2014 9:28 pm
Re: Unit Design - Unit Propery sheet - category logical operators
fixed example updated above.