• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

unmerged(287474)

Captain
2 Badges
Mar 19, 2011
389
0
  • Crusader Kings II
  • Victoria 2: A House Divided
So I'm trying to make a mod where a council member with stats over 13 count towards their effectiveness if their liege is the player character, and different values based on if the player character is a count, duke, king, or emperor.

Well, all council members are ai = yes, even the player character's council. So its really more about the council member's liege, when a job is being performed, is the council member's liege 'ai = no'.

I do not know how to write this. :(

Also if anyone has any documentation for how CKII's scripting language works PLEASE share it w/ me. I'm trying things based on assumptions I'm making from reading paradox's code, which is very confusing compared to any other language.
 
try
Code:
limit = {
    root = { ai = no }
    //do something
}
or
Code:
if =
    root = { ai = no }
    //do something
}
I have to see your event for better help.
Thanks overlord, I think that might work depending on the scope, but I got this to work as well!
Code:
modifier = {
			factor = 0.80
			AND = {
				diplomacy = 14 # the chancellor's diplomacy is at least 14
				liege = { ai = no } # the chancellor's liege is the player character
				liege = { tier = emperor } #the chancellor's liege is an emperor
			}
		}
		modifier = {
			factor = 0.70
			AND = {
				diplomacy = 14
				liege = { ai = no }
				liege = { tier = king }
			}
		}
		modifier = {
			factor = 0.60
			AND = {
				diplomacy = 14
				liege = { ai = no }
				liege = { tier = duke }
			}
		}
		modifier = {
			factor = 0.50
			AND = {
				diplomacy = 14
				liege = { ai = no }
				liege = { tier = count }
			}
		}
I think I read somewhere that ROOT is the target of the action, in this case it wouldn't be the player, because (this chancellor job) targets another county/duchy that doesn't like me.
The ai this fires off of is the chancellor, and if I understand it correctly any council member is always the vassal/courtier of the owner of the council.

So the player character's council members are always his vassals, and so their liege is always the player character. And this wouldn't be the case for computer ai's, so these modifier factors will only apply to the player characters whom's chancellor's diplomacy is 14 or greater.
 
Last edited: