Unit Design - Unit Propery sheet - category logical operators

Post Reply
Stratego (dev)
Site Admin
Posts: 13113
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.

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.

User avatar
makazuwr32
Posts: 7092
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
makazuwr32 wrote:
Mon Sep 16, 2019 7:54 am
When you ask to change something argument why...
Put some numbers, compare to what other races have and so on...
© by Makazuwr32™.
AoF Dev Co-Leader

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

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

Post by Stratego (dev) » Sun Oct 24, 2021 10:18 pm

ATTENTION! a category will be evaluated properly ONLY if it has at least one unit assigned to it!

User avatar
L4cus
Posts: 2134
Joined: Fri Jan 31, 2020 7:51 pm
Location: Perú

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

Post by L4cus » Fri Nov 26, 2021 4:51 pm

does "trnModifiers" still work?
Extra ecclesiam nulla salus...
AOD, a new variant...
viewforum.php?f=230

Midonik
Posts: 4854
Joined: Mon Sep 05, 2016 5:27 pm
Location: Poland

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

Post by Midonik » Fri Nov 26, 2021 5:00 pm

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.

User avatar
L4cus
Posts: 2134
Joined: Fri Jan 31, 2020 7:51 pm
Location: Perú

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

Post by L4cus » Fri Nov 26, 2021 7:37 pm

good
Extra ecclesiam nulla salus...
AOD, a new variant...
viewforum.php?f=230

Post Reply

Return to “Unit Design”