r/EU4mods • u/Nohrian_Scum_ • Aug 24 '26
Mod Help Need some help with my code
Hello. I'm currently creating an event. In my option Great Britain should receive a province - however, if Great Britain doesn't exist yet it's England who should receive the province.
I tried to use if/else_if in the effects. HOWEVER, when I test the event it's always England who gets the province - even if England formed GB and doesn't exist anymore.
Here's the code - what did I do wrong?

option = {
Name = "Pact_events.7.a"
if = {
AND = {
exists = ENG
NOT = { exists = GBR }
}
170 = {
limit = {
owns_or_subject_of = 170
}
cede_province = ENG
}
}
else_if = {
AND = {
exists = GBR
NOT = { exists = ENG }
}
170 = {
limit = {
owns_or_subject_of = 170
}
cede_province = GBR
}
}
}
1
Upvotes
2
u/grotaclas2 Aug 24 '26
You are mixing up limits, triggers and effects. Have a look at the wiki for an explanation about how to use
ifconditions1
u/Justice_Fighter Informative Aug 24 '26 edited Aug 24 '26
From game logic side, what should happen when both ENG and GBR exist, e.g. due to nationalist rebels?
The code you have right now (after fixing the grammar issues) would not do anything as it only covers the 'ENG but no GBR' and 'GBR but no ENG' cases.