• 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.

lenny

Field Marshal
84 Badges
May 4, 2004
2.754
1
  • Mount & Blade: Warband
  • Europa Universalis: Rome
  • Rome Gold
  • Semper Fi
  • Sengoku
  • Victoria 2
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • Rome: Vae Victis
  • 500k Club
  • Crusader Kings II: Holy Knight (pre-order)
  • Europa Universalis IV: El Dorado
  • Europa Universalis IV: Pre-order
  • Europa Universalis IV: Res Publica
  • Crusader Kings II: Way of Life
  • Pillars of Eternity
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Cossacks
  • Crusader Kings II: Conclave
  • Europa Universalis IV: Mare Nostrum
  • Stellaris
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Stellaris Sign-up
  • Stellaris: Necroids
  • Europa Universalis IV: Conquest of Paradise
  • Crusader Kings II
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sword of Islam
  • Europa Universalis III
  • Divine Wind
  • Europa Universalis IV
  • Europa Universalis IV: Art of War
  • Hearts of Iron II: Armageddon
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Call to arms event
  • For the Motherland
  • Hearts of Iron III
  • Hearts of Iron III: Their Finest Hour
  • Hearts of Iron III Collection
  • Heir to the Throne
  • Europa Universalis III Complete
  • Majesty 2
  • Majesty 2 Collection
Inspired by a thread on collapsing AI realm in GD, I tried to script some AI-events to de-throne rulers with bad stats, i.e. madness, schizophrenia, heretic and excommunicated. These are first trials and the only test I performed was to load CK to see if I get an error message at start.

Currently, I have 3 events:
1) A palace revolt against a mad or schizophrenic ruler.
2) A palace revolt against a heretic or excommunicated ruler.
3) A vassal revolt against a heretic or excommunicated ruler.

I use low MTTH because these traits can ruin a Kingdom quite quickly. Also, I am not sure whether the law-change to elective works before the inheritance as I would want it.

Please comment. :)

Event 1:
Code:
##############################################
# Mad ruler ousted by palace revolt	     #
##############################################

character_event = {
	id = 90100
	picture = "event_intrigue"
	name = "He has gone mad. We have to get rid of him!"

	trigger = {
		condition = { type = ai }
		condition = { type = ruler }
		condition = {
			type = or
			condition = { type = trait value = maniac }
			condition = { type = trait value = schizofrenia }
		}
	}

	mean_time_to_happen = {
		months = 12
	}

	immidiate = {
		effect = { type = death }
	}
}

Event 2:
Code:
##############################################
# Heretic ruler ousted by palace revolt	     #
##############################################

character_event = {
	id = 90101
	picture = "event_intrigue"
	name = "God will punish us all if we do not act now!"

	trigger = {
		condition = { type = ai }
		condition = { type = ruler }
		condition = {
			type = or
			condition = { type = trait value = heretic }
			condition = { type = trait value = excommunicated }
		}
	}

	mean_time_to_happen = {
		months = 36

		
		modifier = {
			condition = { type = intrigue value = 1 }
			condition = {
			type = not
			value = {
				type = intrigue
				value = 2
			}
			}
		factor = 0.6
		}
		modifier = {
			condition = { type = intrigue value = 2 }
			condition = {
			type = not
			value = {
				type = intrigue
				value = 3
			}
		}
		factor = 0.7
		}
		modifier = {
			condition = { type = intrigue value = 3 }
			condition = {
			type = not
			value = {
				type = intrigue
				value = 4
			}
		}
		factor = 0.8
		}
		modifier = {
			condition = { type = intrigue value = 4 }
			condition = {
			type = not
			value = {
				type = intrigue
				value = 5
			}
		}
		factor = 0.9
		}
		modifier = {
			condition = { type = intrigue value = 5 }
			condition = {
			type = not
			value = {
				type = intrigue
				value = 6
			}
		}
		factor = 1
		}
		modifier = {
			condition = { type = intrigue value = 6 }
			condition = {
			type = not
			value = {
				type = intrigue
				value = 7
			}
		}
		factor = 1.1
		}
		modifier = {
			condition = { type = intrigue value = 7 }
			condition = {
			type = not
			value = {
				type = intrigue
				value = 8
			}
		}
		factor = 1.2
		}
		modifier = {
			condition = { type = intrigue value = 8 }
			condition = {
			type = not
			value = {
				type = intrigue
				value = 9
			}
		}
		factor = 1.3
		}
		modifier = {
			condition = { type = intrigue value = 9 }
			condition = {
				type = not
				value = {
					type = intrigue
					value = 10
				}
			}
			factor = 1.4
		}
		modifier = {
			condition = { type = intrigue value = 10 }
			factor = 1.5
		}
	}

	immidiate = {
		effect = { type = death }
		effect = { type = death value = random_courtier }
	}
}

