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

Legionarivs

Sergeant
38 Badges
Aug 21, 2013
73
24
  • Europa Universalis IV: Res Publica
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Art of War
  • Crusader Kings II: Conclave
  • Europa Universalis IV: Cossacks
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Rights of Man
  • Crusader Kings II: Monks and Mystics
  • Europa Universalis IV: Mandate of Heaven
  • Europa Universalis IV: Cradle of Civilization
  • Europa Universalis IV: Rule Britannia
  • Europa Universalis IV: Dharma
  • Crusader Kings II: Holy Fury
  • Europa Universalis IV: Golden Century
  • Imperator: Rome Deluxe Edition
  • Imperator: Rome
  • Imperator: Rome - Magna Graecia
  • Crusader Kings III
  • Crusader Kings III: Royal Edition
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: El Dorado
  • Cities: Skylines
  • Europa Universalis IV
  • Crusader Kings II: Charlemagne
  • Crusader Kings II
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Jade Dragon
  • Europa Universalis IV: Third Rome
  • Europa Universalis IV: Mare Nostrum
To add depth and realism to combat I want to create a mod that decreases the effectiveness of certain army types in combat.

For example: elephants, cavalry, chariots and heavy infantry's offensive capabilities in the mountains, while also limiting the defensive effectiveness of some units. It just doesn't make any sense to bring elephants or chariots into the mountains.

I found under Common, Units the file to edit things but how would I apply it? Suggestions are also more than welcome! Tactics are also quite limiting as of now, would be cool if it were possible to add terrain modifiers on them as well.

Legends I hope you are able and willing to help!
 
Last edited:
Well there are the modifiers in the military traditions like "warelephant_jungle_combat_bonus" and that's the only known place where it works, but you can try and experiment with other ways. One idea might be to put the penalties in the terrain files themself as modifers. like put "warelephant_offensive = -0.1" in the mountains terrain file. I am very doubtful that your suggested method would work however, putting the terrain penalty in the unit file is a bit strange because what would be your modifier? You could try putting mountain_combat_bonus = -0.1 in the unit file, but I'm not sure that there's any known example of that kind of syntax.
 
Well there are the modifiers in the military traditions like "warelephant_jungle_combat_bonus" and that's the only known place where it works, but you can try and experiment with other ways. One idea might be to put the penalties in the terrain files themself as modifers. like put "warelephant_offensive = -0.1" in the mountains terrain file. I am very doubtful that your suggested method would work however, putting the terrain penalty in the unit file is a bit strange because what would be your modifier? You could try putting mountain_combat_bonus = -0.1 in the unit file, but I'm not sure that there's any known example of that kind of syntax.

Interesting, makes sense. I feel like there's got to be a way as some of the mil tradition ideas grant bonuses for combat in the hills and forest so I feel like it must be possible. I doubt I am the first one to try and implement it. Sadly I am quite the beginner, if someone is willing to test stuff with me that would be much appreciated!
 
Interesting, makes sense. I feel like there's got to be a way as some of the mil tradition ideas grant bonuses for combat in the hills and forest so I feel like it must be possible. I doubt I am the first one to try and implement it. Sadly I am quite the beginner, if someone is willing to test stuff with me that would be much appreciated!
I wasn't able to get it working in either the terrain file or the unit file, but goods news is that negative combat bonuses are measured. A simple but inelegant solution would be just to put all those negative modifiers you want into the starting traditions of every single tradition tree. like "heavy_cavalry_mountain_combat_bonus = -0.15"

My working theory is that these modifiers have to be in country scopes, I will test more later to see if there are other ways.
 
The way you tell if it's working or not is when your desire unit of choice is fighting in a battle, you scroll over the unit to see whether there's any terrain "bonus" or not. In this case the bonus should be negative and red.
 
Hello,
This subject is of my interest and i've been modding some things in the unit files, this is what i've found.
If you take a look to the military traditions you'll notice that there are some traditions that give a terrain bonus:

Trad_bonus.jpg


If you take a look at how it does it:

code_plains_trad_bonus.jpg


Note: I'm allways working in my mod folder.
Now i copy the vanilla archers file to a ...common/units folder in my mod and i do some changes from what i've seen at the tradition code and let's see what happens (mod enabled)

Archers_mod1.jpg



Terrain_bonus1.jpg


It's not working... but i did some other changes in the modified file that are working (not terrain related), so the game is actually reading my modified archers file:

UType_bonus1.jpg


Thinking about it and examining the working code of the archers file, i wonder if the problem is in the double archers label, as the game is already into the archers file it may not know how to deal with another "archer_" in the commands, so i removed it & see what happens:

Archers_mod2.jpg



Terrain_bonus2.jpg


It's still NOT working... Maybe this kind of modifier isn't meant to be in the unit file.
As the original bonus came from the traditions files, i'm shifting the terrain bonus code to the traditions files, then i'm testing if it works (archers and L inf):

Trad_mod1.jpg



Terrain_bonus3.jpg



Terrain_bonus4.jpg


It works! I hope this will be usefull for you.
 
Hello,
This subject is of my interest and i've been modding some things in the unit files, this is what i've found.
If you take a look to the military traditions you'll notice that there are some traditions that give a terrain bonus:

View attachment 519613

If you take a look at how it does it:

View attachment 519616

Note: I'm allways working in my mod folder.
Now i copy the vanilla archers file to a ...common/units folder in my mod and i do some changes from what i've seen at the tradition code and let's see what happens (mod enabled)

View attachment 519617


View attachment 519619

It's not working... but i did some other changes in the modified file that are working (not terrain related), so the game is actually reading my modified archers file:

View attachment 519620

Thinking about it and examining the working code of the archers file, i wonder if the problem is in the double archers label, as the game is already into the archers file it may not know how to deal with another "archer_" in the commands, so i removed it & see what happens:

View attachment 519624


View attachment 519628

It's still NOT working... Maybe this kind of modifier isn't meant to be in the unit file.
As the original bonus came from the traditions files, i'm shifting the terrain bonus code to the traditions files, then i'm testing if it works (archers and L inf):

View attachment 519638


View attachment 519643


View attachment 519649

It works! I hope this will be usefull for you.
This essentially the exact same thing I discovered but with pictures for the uninitiated. I am also fairly certain that it can work in heritages or country modifiers, so maybe some kind of event similar to the warm period event would be the best solution.
 
Aren't the unit terrain modifiers just regular country modifiers? It seems like they are IMO, but haven't tested it yet. Has anyone tried to simply use the terrain modifiers in a regular modifier placed by an event? Or even simply use it in the 00_hardcoded file by adding it to base_values?