I don't see anything obviously wrong with your code, but I'd suggest running it through the Validator if you haven't already.so i have a question. What would you do in an event in order to write an event that will effectively make tribal vassals have two choices under their liege upon their liege death under elective Gavelkind:
First option will be the "Stay a vassal" option which will effectively do nothing and just have the vassal remain a vassal of their liege.
Second option: Will be the independent option which will make the vassal independent of their liege.
i got it working (sort of) when i tried to apply a similar code to the On-death on action event code written more in line for the player instead of the AI making the decision.
but i can't seem to get it working for the On-action on_elective_gavelkind_succession = { } onaction event.
i'm trying to base it off the other events in the game files which does exactly that but for Vassal limit calculations or even the other one which does it for the junior heir in the elective gavelkind succession upon the ruler's death.
#Regular Tribal Vassals can declare independence upon succession of the ruler. character_event = { id = EGS.100 desc = EVTDESC_EGS100 picture = GFX_evt_throne_room border = GFX_event_normal_frame_intrigue is_triggered_only = yes trigger = { top_liege = { OR = { tier = DUKE tier = KING tier = EMPEROR } OR = { has_law = tribal_organization_0 has_law = tribal_organization_1 } has_law = succ_elective_gavelkind is_tribal = yes } is_tribal = yes } immediate = { sound_effect = pagan_reformation } option = { name = EVTOPTB_EGS100 ai_chance = { factor = 100 modifier = { factor = 2 opinion = { who = FROM value = 25 } } modifier = { factor = 2 opinion = { who = FROM value = 50 } } modifier = { factor = 4 trait = content } } } option = { name = EVTOPTA_EGS100 ai_chance = { factor = 100 modifier = { factor = 2 NOT = { opinion = { who = FROM value = -25 } } } modifier = { factor = 2 NOT = { opinion = { who = FROM value = -50 } } } modifier = { factor = 4 trait = ambitious } } set_defacto_liege = THIS } }
Reading the entry for
on_elective_gavelkind_succession
in the Event modding page on the wiki seems to imply that it only fires for secondary heirs, not for all vassals. If that's the case, then you'll want to use another on_action trigger, such as on_death
(but with more limits to the trigger to narrow it down to the proper succession type you want it to fire for).Not related to your question, but you can reduce your code for the top_liege's tier limit by using
higher_real_tier_than = COUNT
- 1