Does a filter influence whether a decision appears or not? I have a third_party_decision which normally works. I want the ai to be able to use it and have added some filters. The decision now does not show up most of the time but sporadically is present but greyed out. It then indicates that the conditions on the third_party are not met but I haven't changed those and the character meets the conditions. Since I only changed the filters I suppose the problem is there, but I don't understand why. Can somebody explain to me how filters work (especially the ai_target_filter) ?
Filters are applied before the decision is parsed. They're basically a quick step to minimize CPU load by filtering out as many characters as possible as quickly as possible. They are however very blunt and are only designed to catch all characters of a certain class, eg courtiers, players, rulers etc.
For more fine grained filtering there is a block in each decision called the from_potential block. Inside here are all sorts of very specific filters, things like whether or not the target has a certain trait, age, minimum (or maximum) amount of gold or a certain attribute. If the target character, title or whatever does not meet these criteria then, like elements filtered out via a filter, the decision simply won't show up at all.
Finally comes the allow block. Inside here are even more filters, but of the same type as the from_potential block. The difference here is that if the target does not have the relevant requirement then the decision will show up but it will be greyed out. This can be useful if you want the player to know that they could do something but only if they changed their circumstances in some way. An example might be requiring a minimum wealth level, the player will see that they need to meet the required minimum amount and if they saved their money then they will eventually be able to carry out the decision.
All of the above can be manually edited or effectively overwritten via a mod.