Code:
allow = {
conditional_tooltip = {
trigger = {
k_antioch = {
is_titular = yes
}
}
k_antioch = {
is_titular = no
}
}
hidden_tooltip = {
OR = {
ai = no
religion = catholic
}
}
I'm interested in the hidden tooltip bit.
Does it means that the AI will never do it (create k_antioch) and only a player could, or does it mean that it will only create it if it is catholic?
I'm trying to remove the restrictions on the AI, but I'm not sure if replacing all ai = no instances by always = yes will do the job or if the always = yes will always return the OR part as positive no matter what the other conditions are.
The "OR" clause will evaluate to true if at least one condition is true - so it is possible if the character is a player (because then "ai = no" is true), or if they are catholic (because then "religion = catholic" is true).
So a catholic AI can do it.
"always = yes", however, will
always evaluate to true. So if you put it in there, the OR clause will evaluate to true all the time. Which might not be what you want in some cases.
In your example, however, the player is always able to do it. So if you want the AI to get the same conditions as the player, you could indeed just remove the whole OR clause and just put "always = yes" there.
In other cases where the OR clause checks for more elaborate combinations, just replacing the "ai = no" with "always = yes" might break the intended behaviour.
Code:
NAND = {
ai = no # replacing this with "always = yes" will always yield a negative result for jain characters, even for the player!
religion = jain
}
In this example, the clause evaluates true only if the character is
not both an AI and Jain. However, if you replace "ai = no" with "always = yes", then it will evaluate to true if the character is
not Jain.
So when at first a Jain player could still create the title, in the replaced script not even a Jain player would be able to create it. It would be completely forbidden for Jain characters, which wouldn't be what you intended. Instead, to remove the restrictions of the AI compared to the player, you would have to remove simply the entire clause.
I am aware that last example is a bit constructed and probably does not make sense for a title anyway. But it still shows that you need to watch out for weird situations where you can't just replace things, but may need to understand the code and which result you want to have.