I'm making a society power allowing you to build a holding of your choice in any province that has an empty holding slot. The power itself works, but after that test I tried to limit the potential to a province that the player controls, rather than
any province, and I can't seem to do this. Either the power appears on every province still, or it doesn't appear at all. Here's the decision in question:
Code:
god_society_construction = {
is_in_society = yes
from_potential = {
society_rank = {
society = god_society
rank = 1
}
}
potential = {
any_province = {
owned_by = FROMFROM
num_of_empty_holdings > 0
}
}
allow = {
FROM = {
society_currency >= 100 #need 100 society currency, can be anything
trait = divine
}
}
effect = {
# ROOT is a county
capital_scope = {
save_event_target_as = construction_province
}
FROM = { # Decision-taker
character_event = { id = D3.2017 }
change_society_currency = -100
}
}
ai_will_do = {
factor = 0
}
}
The owned_by line is the difficulty. When I first tested the power, that line wasn't in there, and the power works fine, albeit in
every province with an empty slot instead of just those the player controls.
I've tried owned_by = FROM, and FROMFROM, and PREV, but those still makes it constructible in
every province with an empty slot.
I tried doing owned_by = { any_player } and owned_by = { any_playable_ruler = { ai = no } } but the game choked on that, with the Validator saying I can't give owned_by "a complex type".
I also tried doing variations with any_realm_province instead of any_province and in those cases the power doesn't show up in-game at all.
I'm stumped.