Unit Design - Unit Propery sheet - category logical operators

Post Reply
Stratego (dev)
Site Admin
Posts: 9907
Joined: Fri Apr 25, 2014 9:28 pm

Unit Design - Unit Propery sheet - category logical operators

Post by Stratego (dev) » Tue Oct 29, 2019 7:14 am

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:
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.

User avatar
makazuwr32
Posts: 4637
Joined: Tue Oct 17, 2017 9:29 am
Location: Moscow, Russia

Re: Unit Design - Unit Propery sheet - category logical operators

Post by makazuwr32 » Tue Oct 29, 2019 7:53 am

Great!

@Alexander82

Post Reply

Return to “Unit Design”