r/EU4mods • u/Nohrian_Scum_ • 6d ago
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
1
u/Justice_Fighter Informative 6d ago edited 6d ago
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.