• 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(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?
 
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 }
}
}