• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

Phi

Lt. General
102 Badges
Jul 10, 2008
1.335
158
  • Stellaris: Distant Stars
  • Hearts of Iron IV: By Blood Alone
  • Battle for Bosporus
  • Cities: Skylines - Campus
  • Europa Universalis IV: Rights of Man
  • Victoria 2
  • Cities: Skylines - Mass Transit
  • Hearts of Iron IV: Death or Dishonor
  • Crusader Kings II: Monks and Mystics
  • 500k Club
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Golden Century
  • Europa Universalis IV: El Dorado
  • Europa Universalis III Complete
  • Crusader Kings II: Way of Life
  • Pillars of Eternity
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Horse Lords
  • Hearts of Iron IV: Expansion Pass
  • Hearts of Iron IV: Cadet
  • Crusader Kings II: Conclave
  • Surviving Mars: First Colony Edition
  • Prison Architect
  • Stellaris Sign-up
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Hearts of Iron IV: La Resistance
  • Stellaris: Lithoids
  • Europa Universalis IV: Rule Britannia
  • Europa Universalis IV: Mandate of Heaven
  • Stellaris: Necroids
  • Crusader Kings III
  • Stellaris: Leviathans Story Pack
  • Imperator: Rome Deluxe Edition
  • Cities: Skylines - Parklife
  • Cities: Skylines - Green Cities
  • Stellaris: Federations
  • Hearts of Iron IV: No Step Back
  • Stellaris: Nemesis
  • Hearts of Iron IV: Together for Victory
  • Surviving Mars
  • Europa Universalis IV
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Humanoids Species Pack
  • Crusader Kings II: Holy Fury
  • Europa Universalis IV: Dharma
  • Cities: Skylines - Natural Disasters
  • Europa Universalis III Complete
  • Imperator: Rome - Magna Graecia
  • Stellaris: Ancient Relics
Perhaps it is not a supported feature, but a bug is still a bug (even though there will be no fix).

The Bug

Let the content of "common/countries.txt" be given as
Code:
ROM="R.txt"
CAR="C.txt"
MAC="M.txt"

Let the content of R.txt be given as
Code:
ai_hard_strategy = {
antagonize = {
  id="CAR"
  value=400
}
antagonize = {
  id="MAC"
  value=200
}
}

Let the content of C.txt be given as
Code:
ai_hard_strategy = {
antagonize = {
  id="ROM"
  value=400
}
befriend = {
  id="MAC"
  value=200
}
}

Let the content of M.txt be given as
Code:
ai_hard_strategy = {
antagonize = {
  id="ROM"
  value=200
}
befriend = {
  id="CAR"
  value=200
}
}

What is now the ai_hard_strategy of ROM, CAR and MAC? You wouldn't assume this:
ROM:
Code:
antagonize = {
  id="---"
  value=400
}
antagonize = {
  id="---"
  value=200
}
CAR:
Code:
antagonize = {
  id="ROM"
  value=400
}
befriend = {
  id="---"
  value=200
}
MAC:
Code:
antagonize = {
  id="ROM"
  value=200
}
befriend = {
  id="CAR"
  value=200
}

Macedonia wants to be a friend of Carthage, but Carthage don't want to be a friend of Macedonia, hence Macedonia gets very sad. :(

What's the problem?

When the program reads the country-definition of ROM, here R.txt, it don't knows about the country tags CAR and MAC, hence it replaces the unknown countries CAR and MAC with the country ---. When the program reads the country-definition of CAR, here C.txt, it don't knows about the country tag MAC, hence it replaces the unknown country MAC with the country ---.

What's a possible solution?

Without knowing any code, I see three options:
1. Read the file "common/countries.txt" twice. The first time to get all country tags, the second time to get the corresponding definitions.
2. Do the checking, if a tag exists, after reading all country definitions.
3. Add the effect "add_ai_strategy" from EU3:IN to EUR:VV. This wouldn't fix the problem but would make an easy work-around possible (and would create more modding options).

I would be glad if Paradox could fix this bug.
 
Last edited:
Upvote 0
Blimey! I knew the engine was naughty, but I hadn't expected this. Anyway, this proves that the engine reads from top to bottom in countries.txt. We could move countries around to make at least some of the AI strategies work (Rome could be at the bottom).
I would like to point out that this isn't a typical bug, though, since it's caused by your own modding. Still, I would like to see this fixed as soon as possible.