AI 'handicap' on border forts goes too far.

  • 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.

DanubianCossak

DaputinCozzak Specyal Snowflake
34 Badges
Nov 16, 2009
12.412
3.646
  • Crusader Kings II
  • Europa Universalis IV: Pre-order
  • Europa Universalis IV: Third Rome
  • Europa Universalis IV: Res Publica
  • Heir to the Throne
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Art of War
  • Cities in Motion
  • Divine Wind
  • Europa Universalis III Complete
  • Darkest Hour
  • Hearts of Iron IV: Expansion Pass
  • Europa Universalis IV: Mandate of Heaven
  • Hearts of Iron IV: Death or Dishonor
  • Europa Universalis IV: Rights of Man
  • Age of Wonders III
  • Europa Universalis IV: Cradle of Civilization
  • Hearts of Iron IV: Expansion Pass
  • Europa Universalis IV: Rule Britannia
  • Europa Universalis IV: Dharma
  • Europa Universalis IV: Golden Century
  • Hearts of Iron IV: Field Marshal
  • Hearts of Iron IV: Colonel
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV Sign-up
  • Europa Universalis IV: Mare Nostrum
  • Europa Universalis IV: Cossacks
  • Europa Universalis IV: Common Sense
  • Europa Universalis IV: El Dorado
  • 500k Club
  • Europa Universalis III Complete
  • Europa Universalis III Complete
  • Europa Universalis IV
Hey thanks for the feedback!

All of the base factors were adjusted in my mod because the game does wonky things with fractional factor, and I found it to perform better when there is a larger integer spread between buildings. So they are all still balanced against each other, just with a higher initial value.

AFAIK most of the coding requires you to do that sort of nonsense like "Not = { is_capital = yes }", and I don't know why. I just used the modding subforums list of scopes/triggers etc, and saw things like this:

Are you sure this:

Code:
       modifier = {
            factor = 1.05
            allowed_num_of_buildings = 4
        }

is proper code?

Ive never seen this used before and its not on the list of triggers in that modding section thread.

(just thinking out loud maybe this is causing the error you got)
 

Arumba

Colonel
75 Badges
Mar 10, 2012
804
1.074
  • Crusader Kings II
  • Warlock 2: The Exiled
  • Victoria 2: A House Divided
  • Majesty 2 Collection
  • Magicka
  • Divine Wind
  • Europa Universalis III Complete
  • Crusader Kings II: Way of Life
  • Imperator: Rome - Magna Graecia
  • Victoria 2
  • Crusader Kings II: Holy Fury
  • Europa Universalis IV: Third Rome
  • Warlock: Master of the Arcane
  • 500k Club
  • Crusader Kings III
  • Europa Universalis IV: El Dorado
  • Prison Architect
  • Age of Wonders III
  • Pillars of Eternity
  • Stellaris: Distant Stars
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Horse Lords
  • Cities: Skylines - Mass Transit
  • Crusader Kings II: Conclave
  • Europa Universalis 4: Emperor
  • Tyranny: Archon Edition
  • Hearts of Iron IV: Cadet
  • Europa Universalis IV: Golden Century
  • Hearts of Iron IV: Expansion Pass
  • Surviving Mars
  • BATTLETECH - Digital Deluxe Edition
  • Hearts of Iron IV: Death or Dishonor
  • Europa Universalis IV
  • Crusader Kings II: Jade Dragon
  • BATTLETECH
  • Europa Universalis III Complete
  • Battle for Bosporus
  • Age of Wonders: Planetfall
  • Europa Universalis IV: Dharma
  • Stellaris: Apocalypse
  • Europa Universalis III Complete
  • Hearts of Iron IV: Expansion Pass
  • Ancient Space
  • Heir to the Throne
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Old Gods
  • Europa Universalis IV: Cossacks
  • Cities: Skylines - Snowfall
  • Europa Universalis III
  • March of the Eagles
Are you sure this:

Code:
       modifier = {
            factor = 1.05
            allowed_num_of_buildings = 4
        }

is proper code?

Ive never seen this used before and its not on the list of triggers in that modding section thread.

(just thinking out loud maybe this is causing the error you got)

Hmm, maybe. It's in there, but its in the modifier section not in the trigger section. Perhaps that's whats causing the problem. Will test.
I believe this is what is used by the university to increase the number of slots available, so its possible I'm using it wrong.
 

