unmerged(47151)

Colonel
Aug 4, 2005
1.019
0
Code:
province_event = { # Peasants take power ending revolt
	id = 40109

	picture = "event_prosperity"

	trigger = {
		condition = { type = has_province_effect value = { revolt = yes } }
		condition = { type = not value = type = peasant_loyalty value = 0.5 }
		condition = { type = owner
			condition = { type = trait value = user_defined_b }
			condition = { type = trait value = merciful }
			condition = { type = has_law value = { royal_preorgatory_law = yes } }
			condition = { type = has_law value = { elective_law = yes } }
		}
	}

	mean_time_to_happen = {
		months = 1

	}

	action_a = { # Mild Reforms
		ai_chance = 25
		effect = { type = remove_province_effect value = revolt }
		effect = { type = peasant_loyalty value = 0.2 }
		effect = { type = peasant_power value = 0.1 }
		effect = { type = owner
			effect = { type = add_trait value = wise }
			effect = { type = add_trait value = forgiving }
		}
	}

	action_b = { # Radical Reforms
		ai_chance = 50
		effect = { type = remove_province_effect value = revolt }
		effect = { type = peasant_loyalty value = 0.4 }
		effect = { type = peasant_power value = 0.2 }
		effect = { type = owner
			effect = { type = add_trait value = just }
			effect = { type = add_trait value = vengeful }
		}
	}

	action_c = { # Social Revolution
		ai_chance = 20
		effect = { type = remove_province_effect value = revolt }
		effect = { type = peasant_loyalty value = 0.4 }
		effect = { type = peasant_power value = 0.2 }
		effect = { type = owner
			effect = { type = add_trait value = reckless }
			effect = { type = add_trait value = vengeful }
		}
	}

	action_d = { # Crush Them!
		ai_chance = 5
		effect = { type = peasant_loyalty value = -0.4 }
		effect = { type = owner
			effect = { type = add_trait value = cruel }
			effect = { type = add_trait value = deceitful }
		}
	}
}

As part of my recent crash-course in error management I've run into a problem with the effects for this event. I'm trying to use a province event to add traits to it's owner; am I to take it that this is actually impossible? Or am I just not doing it correctly?
 

performer

Colonel
74 Badges
Aug 26, 2006
943
31
  • Stellaris: Galaxy Edition
  • Warlock 2: The Exiled
  • 500k Club
  • Crusader Kings II: Holy Knight (pre-order)
  • Europa Universalis IV: El Dorado
  • Mount & Blade: Warband
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Cossacks
  • Crusader Kings II: Conclave
  • Europa Universalis IV: Mare Nostrum
  • Stellaris
  • Warlock: Master of the Arcane
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Rights of Man
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Crusader Kings II: Monks and Mystics
  • Stellaris - Path to Destruction bundle
  • Europa Universalis IV: Mandate of Heaven
  • Europa Universalis IV: Third Rome
  • Stellaris: Synthetic Dawn
  • Stellaris: Necroids
  • Europa Universalis IV: Conquest of Paradise
  • 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: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Deus Vult
  • Europa Universalis III
  • Europa Universalis IV
  • Europa Universalis IV: Art of War
  • Crusader Kings II
  • Europa Universalis IV: Wealth of Nations
  • For The Glory
  • King Arthur II
  • Magicka
  • March of the Eagles
  • Naval War: Arctic Circle
  • Europa Universalis IV: Res Publica
  • Rome Gold
  • Sengoku
  • Victoria 2
You have to use a "workaround". Rewrite the event as a character event and use a decent prov trigger:

charevent = xxxx
trigger = {
condition = { type = any_demesne_province
condition = { type = has_province_effect value = { revolt = yes } }
}
action_a = {
effect = { type = add_trait value = wise }
}
}