allow = {
NOT = { k_castille_leon = { holder_scope = { is_alive = yes } } }
}
Something like that is what you want (replace k_castille_leon with whatever the title code is if it's not that)
That actually will not work, landed_titles.txt will skip over anything that checks for a landed titles, so all that script will check is NOT = { = { holder_scope = { is_alive = YES}}}, and will end up always preventing you from creating a Kingdom of Castille or Leon even if k_castille_leon exist or not.
The only way to get around it that I know of is through an event that triggers if k_castille_leon exist:
Code:
k_castille = {
color={ 243 209 23 }
color2={ 200 80 10 }
capital = 199 # Burgos
culture = castillan
allow = {
NOT = { has_global_flag = Cas_leon }
}
Code:
character_event = {
id = 99958
desc = "Castille Leon exist"
trigger = {
AI = YES
NOT = { has_global_flag = Cas_leon }
k_castille_leon = { has_holder = yes }
}
mean_time_to_happen = {
days = 1
}
option = {
name = "Add Flag"
set_global_flag = Cas_leon
}
}
character_event = {
id = 99959
desc = "Castille Leon does not exists"
trigger = {
AI = YES
has_global_flag = Cas_leon
k_castille_leon = { has_holder = no }
}
mean_time_to_happen = {
days = 1
}
option = {
name = "Remove flag"
clr_global_flag = Cas_leon
}
}
Also add that flag into Leon too. If someone has all the requirements, the button to create will still be greyed out if someone owns Castille Leon, even though it will show you meet all the requirements. Also this method it may take more then one day for the event to trigger, it can be a few days or a game week before the event triggers(You wont see the event yourself), but it should trigger extremely fast. If the Kingdom is created through a decision, then you can add that flag in the decision as well to make it instant.
Edit: Woops forgot to change the second event to another number.