Praetorian44

Field Marshal
98 Badges
Dec 14, 2009
4.785
1.941
  • Hearts of Iron IV: Expansion Pass
  • Hearts of Iron IV: No Step Back
  • Stellaris: Necroids
  • Europa Universalis 4: Emperor
  • Stellaris: Nemesis
  • Stellaris: Lithoids
  • Surviving Mars: Digital Deluxe Edition
  • Battle for Bosporus
  • Hearts of Iron IV: By Blood Alone
  • Victoria 3 Sign Up
  • Crusader Kings III
  • Europa Universalis IV: Golden Century
  • Stellaris: Federations
  • 500k Club
  • Europa Universalis IV
  • Europa Universalis III: Chronicles
  • Hearts of Iron III
  • Victoria 2
  • Rome Gold
  • Europa Universalis IV: Call to arms event
  • Europa Universalis IV: Pre-order
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Res Publica
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: El Dorado
  • Europa Universalis IV: Common Sense
  • Europa Universalis IV: Cossacks
  • Europa Universalis IV: Rights of Man
  • Europa Universalis IV: Mandate of Heaven
  • Europa Universalis IV: Third Rome
  • Europa Universalis IV: Cradle of Civilization
  • Europa Universalis IV: Rule Britannia
  • Europa Universalis IV: Dharma
  • Crusader Kings II
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Republic
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Way of Life
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Conclave
  • Crusader Kings II: Reapers Due
  • Crusader Kings II: Monks and Mystics
  • Crusader Kings II: Jade Dragon
  • Crusader Kings II: Holy Fury
  • Hearts of Iron IV Sign-up
  • Hearts of Iron IV: Colonel
Hmm, maybe. It's in there, but its in the modifier section not in the trigger section. Perhaps that's whats causing the problem. Will test.
I believe this is what is used by the university to increase the number of slots available, so its possible I'm using it wrong.
Correct, it is a modifier and not a trigger. You're looking for the following trigger
num_free_building_slots = 1
 

DanubianCossak

DaputinCozzak Specyal Snowflake
34 Badges
Nov 16, 2009
12.412
3.646
  • Crusader Kings II
  • Europa Universalis IV: Pre-order
  • Europa Universalis IV: Third Rome
  • Europa Universalis IV: Res Publica
  • Heir to the Throne
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Art of War
  • Cities in Motion
  • Divine Wind
  • Europa Universalis III Complete
  • Darkest Hour
  • Hearts of Iron IV: Expansion Pass
  • Europa Universalis IV: Mandate of Heaven
  • Hearts of Iron IV: Death or Dishonor
  • Europa Universalis IV: Rights of Man
  • Age of Wonders III
  • Europa Universalis IV: Cradle of Civilization
  • Hearts of Iron IV: Expansion Pass
  • Europa Universalis IV: Rule Britannia
  • Europa Universalis IV: Dharma
  • Europa Universalis IV: Golden Century
  • Hearts of Iron IV: Field Marshal
  • Hearts of Iron IV: Colonel
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV Sign-up
  • Europa Universalis IV: Mare Nostrum
  • Europa Universalis IV: Cossacks
  • Europa Universalis IV: Common Sense
  • Europa Universalis IV: El Dorado
  • 500k Club
  • Europa Universalis III Complete
  • Europa Universalis III Complete
  • Europa Universalis IV
Hmm, maybe. It's in there, but its in the modifier section not in the trigger section. Perhaps that's whats causing the problem. Will test.
I believe this is what is used by the university to increase the number of slots available, so its possible I'm using it wrong.

Yeah ive spent unjohanly amount of time coding stuff over the years, and this just popped up when you said something was crashing :p Maybe its not it, but still, looks like bad code to me.
 

DanubianCossak

