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

dosaki

Sergeant
43 Badges
Aug 12, 2015
54
63
  • Stellaris: Synthetic Dawn
  • Cities in Motion 2
  • Europa Universalis IV
  • Hearts of Iron III
  • Magicka
  • Crusader Kings II: Reapers Due
  • Imperator: Rome
  • Age of Wonders III
  • Cities: Skylines - Green Cities
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Stellaris: Distant Stars
  • Shadowrun Returns
  • Shadowrun: Dragonfall
  • Stellaris: Megacorp
  • Imperator: Rome Deluxe Edition
  • Crusader Kings II: Monks and Mystics
  • Prison Architect
  • Surviving Mars: First Colony Edition
  • Stellaris: Ancient Relics
  • Age of Wonders: Planetfall
  • Age of Wonders: Planetfall Deluxe edition
  • Stellaris: Lithoids
  • Stellaris: Federations
  • Stellaris: Necroids
  • Stellaris - Path to Destruction bundle
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sword of Islam
  • Cities: Skylines
  • Magicka: Wizard Wars Founder Wizard
  • Magicka 2
  • Cities: Skylines - After Dark
  • Knights of Pen and Paper 2
  • Stellaris
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Stellaris Sign-up
  • Hearts of Iron IV: Cadet
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Surviving Mars
  • Crusader Kings II
Hi guys,

Full disclaimer: I'm new to modding Paradox games

As it seems at the moment, if I make a mod which changes 00_tile_blockers.txt and another guy also changes this same file with his mod, our mods would be incompatible? Even though I add 2 more tile blockers and he changes the tile blockers already present.

Could we load mods in order? (append if parameter is new, replace if different, kind of like modifying a HashMap?).

Ideally we'd never change the original files.

If I have the following:

Original in 00_tile_blockers.txt
Code:
tb_mountain_range = {
    time = 100
    cost = {
        energy = 100
        minerals = 100
    }

    # ...

    prerequisites = { "tech_tb_mountain_range" }
}

tb_active_volcano = {
    time = 100
    cost = {
        energy = 100
        minerals = 100
    }

    # ...

    prerequisites = { "tech_tb_volcano" }
}

MOD 1 in MOD1_tile_blockers.txt
Code:
tb_mountain_range = {
    time = 100
    cost = {
        energy = 0        #Destroying a mount should give you a bunch of minerals!
        minerals = 200 #But destroying is probably energy intensive
    }

    # ...

    prerequisites = { "tech_tb_mountain_range" }
}

tb_active_volcano = {
    time = 100
    cost = {
        energy = 0        #Destroying a volcano should give you a bunch of minerals!
        minerals = 50    #And you can generate some energy form the heat to power your destruction!
    }

    # ...

    prerequisites = { "tech_tb_volcano" }
}

and MOD 2 in MOD2_tile_blockers.txt
Code:
tb_mountain_range = {
    time = 100
    cost = {
        energy = 100
        minerals = 100
    }

    # ...

    prerequisites = { "tech_tb_mountain_range" }
}

tb_new_tile_blocker = {
    time = 100
    cost = {
        energy = 100
        minerals = 200
    }

    # ...

    prerequisites = { "tech_tb_new_tile_blocker_remover" }
}

I'd expect that if loaded in Original -> MOD 1 -> MOD 2 order, I'd end up with

Code:
tb_mountain_range = { #From MOD2 (MOD1 replaced original and then MOD2 replaced MOD1)
    time = 100
    cost = {
        energy = 100
        minerals = 100
    }

    # ...

    prerequisites = { "tech_tb_mountain_range" }
}

tb_active_volcano = { #From MOD1 (MOD1 replaced original)
    time = 100
    cost = {
        energy = 0        #Destroying a volcano should give you a bunch of minerals!
        minerals = 50    #And you can generate some energy form the heat to power your destruction!
    }

    # ...

    prerequisites = { "tech_tb_volcano" }
}

tb_new_tile_blocker = { #From MOD2 (MOD2 appended to original file)
    time = 100
    cost = {
        energy = 100
        minerals = 200
    }

    # ...

    prerequisites = { "tech_tb_new_tile_blocker_remover" }
}
 
Last edited:
Yep, there's not much information about this conventions. In some mods I've seen, some people keep the original 00_whatever.txt and some add a 01_whatever.txt. And some keep the original code in there + the code they add, and some simply keep their code, deleting what the original file had (I get it loading the mod tells the game to add those lines to that file). But there's no explanation as to when you can do it and when you cannot...
 
I just tested it, and it looks like arbitrary filenames work. So, if you're adding new content you should always create a new file with a unique name, so you avoid conflicts nothing gets overwritten.

If you're modifying existing content you'll still have to use the original filenames and deal with incompatibilities, of course. I don't know right now if they append or overwrite the original file when you load the mod; I assume overwrite (to make it easier to remove things) but I don't know.

I also don't know what happens if you redefine an existing entity in a new file; unless someone has a definitive answer I'd recommend avoiding doing that. Seems like an easy way to get a mess of unpredictable results.

Therefore, in the example in the first post, MOD1 should be in yourmod\tile_blockers\00_tile_blockers.txt and MOD 2 should be a new file with a unique name.
 
In Paradox games the text structure is mostly for organization and code in one file can interact completely seamlessly with code in another. So while modding, you could keep the original file and put any additions in a new file, unless you are modifying the original file in the first place.
 
The places to look would be the EU4 and CK2 mod forums; I don't know of anything that would specifically outline that all in one place off of the top of my head. Modding Stellaris is essentially identical to modding those games, so you could also examine how some of the mods for those games organize themselves.
 
In the quick questions thread they mention if you want to overwrite (modify) existing content you should use the original name of the file, though you can still only keep there the lines you modified. There's no need to keep the entire content of the file.
 
Hi, I just tried to move my (added) code into separate namespaced-prefixed files but this didn't work 100% well.

I think everything else is working but the localisation files aren't. Is there any special rule I need to adhere to?

EDIT:

Yes, there is. I need to add l_english: at the top.
 
Last edited:
Hi, I just tried to move my (added) code into separate namespaced-prefixed files but this didn't work 100% well.

I think everything else is working but the localisation files aren't. Is there any special rule I need to adhere to?

EDIT:

Yes, there is. I need to add l_english: at the top.
hehe, yep, you found it. you should keep the first line of a localisation file always (l_english, l_spanish, etc) and every line you add after that should hava a space before the code. The localisation files are pretty picky about indentation