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

Victor_Delta

Private
22 Badges
Jun 10, 2015
13
1
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Call to arms event
  • Europa Universalis IV: Res Publica
  • Crusader Kings III
  • Crusader Kings II: Monks and Mystics
  • Europa Universalis IV: Rights of Man
  • Crusader Kings II: Reapers Due
  • Stellaris
  • Crusader Kings II: Conclave
  • Europa Universalis IV: Cossacks
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: El Dorado
  • Europa Universalis IV
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: Charlemagne
  • Crusader Kings II
Hi, does anyone know if it is possible to mod the game in a way that tile deposits don't spawn under tile blockers?. I was thinking of making a mod, where some tile blockers like mountains couldn't be cleared. I've been looking at the files, but I'm not sure how to do this or if it can even be done.
 
Thats one way to do it, have the game check for blockers on every planet with blockers but then I would have to also replace them with new deposits. If it would remove lets say 4 min/energy/reaserch deposits I would like to add those back to the planet somewhere that isn't blocked, Im not sure how this would work and for every planet. I don't know I feel like there has to be a simpler way, if not then I won't bother.
 
I would create an event that fires on game start. There's probably a more elegant way to do it (maybe there isn't), but it *should* work.

First, mod on_game_start in 00_on_actions to fire the event you'll create. This will ensure that the event is fired when the game starts. Then create a new event. Something to the effect of:
Code:
event = {
    id = removeblockerdepositsmod.1
    hide_window = yes

    fire_only_once = yes
    is_triggered_only = yes

    immediate = {
    every_planet = {
        every_tile = {
            limit = {
                has_blocker = yes
            }
            if = {
                limit = {
                    has_blocker = tb_mountain_range
                          }
                clear_deposits = yes
                  }
            }
        }
      }
    }
}
Disclaimer: I haven't tested the above code, but it looks like it should work. This obviously only clears mountain range deposits. There are probably other ways to do this, but this seems the most obvious to me. Hope this helps.

Oh wait, I see you wanted to add back the deposits somewhere else on the planet. This shouldn't be too much harder, but I can't write it right now. I will try and edit later if I can.
 
You can set several requirements in 00_deposits.txt, I haven't tried blockers but something like "has_blocker = no" may work to adjust the weight just like they already use for planetary modifiers.
 
Welp Im stumped, I've been trying to use modifiers on the drop weight but either nothing changes(no deposits are removed) or all the deposits on the planet are removed no matter what scope I use. Im probably missing something very obvious but I don't see it, for example
modifier = {
weight = 0
any_tile = {
limit = {
has_blocker = yes
}
}
}
this removes every deposit on the planet even if it doesn't have a blocker and I don't know why.
 
I couldn't get deposit changes to work on the starting planet with the events I tried for my prescripted empire.

What I wanted was to check for a certain deposit type and then replace it with another one, couldn't get it to work.
 
It's a bit frustrating, I can't use any similar mod as reference since as far as I can see, nobody is doing anything with tile blockers. Not that I blame them, right now blockers are very forgetable, damn it I just want to make tile blockers great again(sorry I had to :D).
 
Tile blockers are probably generated when needed, like deposits, rather than every planet having it's resources and tile-blockers generated at game-start. So you can't use game-start.
 
Tile blockers are probably generated when needed, like deposits, rather than every planet having it's resources and tile-blockers generated at game-start. So you can't use game-start.
You might be right, but my understanding from what I've seen in the files is that deposits and tile blockers are generated on planet generation (which would be on game start). This is ignoring deposits that may be added at a later date through anomalies and such.

I have run into two main problems trying to solve this issue. One is that I don't completely understand 00_deposits. I understand how it works on a big picture level, but I don't understand how it places the deposits on specific tiles rather than on whole planets. Orbital deposits I understand (I think). But regular tile deposits, I don't really understand. Unless there is only one deposit on a planet and the rest of the tile yields are just added as resources, but I don't think it works that way. Perhaps someone with a greater knowledge of deposits could help out here.

Second problem is that the game, as far as I can tell, has no function to identify the deposit currently on a tile. This prevents my adding an identical deposit to another tile on the planet before clearing the blocked tile. Interestingly, it is easy to go the other way. I can easily add a deposit to a tile that has a blocker on it. I can clear deposits from blocked tiles. I just can't determine what deposit is on a tile.
 
  • 1
Reactions:
There's another thread where I dissected deposits pretty thoroughly.

I believe empire homeworlds and a couple of nearby planets have their deposits and blockers generated on game-start but other planets it's only when they're needed (surveyed by the player or an AI, for example).

There is a clause for checking for a deposit on a tile, but I've only used it with potential and allow in buildings so far. Not with any triggers or events.

Example:

Code:
  allow = {
     custom_tooltip = {
       text = "requirement_natural_fuels_deposit"
       tile = {
         OR = {
           has_deposit = "d_rich_natural_fuels_deposit"
           has_deposit = "d_natural_fuels_deposit"
           has_deposit = "d_natural_fuels_and_minerals_deposit"
         }
       }
     }     
   }