DaputinCozzak Specyal Snowflake
34 Badges
Nov 16, 2009
12.412
3.646
  • Crusader Kings II
  • Europa Universalis IV: Pre-order
  • Europa Universalis IV: Third Rome
  • Europa Universalis IV: Res Publica
  • Heir to the Throne
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Art of War
  • Cities in Motion
  • Divine Wind
  • Europa Universalis III Complete
  • Darkest Hour
  • Hearts of Iron IV: Expansion Pass
  • Europa Universalis IV: Mandate of Heaven
  • Hearts of Iron IV: Death or Dishonor
  • Europa Universalis IV: Rights of Man
  • Age of Wonders III
  • Europa Universalis IV: Cradle of Civilization
  • Hearts of Iron IV: Expansion Pass
  • Europa Universalis IV: Rule Britannia
  • Europa Universalis IV: Dharma
  • Europa Universalis IV: Golden Century
  • Hearts of Iron IV: Field Marshal
  • Hearts of Iron IV: Colonel
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV Sign-up
  • Europa Universalis IV: Mare Nostrum
  • Europa Universalis IV: Cossacks
  • Europa Universalis IV: Common Sense
  • Europa Universalis IV: El Dorado
  • 500k Club
  • Europa Universalis III Complete
  • Europa Universalis III Complete
  • Europa Universalis IV

Arumba

Colonel
75 Badges
Mar 10, 2012
804
1.074
  • Crusader Kings II
  • Warlock 2: The Exiled
  • Victoria 2: A House Divided
  • Majesty 2 Collection
  • Magicka
  • Divine Wind
  • Europa Universalis III Complete
  • Crusader Kings II: Way of Life
  • Imperator: Rome - Magna Graecia
  • Victoria 2
  • Crusader Kings II: Holy Fury
  • Europa Universalis IV: Third Rome
  • Warlock: Master of the Arcane
  • 500k Club
  • Crusader Kings III
  • Europa Universalis IV: El Dorado
  • Prison Architect
  • Age of Wonders III
  • Pillars of Eternity
  • Stellaris: Distant Stars
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Horse Lords
  • Cities: Skylines - Mass Transit
  • Crusader Kings II: Conclave
  • Europa Universalis 4: Emperor
  • Tyranny: Archon Edition
  • Hearts of Iron IV: Cadet
  • Europa Universalis IV: Golden Century
  • Hearts of Iron IV: Expansion Pass
  • Surviving Mars
  • BATTLETECH - Digital Deluxe Edition
  • Hearts of Iron IV: Death or Dishonor
  • Europa Universalis IV
  • Crusader Kings II: Jade Dragon
  • BATTLETECH
  • Europa Universalis III Complete
  • Battle for Bosporus
  • Age of Wonders: Planetfall
  • Europa Universalis IV: Dharma
  • Stellaris: Apocalypse
  • Europa Universalis III Complete
  • Hearts of Iron IV: Expansion Pass
  • Ancient Space
  • Heir to the Throne
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Old Gods
  • Europa Universalis IV: Cossacks
  • Cities: Skylines - Snowfall
  • Europa Universalis III
  • March of the Eagles
This is my working file, I have a backup that functions before I made some recent changes, so I'll try to compare it to that one for now. Can you link me to a functional eu4 validator? I can't seem to find one. The one that shows up on google is for eu3 and ck2.
 

Attachments

  • 00_buildings.txt
    41,7 KB · Views: 34

Arumba

Colonel
75 Badges
Mar 10, 2012
804
1.074
  • Crusader Kings II
  • Warlock 2: The Exiled
  • Victoria 2: A House Divided
  • Majesty 2 Collection
  • Magicka
  • Divine Wind
  • Europa Universalis III Complete
  • Crusader Kings II: Way of Life
  • Imperator: Rome - Magna Graecia
  • Victoria 2
  • Crusader Kings II: Holy Fury
  • Europa Universalis IV: Third Rome
  • Warlock: Master of the Arcane
  • 500k Club
  • Crusader Kings III
  • Europa Universalis IV: El Dorado
  • Prison Architect
  • Age of Wonders III
  • Pillars of Eternity
  • Stellaris: Distant Stars
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Horse Lords
  • Cities: Skylines - Mass Transit
  • Crusader Kings II: Conclave
  • Europa Universalis 4: Emperor
  • Tyranny: Archon Edition
  • Hearts of Iron IV: Cadet
  • Europa Universalis IV: Golden Century
  • Hearts of Iron IV: Expansion Pass
  • Surviving Mars
  • BATTLETECH - Digital Deluxe Edition
  • Hearts of Iron IV: Death or Dishonor
  • Europa Universalis IV
  • Crusader Kings II: Jade Dragon
  • BATTLETECH
  • Europa Universalis III Complete
  • Battle for Bosporus
  • Age of Wonders: Planetfall
  • Europa Universalis IV: Dharma
  • Stellaris: Apocalypse
  • Europa Universalis III Complete
  • Hearts of Iron IV: Expansion Pass
  • Ancient Space
  • Heir to the Throne
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Old Gods
  • Europa Universalis IV: Cossacks
  • Cities: Skylines - Snowfall
  • Europa Universalis III
  • March of the Eagles
