I'm working on an event for an operation and I cannot for the life of me figure out why this condition is not working. The operation is supposed to remove a random corporate branch office the target owns from one of your planets. This is only possible if the target is a megacorp and has a branch office on at least one of your planets so every step of the operation I have a guard clause to make sure those things are still true. here's the code:
In my test game I am playing the Minnerian Union and Salorim Cove is my only planet, and it does indeed have a branch office from the Panaxala Cartel on it. The logs show that from.target and branch_office_owner are both the Panaxala Cartel so why is my code jumping to the else statement?
Edit: More Context
Code:
country_event = {
id = expanded_operations.192
hide_window = yes
is_triggered_only = yes
immediate = {
if = {
limit = {
from = {
log = "From Target: [From.Target.GetName]"
log = "Target: [Target.GetName]"
log = "owner: [Owner.GetName]"
target = { is_megacorp = yes }
log = "condition 1 true"
target = { is_galactic_emperor = no }
log = "condition 2 true"
owner = {
any_owned_planet = {
has_branch_office = yes
log = "From Target (inner): [from.target.GetName]"
log = "Root (inner): [root.GetName]"
log = "Root.owner (inner): [root.owner.GetName]"
log = "This (inner): [This.GetName]"
log = "BOO (inner): [branch_office_owner.GetName]"
branch_office_owner = { is_same_value = from.target }
}
}
log = "condition 3 true"
}
}
log = "Stage 3 valid"
# random planet selection and clean operation code
country_event = { id = expanded_operations.193 }
}
else = {
log = "Stage 3 invalid"
country_event = { id = expanded_operations.185 }
}
}
}
Code:
[14:45:35][trigger_impl.cpp:21848]: [2244.7.6] Log command triggered from trigger in file: events/expanded_operations_events.txt line: 1805. From Target: Panaxala Cartel
[14:45:35][trigger_impl.cpp:21848]: [2244.7.6] Log command triggered from trigger in file: events/expanded_operations_events.txt line: 1806. Target: Panaxala Cartel
[14:45:35][trigger_impl.cpp:21848]: [2244.7.6] Log command triggered from trigger in file: events/expanded_operations_events.txt line: 1807. owner: Minnerian Union
[14:45:35][trigger_impl.cpp:21848]: [2244.7.6] Log command triggered from trigger in file: events/expanded_operations_events.txt line: 1809. condition 1 true
[14:45:35][trigger_impl.cpp:21848]: [2244.7.6] Log command triggered from trigger in file: events/expanded_operations_events.txt line: 1811. condition 2 true
[14:45:35][trigger_impl.cpp:21848]: [2244.7.6] Log command triggered from trigger in file: events/expanded_operations_events.txt line: 1815. From Target (inner): Panaxala Cartel
[14:45:35][trigger_impl.cpp:21848]: [2244.7.6] Log command triggered from trigger in file: events/expanded_operations_events.txt line: 1816. Root (inner): Minnerian Union
[14:45:35][trigger_impl.cpp:21848]: [2244.7.6] Log command triggered from trigger in file: events/expanded_operations_events.txt line: 1817. Root.owner (inner): Minnerian Union
[14:45:35][trigger_impl.cpp:21848]: [2244.7.6] Log command triggered from trigger in file: events/expanded_operations_events.txt line: 1818. This (inner): Salorim Cove
[14:45:35][trigger_impl.cpp:21848]: [2244.7.6] Log command triggered from trigger in file: events/expanded_operations_events.txt line: 1819. BOO (inner): Panaxala Cartel
[14:45:35][effect_impl.cpp:19501]: [2244.7.6] Log command triggered from effect in file: events/expanded_operations_events.txt line: 1912. Stage 3 invalid
In my test game I am playing the Minnerian Union and Salorim Cove is my only planet, and it does indeed have a branch office from the Panaxala Cartel on it. The logs show that from.target and branch_office_owner are both the Panaxala Cartel so why is my code jumping to the else statement?
Edit: More Context
Last edited: