Are you 100% sure that the title isn't automatically revoked whenBack for some more insight... This seems simple and I checked the archives... but I can't figure it out, so here I am
When modding minor-titles how to add a parameter for the recipient to resign when they meet a certain criteria?... It seems that "allowed_to_hold" only checks the requirements 'before' the title is gained and doesn't actively remove holders that technically no longer meet the requirements....
so for example...
Code:title_ladyinwaiting = { #<---Title = "Lady" intended to give bonuses to "unmarried" women potentially allowing for bettor suitors or proposals... dignity = 0.05 realm_in_name = yes grant_limit = 3 opinion_effect = 5 show_as_title = yes monthly_salary = 0.5 monthly_prestige = 0.5 is_unique = no allowed_to_hold = { is_adult = yes is_female = yes is_married = no #<----how to have this character automatically resign the minor-title when they become married? religion_group = christian #<----If this ^^ isnt possible, how to resign them without an opinion malice "revoked my honorary title -20" ...}
allowed_to_hold
evaluates to false? (Eg: When the lady in waiting gets married.)Because the documentation for
lose_effect
strongly implies that it should work that way: "lose_effect ... Fires when a title is lost if allowed_to_hold evaluates to false".Bear in mind that you may need to wait a few days (maybe even a month or two) for the criteria to be automatically evaluated.
Also, have you run your code through the Validator and checked the error log, to ensure that you haven't made any syntax errors? (You haven't posted the full code so we can't see for ourselves.) CK2's scripting engine can sometimes behave oddly if there are syntax errors, and it's possible that syntax errors might stop it from properly evaluating your
allowed_to_hold
clause.---
If all other options are exhausted, you could write an event that only fires for ladies-in-waiting, which fires them if they no longer fit the criteria. Set it to trigger in all relevant on_actions, for example: on_yearly_pulse, on_marriage, on_become_imprisoned_any_reason, on_forced_consort, on_character_convert_religion, on_character_convert_secret_religion. This is the least-preferred option because it's probably going to be expensive in terms of performance.
---
Finally, if the community agrees that
allowed_to_hold
doesn't work in the way implied by the wiki documentation (ie. that title holders don't get booted if allowed_to_hold
evaluates to false), then that documentation probably needs to be updated.- 1