Well this is what happens when I obsess over a problem for ~12 hours in the past 24. I somewhere along the line started doing things like this:
Code:
AND  {
                island = yes
                NOT = { is_capital = yes }
           }
Instead of this:
Code:
AND  = {
                island = yes
                NOT = { is_capital = yes }
             }

I don't know why my brain decided the equals sign wasn't necessary anymore. Derp.
 

DanubianCossak

DaputinCozzak Specyal Snowflake
34 Badges
Nov 16, 2009
12.412
3.646
  • Crusader Kings II
  • Europa Universalis IV: Pre-order
  • Europa Universalis IV: Third Rome
  • Europa Universalis IV: Res Publica
  • Heir to the Throne
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Art of War
  • Cities in Motion
  • Divine Wind
  • Europa Universalis III Complete
  • Darkest Hour
  • Hearts of Iron IV: Expansion Pass
  • Europa Universalis IV: Mandate of Heaven
  • Hearts of Iron IV: Death or Dishonor
  • Europa Universalis IV: Rights of Man
  • Age of Wonders III
  • Europa Universalis IV: Cradle of Civilization
  • Hearts of Iron IV: Expansion Pass
  • Europa Universalis IV: Rule Britannia
  • Europa Universalis IV: Dharma
  • Europa Universalis IV: Golden Century
  • Hearts of Iron IV: Field Marshal
  • Hearts of Iron IV: Colonel
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV Sign-up
  • Europa Universalis IV: Mare Nostrum
  • Europa Universalis IV: Cossacks
  • Europa Universalis IV: Common Sense
  • Europa Universalis IV: El Dorado
  • 500k Club
  • Europa Universalis III Complete
  • Europa Universalis III Complete
  • Europa Universalis IV
Well this is what happens when I obsess over a problem for ~12 hours in the past 24. I somewhere along the line started doing things like this:
Code:
AND  {
                island = yes
                NOT = { is_capital = yes }
           }
Instead of this:
Code:
AND  = {
                island = yes
                NOT = { is_capital = yes }
             }

I don't know why my brain decided the equals sign wasn't necessary anymore. Derp.

Yup, after i put your file into my mod, everything loads, but 3 buildings appear be broken (they show all messed up) which happens when you physically break the code (by forgetting = for example).

Couple of things however:

1.) trade_value is a modifier not a trigger; this might be confusing because you are adding AI "modifiers", but those "modifiers" are "trigger" stuff from that modding thread; the "modifier" part from the modding thread is the effect part of decision/event/whatever code.

2.) you have couple of modifiers for navy/army %, you put those in a wrong scope, building file is province scope so if you want to check army/navy size % you need to put the owner = {} thingie.
 

Arumba

Colonel
75 Badges
Mar 10, 2012
804
1.074
  • Crusader Kings II
  • Warlock 2: The Exiled
  • Victoria 2: A House Divided
  • Majesty 2 Collection
  • Magicka
  • Divine Wind
  • Europa Universalis III Complete
  • Crusader Kings II: Way of Life
  • Imperator: Rome - Magna Graecia
  • Victoria 2
  • Crusader Kings II: Holy Fury
  • Europa Universalis IV: Third Rome
  • Warlock: Master of the Arcane
  • 500k Club
  • Crusader Kings III
  • Europa Universalis IV: El Dorado
  • Prison Architect
  • Age of Wonders III
  • Pillars of Eternity
  • Stellaris: Distant Stars
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Horse Lords
  • Cities: Skylines - Mass Transit
  • Crusader Kings II: Conclave
  • Europa Universalis 4: Emperor
  • Tyranny: Archon Edition
  • Hearts of Iron IV: Cadet
  • Europa Universalis IV: Golden Century
  • Hearts of Iron IV: Expansion Pass
  • Surviving Mars
  • BATTLETECH - Digital Deluxe Edition
  • Hearts of Iron IV: Death or Dishonor
  • Europa Universalis IV
  • Crusader Kings II: Jade Dragon
  • BATTLETECH
  • Europa Universalis III Complete
  • Battle for Bosporus
  • Age of Wonders: Planetfall
  • Europa Universalis IV: Dharma
  • Stellaris: Apocalypse
  • Europa Universalis III Complete
  • Hearts of Iron IV: Expansion Pass
  • Ancient Space
  • Heir to the Throne
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Old Gods
  • Europa Universalis IV: Cossacks
  • Cities: Skylines - Snowfall
  • Europa Universalis III
  • March of the Eagles
