SupesSolutions / RWAutoSeller

This Rimworld mod adds the ability to Auto Sell items from the trade window using a set of editable rules.
4 stars 1 forks source link

[Question] Execution order / inherit filters #4

Closed hasezoey closed 5 years ago

hasezoey commented 5 years ago

This is the first time using this mod, i tried some thing i would consider logical:

after some testing i noticed:

and i wanted to ask if "Toggle Negate" is an "NOT" operation

PS: i would like to see a "Apply (AND, OR, XOR) to Filters (in the selected group)" and a "Apply (AND, OR, XOR) to child Groups"

SupesSolutions commented 5 years ago

the 'Include Sub-categories when adding a Category' option itself is actually a global toggle that affects what is added to the selected list during setup, but once items/categories are added, it doesn't affect it any further. It's mostly designed this way as to not mess with existing items in the cat filter since you can add multiple categories or items to it (you might add all weapons and clothes but you might not want hats triggering the rule as well)

Include Subs option also applies to removing (e.g. include subs on, add any weapon, include subs off, remove ranged weapons, and you end up with melee weapons and grenades but without the ranged weapons)

so with Root(OR) -> Weapons(OR, Category: Any Weapons(Include subs)) -> Quality | Hitpoints groups treat everything in the group with the same assigned operator, so it's going cat filter or subgroup, the second rule works because it going cat filter and subgroup. subgroups provide a result for the group to evaluate just as filters do.

consider a hat with 40% health at superior quality

subgroup
---
Quality(poor to normal) = false
Hitpoints(0% to 50%) = true

Quality(false) or Hitpoints(true) = true
category group
---
Category(any weapons, any melee, any ranged) = false

Category (false) or subgroup(true) = true

so the hat triggers the rule.

but your second rule works since Category (false) And subgroup(true) = false

if you wanted to make the second rule even smaller, you could rewrite it as: Root(AND, Category) -> Intermediate(OR, Quality | Hitpoints)

yes Toggle Negate is a NOT operation. it comes from the term logical negation.

For apply operator to filters/apply to child groups, you can get a similar effect using convert filters to subgroups, which will separate the filters from the sub groups, and then changing the existing groups operator. but I think having separate operators for filters and subgroups within the same group would over complicate things for many users.

hasezoey commented 5 years ago

if you wanted to make the second rule even smaller, you could rewrite it as: Root(AND, Category) -> Intermediate(OR, Quality | Hitpoints)

i made the example just smaller, i dont want to have multiple rules that do the "same" thing, so i combine apperal & weapons (& probably everything that i want to sell)


yes Toggle Negate is a NOT operation. it comes from the term logical negation.

thanks, english is not my first language


thanks for answering