Event 3:
Code:
##############################################
# Heretic ruler ousted by vassal revolt	     #
##############################################

character_event = {
	id = 90102
	picture = "event_intrigue"
	name = "The rule of the heretic is unbearable. We have to act know with the church at our side."

	trigger = {
		condition = { type = ai }
		condition = { type = ruler }
		condition = { type = religion value = catholic }
		condition = { type = has_vassal }
		condition = {
			type = or
			condition = { type = trait value = heretic }
			condition = { type = trait value = excommunicated }
		}
	}

	mean_time_to_happen = {
		months = 60
		
		modifier = {
			condition = { type = intrigue value = 1 }
			condition = {
			type = not
			value = {
				type = intrigue
				value = 2
			}
			}
		factor = 0.6
		}
		modifier = {
			condition = { type = intrigue value = 2 }
			condition = {
			type = not
			value = {
				type = intrigue
				value = 3
			}
		}
		factor = 0.7
		}
		modifier = {
			condition = { type = intrigue value = 3 }
			condition = {
			type = not
			value = {
				type = intrigue
				value = 4
			}
		}
		factor = 0.8
		}
		modifier = {
			condition = { type = intrigue value = 4 }
			condition = {
			type = not
			value = {
				type = intrigue
				value = 5
			}
		}
		factor = 0.9
		}
		modifier = {
			condition = { type = intrigue value = 5 }
			condition = {
			type = not
			value = {
				type = intrigue
				value = 6
			}
		}
		factor = 1
		}
		modifier = {
			condition = { type = intrigue value = 6 }
			condition = {
			type = not
			value = {
				type = intrigue
				value = 7
			}
		}
		factor = 1.1
		}
		modifier = {
			condition = { type = intrigue value = 7 }
			condition = {
			type = not
			value = {
				type = intrigue
				value = 8
			}
		}
		factor = 1.2
		}
		modifier = {
			condition = { type = intrigue value = 8 }
			condition = {
			type = not
			value = {
				type = intrigue
				value = 9
			}
		}
		factor = 1.3
		}
		modifier = {
			condition = { type = intrigue value = 9 }
			condition = {
				type = not
				value = {
					type = intrigue
					value = 10
				}
			}
			factor = 1.4
		}
		modifier = {
			condition = { type = intrigue value = 10 }
			factor = 1.5
		}
	}

	immidiate = {
		effect = { type = set_law value = elective_law } 
		effect = { type = death }
		effect = { type = loyalty for = worst_vassal value = 0.25 }
		effect = { type = loyalty for = random_vassal value = 0.1 }
		effect = { type = loyalty for = random_vassal value = -0.1 }
		effect = { type = loyalty for = best_vassal value = -0.25 }
	}
}
 
Very good idea. It should help keeping kingdoms together, without taking the fun of mad rulers away from players. I'll test them next time I play.
 
The events are good, but they need tweaking...
The MTTH should include for the 1st event whether or not the province is in rebellion (more likely), the piety and presitge of the ruler (less likely as it goes up), more likely if its negative, and any_heir = 1 having either of those traits should make it much less likely (yes i know any_XXXX can be resource intensive, but limiting it to 1 shouldn't be that bad and is deifnatly apporpirate.

Also the any_heir = 1 should be used for the other events, but obviously changed for appropriate traits. Also for both the last 2 events the more negative the piety, the more likely. Finally heretic rulers being outsted should be less likely than excommunicated (excommuncation is more severe than being a heretic).
 
Jinnai said:
The events are good, but they need tweaking...
The MTTH should include for the 1st event whether or not the province is in rebellion (more likely), the piety and presitge of the ruler (less likely as it goes up), more likely if its negative, and any_heir = 1 having either of those traits should make it much less likely (yes i know any_XXXX can be resource intensive, but limiting it to 1 shouldn't be that bad and is deifnatly apporpirate.

Also the any_heir = 1 should be used for the other events, but obviously changed for appropriate traits. Also for both the last 2 events the more negative the piety, the more likely. Finally heretic rulers being outsted should be less likely than excommunicated (excommuncation is more severe than being a heretic).
Thanks for the feedback. I will try to incorporate some of these suggestions, soon.