Yup, after i put your file into my mod, everything loads, but 3 buildings appear be broken (they show all messed up) which happens when you physically break the code (by forgetting = for example).

Couple of things however:

1.) trade_value is a modifier not a trigger; this might be confusing because you are adding AI "modifiers", but those "modifiers" are "trigger" stuff from that modding thread; the "modifier" part from the modding thread is the effect part of decision/event/whatever code.

2.) you have couple of modifiers for navy/army %, you put those in a wrong scope, building file is province scope so if you want to check army/navy size % you need to put the owner = {} thingie.

That probably explains why trying to adjust the AI's preferences on workshops and referencing trade_value wasn't working. Is there a way to pull the trade value from a province? Like Trade good X goods produced = annual trade value. Since the value of trade goods changes over time it makes more sense to me to reference the actual income and not base_production.

I understand the second you part you said, that I did it wrong, but I don't understand how to fix it. Can you give me an example?

Oh, and I fixed the three big mistakes, somehow when I was updating the 16th, 17th, and 18th forts I copied the whole 15th fort into them instead of just the ai_will_do section. I blame fatigue.
 

DanubianCossak

DaputinCozzak Specyal Snowflake
34 Badges
Nov 16, 2009
12.412
3.646
  • Crusader Kings II
  • Europa Universalis IV: Pre-order
  • Europa Universalis IV: Third Rome
  • Europa Universalis IV: Res Publica
  • Heir to the Throne
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Art of War
  • Cities in Motion
  • Divine Wind
  • Europa Universalis III Complete
  • Darkest Hour
  • Hearts of Iron IV: Expansion Pass
  • Europa Universalis IV: Mandate of Heaven
  • Hearts of Iron IV: Death or Dishonor
  • Europa Universalis IV: Rights of Man
  • Age of Wonders III
  • Europa Universalis IV: Cradle of Civilization
  • Hearts of Iron IV: Expansion Pass
  • Europa Universalis IV: Rule Britannia
  • Europa Universalis IV: Dharma
  • Europa Universalis IV: Golden Century
  • Hearts of Iron IV: Field Marshal
  • Hearts of Iron IV: Colonel
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV Sign-up
  • Europa Universalis IV: Mare Nostrum
  • Europa Universalis IV: Cossacks
  • Europa Universalis IV: Common Sense
  • Europa Universalis IV: El Dorado
  • 500k Club
  • Europa Universalis III Complete
  • Europa Universalis III Complete
  • Europa Universalis IV
That probably explains why trying to adjust the AI's preferences on workshops and referencing trade_value wasn't working. Is there a way to pull the trade value from a province? Like Trade good X goods produced = annual trade value. Since the value of trade goods changes over time it makes more sense to me to reference the actual income and not base_production.

Nope, there is no way to check for dynamic (modified) value. You can reference to trade good (which is what i do in my mod where trade goods start at way different values), or other stuff such as total trade value (which isnt perfect either), or local production etc.

I understand the second you part you said, that I did it wrong, but I don't understand how to fix it. Can you give me an example?

Oh, and I fixed the three big mistakes, somehow when I was updating the 16th, 17th, and 18th forts I copied the whole 15th fort into them instead of just the ai_will_do section. I blame fatigue.

This is what you have:

modifier = {
army_size_percentage = 90
factor = 1.10
}

army_size_percentage = is a country scope trigger, place where you put it is province scope, so you need to change scope; this is what you want:

modifier = {
factor = 1.10
owner = { army_size_percentage = 90 }
}

Do the same thing for all other instances of army_size_percentage and navy_size_percentage.

If you need further assistance you can add me via skype or something, might go faster :)