i am trying to write my own little mod for ck2. I may advance slowly, but i start to learn how things work thanks to the modding wiki.
However I do not really understand how factors work. I mostly need factors for 'ai_will_do', but i couldn't figure out how different numbes change this.
Let's say there is a targetted_decision to steal money from your liege if you are steward.
I know that 1 = 100% chance every month for each allowed target, so if i write
Code:
ai_will_do = {
factor = 1
[...]
it would mean that every steward will steal at least once (or exactly once?)per month money from his liege .
Now lets change the factor to 0.1, so there is a 10% chance for the ai to steal money from their liege, but the chance will increase if the ai is greedy or hates their liege.
Code:
modifier = {
factor = 0.5
FROM = {
trait = greedy
}
}
Does this change the factor now (so instead of 0.1 the chance is now 0.5), does it add to the base factor (so instead of 0.1 the chance is now 0.6) or does it mulitply with the base factor (so instead of 0.1 the chance would now be 0.05)?
Same question if more than one modifier applies. (so +0.5 from greedy and +0.5 from hate)
And what if i want to lower the chance if the steward has the trait 'just'
Do i have to add a negative factor ? Do i have to add a factor lower than the base factor?
Now I've seen this in way_of_life_decisions.txt for seduction
Code:
ai_will_do = {
factor = 1 # 1 = 100% chance every month (for each allowed target!)
modifier = {
factor = 0.05
}
[...]
what is the modifier for?
It doesn't have any requirements, so why not just set the base factor to 0.05? Isn't that just redundant?