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

Ugai-Yuki

Recruit
11 Badges
Mar 15, 2021
6
1
  • Stellaris
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Hearts of Iron IV: Cadet
  • Stellaris - Path to Destruction bundle
  • Stellaris: Synthetic Dawn
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Stellaris: Megacorp
  • Stellaris: Ancient Relics
I'm making a mod about extending psionic ascension path. So I rewrote psionic trait:
Code:
trait_psionic = {
    cost = 0
    potential_crossbreeding_chance = 0.25
    icon = "gfx/interface/icons/traits/trait_psionic_species.dds"

    opposites = { "trait_cybernetic" }

    improves_leaders = yes
    initial = no
    randomized = no
    species_potential_add = {
        always = no
    }
    species_possible_remove = {
        always = no
    }
    species_possible_merge_add = {
        always = no
    }

    allowed_archetypes = { BIOLOGICAL LITHOID }

    modifier = {
        planet_jobs_physics_research_produces_mult = 0.10
        planet_jobs_society_research_produces_mult = 0.10
        planet_jobs_engineering_research_produces_mult = 0.10
        planet_jobs_unity_produces_mult = 0.15 
        pop_happiness = 0.05
    }
    triggered_pop_modifier = {
        potential = {
            exists = planet
            planet = { has_active_building = building_psi_elite_academy }
        }
        planet_jobs_ruler_produces_mult = 0.25
        planet_jobs_specialist_produces_mult = 0.10
        army_damage_mult = 0.30
    }
    slave_cost = {
        energy = 2000
    }
    assembly_score = {
        base = 0.5
        modifier = {
            add = 0.5
            from = { has_research_designation = yes }
        }
        modifier = {
            add = 0.5
            from = { has_unity_designation = yes }
        }
        modifier = {
            add = 0.5
            from = { has_building = building_order_keep }
        }
        modifier = {
            subtract = 1.5
            from.owner = { has_ascension_perk = ap_the_flesh_is_weak }
        }
    }
}
Just added a block of triggered_pop_modifier, and this file is correctly put in the traits folder, other traits in this file also works properly. And what made me bang my head on keyboard is that it worked correctly when directly edit the game original file in the installation folder.
In the same mod, there are some edicts have been successfully overwritten. But I don't know why this cannot be overwritten.
 
Traits cannot be overwritten individually. If you want to override them "properly", you have to copy-paste the entire file, keep the same name, and make your changes in it. Of course then the mod will be incompatible with other mods that do the same. If you create a file that does not match any of the original files, then you will just create a copy of the trait.

For traits that are only given out by events, you maaaaaay get away with doing it anyway if you name the file in such a way that it is the first read by the game. From some quick testing, this does seem to work, but it may still have unintended consequences.

For general references on how to override different types of objects, see:
 
  • 1Like
Reactions: