I am attempting to create a Decision that checks if the character taking the decision is in a war as a defender. Or more specifically, that they are NOT an attacker in any war they are currently a part of. Here's what I have so far:
defend_realm_decision = {
picture = "gfx/interface/illustrations/decisions/decision_invite_knights.dds"
desc = defend_realm_decision_desc
selection_tooltip = defend_realm_decision_tooltip
cooldown = { days = 1800 }
is_shown = {
is_landed = yes
exists = dynasty
dynasty = {
has_dynasty_perk = valiance_legacy_5
}
}
is_valid_showing_failures_only = {
is_available_adult = yes
}
is_valid = {
exists = dynasty
dynasty = {
has_dynasty_perk = valiance_legacy_5
}
}
cost = {
prestige = invite_claimants_decision_prestige_value
piety = {
value = holy_order_piety_cost
}
}
effect = {
show_as_tooltip = {
defend_realm_decision_outcome_tt = yes
}
custom_tooltip = defend_realm_decision_outcome_tt
hidden_effect = {
trigger_event = {
on_action = defend_realm_events
days = 3
}
}
}
ai_check_interval = 120
ai_potential = {
always = yes
}
ai_will_do = {
base = 100
}
}
What can I add that will ensure that it is only a valid decision if they're in a war, and ONLY as a defender?
defend_realm_decision = {
picture = "gfx/interface/illustrations/decisions/decision_invite_knights.dds"
desc = defend_realm_decision_desc
selection_tooltip = defend_realm_decision_tooltip
cooldown = { days = 1800 }
is_shown = {
is_landed = yes
exists = dynasty
dynasty = {
has_dynasty_perk = valiance_legacy_5
}
}
is_valid_showing_failures_only = {
is_available_adult = yes
}
is_valid = {
exists = dynasty
dynasty = {
has_dynasty_perk = valiance_legacy_5
}
}
cost = {
prestige = invite_claimants_decision_prestige_value
piety = {
value = holy_order_piety_cost
}
}
effect = {
show_as_tooltip = {
defend_realm_decision_outcome_tt = yes
}
custom_tooltip = defend_realm_decision_outcome_tt
hidden_effect = {
trigger_event = {
on_action = defend_realm_events
days = 3
}
}
}
ai_check_interval = 120
ai_potential = {
always = yes
}
ai_will_do = {
base = 100
}
}
What can I add that will ensure that it is only a valid decision if they're in a war, and ONLY as a defender?