• 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.
Yes, if you use the "on_megastructure_built" on action you can trigger a country event (for example, "utopia.2000").

Then use this:

Code:
immediate = {
    FROM = {
        solar_system = {
            spawn_megastructure = {
                type = "gateway_ruined"
                random_pos = yes
                orbit_angle = 360
            }
        }
    }
}
Thank you. Greatly appreciated. :)
 
Last edited:
Are two empires really considered as neighbors if neither of them knows how to use a gateway?
I don't know what happens if they don't know how to use a gateway but in my current game both empires have gateways and know how to use them ( I give them the tech at start).

I was testing adding a requirement for a protectorate that they be neighbors expecting they had to share a border but in game it says under the requirements for protectorates that they meet the condition as neighbors even though they do not share a border so my conclusion was the game is considering the gateways for determining neighbors. Now I have been wrong in the past in making conclusions but I find no standard border but the game insists they are neighbors so I don't know what to think.

I was hoping someone had a idea to add a second trigger like number of jumps but the gateway would also do that correct? So I am not sure how I can require two empires to be neighbors not counting gateways.......
 
How exactly does the "is_difficulty" trigger work? The wiki says is_difficulty = 0 corresponds to normal, is_difficulty = 1 to hard, and is_difficulty = 2 to insane. But what do those correspond to in terms of Ensign/Captain/Commodore/Admiral/Grand Admiral? I ask because I'm trying to create a difficulty mod for scaling difficulty that starts the game with the AI having commodore bonuses and then scales up to a modded Grand Admiral (1.5X vanilla GA bonuses and 100% extra research speed/unity). However, I only want the AI to have these bonuses when Grand Admiral is selected (ideally only scaling GA, but I'm not playing roided up GA non-scaling with Starnet anyways) so I can play regular, non-scaling admiral games without having to change my mods every time.
 
Is there any way to disable the sharing of communications via diplomacy that I'm missing?

As far as I can see, there are two defines associated with it:

Code:
        TRADE_VALUE_SENSOR_CHARTS = 2 # Per new comms
        TRADE_VALUE_SENSOR_CHARTS_MAX = 10

...but they're not what I'm looking for.
 
start tech versus tech given by event

Is there a difference between a tech set in the common tech files as start_tech = yes and an event that gives the tech such as give_technology = { tech = tech_gateway_activation message = no } ? When I test using a trigger it appears they are the same but the ai is less likely to build gateways with the event option versus the starting tech option and I don't understand why as both are done at the beginning of the game. ( Note they have all the required tech and not just the one mentioned).

also in game under technology you want to research will a tech still show up to be researched if you already have it?
 
I'm trying to figure out how the transition for the Early Space Age primitive earth to the United Nations of Earth works. I've been scouring through files but the flags I've searched up haven't really shown me anything that actually works. Could somebody point me in the right direction here? I wanted to try to make a couple of custom primitive civilizations and have specific outcomes for them. I'm sure it has to be an event of some sort, but I'm not exactly sure which one to get started with.
 
Does the name of the txt files in Common have to be an exact match for moded files to overwrite and function?
I added a SSP_ prefix instead of the 00_ prefix and all the files seems to overwrite everything except for just the Utilities_reactors, it doesn't over write without the name being the same as the base file :(
 
Does the name of the txt files in Common have to be an exact match for moded files to overwrite and function?
I added a SSP_ prefix instead of the 00_ prefix and all the files seems to overwrite everything except for just the Utilities_reactors, it doesn't over write without the name being the same as the base file :(
It depends on the folder. Some parts of Common (like buildings) lets you overwrite individual elements without overwriting the whole file. In that case, a different name will still overwrite the parts you want (although depending on the folder, this new file may need a name asciibetically before, as with static modifiers, or after, as with buildings, the vanilla file name); others (like jobs) require overwriting the whole file.

You can see which ones are which on the wiki page for modding: https://stellaris.paradoxwikis.com/Modding
Look in the overwriting specific elements section.
 
  • 1Like
Reactions:
Ah, then I didn't understand that section of the wiki fully. I'm probably having a hard time following the load order explanation so I'll try listing out specific questions.

1. 'First In, Only Serve' means first item in the launcher mod list?
2. Error Key doesn't impact how the files are read?
3. Is the "Breaks auto-generated modifiers" notes, such as in buildings, what indicates if a file can be partially overwritten?
4. Is there an indicator indicating if a file needs asciibetical ordering?

Thanks!
 
Ah, then I didn't understand that section of the wiki fully. I'm probably having a hard time following the load order explanation so I'll try listing out specific questions.

1. 'First In, Only Serve' means first item in the launcher mod list?
2. Error Key doesn't impact how the files are read?
3. Is the "Breaks auto-generated modifiers" notes, such as in buildings, what indicates if a file can be partially overwritten?
4. Is there an indicator indicating if a file needs asciibetical ordering?

Thanks!
1. First in, only serve, means that if you want to overwrite a portion of a file rather than whole thing, you need to name your new file something that comes BEFORE the vanilla file name (and the names of any similar overwrites in other mods) asciibetically. For instance, if I want to overwrite the Grand Admiral difficulty static modifier, but not the whole 00_static_modifiers file, I could do it by making a new text file containing this text:
Code:
difficulty_grand_admiral = { #Multiplying Vanilla values by 1.5
    stations_produces_mult = 1.5
    planet_jobs_produces_mult = 1.5
    country_naval_cap_mult = 0.9
    starbase_shipyard_build_cost_mult = -0.35 #Except this so DS don't get free ships!
    planet_stability_add = 30
    ships_upkeep_mult = -0.4 #Except this to avoid upkeep-free nonsense; 1x only
    #Adding a 100% boost to research, admin cap, and unity on top of that, because why not!
    all_technology_research_speed = 1
    country_unity_produces_mult = 1
    country_admin_cap_mult = 1
    country_claim_influence_cost_mult = -0.3 #Because the AI can't use total war
    #AI can't redevelop districts, so housing is probably a fair bonus
    pop_housing_usage_mult = -0.3
    country_alloys_produces_mult = 0.25 #To compensate for nerfing the ship cost reduction
}
Named something like "!!beastmode_grand_admiral.txt" because !! comes before 00_static_modifiers asciibetically.
Last in, only, serve, means the same thing, except you would name the file something that comes after the vanilla file name. For instance, if I wanted to overwrite the "Greater than Ourselves" edict without overwriting the whole file, I could do something like this:
Code:
greater_than_ourselves = {
    length = -1
    icon = "GFX_edict_type_policy"
    edict_cap_usage = 0

    resources = {
        category = edicts
        cost = { #Activation Cost
            trigger = {
                NOT = { has_edict = greater_than_ourselves }           
            }
            influence = 0
        }
        cost = { #Deactivation Cost
            trigger = {
                has_edict = greater_than_ourselves
            }
            influence = 0
        }
    }

    modifier = {
    }


    ai_weight = {
        weight = 19999
    }
}
And call it something like "freegtos.txt" because freegtos comes after 00_edicts asciibetically.

Load order only matter when the files have the same names, which typically only occurs when overwriting entire vanilla files (such as jobs files, which can't be overwritten individually).

2. The Error log messages have no inherent effect on gameplay. It will just print an error message in error.log in the logs folder, but this will not have any effect game-wise. It can make finding actual errors in the log more difficult if you come across modding issues you want to fix, but in and of itself it is not a problem.

3. No. Anything with an entry (other than "no," and the Pop Jobs folder specifically, which can't be overwritten individually despite what the wiki says) in the "overwrite type" column can be overwritten individually (except-sort-of-dupl, which will create a new version of the same thing). "Breaks auto-generated modifiers" just means that if you change the entry, it won't necessarily be reflected in the UI in game (but it will still take effect). For instance, if I mod research labs to only have 1 researcher instead of two, it might still display a base output of +8 of each research and a base upkeep of 4 consumer goods on the card, even though it's really half that (and if I build the research lab, it will only have 1 job).
4. The LIOS/FIOS tells you. LIOS: asciibetically AFTER the vanilla file that contains the element you're overwriting. FIOS: asciibetically BEFORE the vanilla file containing the element you're overwriting. If you can't overwrite individual elements, you need to overwrite the entire file.
 
  • 1Love
Reactions:
Hi all! As far as I can see there is like +-0 information about how to program mods to this. All I have found is only how to change existing files and redestribute.
I want to make mod that changes opinion of empires of my rivalry. Something like they will have -500 to him for 2 years.
I wanted to make it in the next way. Create file in edicts folder that will call an event.
Code:
NM_hate = {

    length = 0

    modifier = {

    }

  

    resources = {

        category = edicts

        cost = {

            influence = 500

        }

    }



    potential = {

        is_multiplayer = no

    }

  

    effect = {

        country_event = { id = NM_options.1 }

    }



    allow = {

        is_multiplayer = no

    }



    ai_weight = {

        weight = 0

    }   

}

It will cost 500 influence and call an event in whitch it will be stated that our blah blah blah sabotaged reputatuion.
How do I make it? How to find out via code who is my rivalry?
 
Hi all! As far as I can see there is like +-0 information about how to program mods to this. All I have found is only how to change existing files and redestribute.
I want to make mod that changes opinion of empires of my rivalry. Something like they will have -500 to him for 2 years.
I wanted to make it in the next way. Create file in edicts folder that will call an event.
Code:
NM_hate = {

    length = 0

    modifier = {

    }

 

    resources = {

        category = edicts

        cost = {

            influence = 500

        }

    }



    potential = {

        is_multiplayer = no

    }

 

    effect = {

        country_event = { id = NM_options.1 }

    }



    allow = {

        is_multiplayer = no

    }



    ai_weight = {

        weight = 0

    }  

}

It will cost 500 influence and call an event in whitch it will be stated that our blah blah blah sabotaged reputatuion.
How do I make it? How to find out via code who is my rivalry?
You can iterate through rivals in country scope with every_rival_country = { limit = { <triggers> } <effects> }.
 
  • 1Like
Reactions:
limit = { <triggers> }

Must be there something like

limit = { if its is my rival then true}

?

How to find specific country that IS my rival? Does this "every_rival_country" searches only thru MY rivals?
Do you know any database with examples so I can dig? Cuz I feel like I HAVE to ask for every step I do. And I feel kinda cringe cuz when you ask a lot it is a 146% way to make ppl hate you.


If it would be something like C++ I would do the next:

int Empire_I_Rival;

for(int i = 0 ; i++; i<Empires_Number_In_Game)
{
if (Empire.rivalry_with_me == true)
{
Empire_I_Rival = i;
break;
}
}


for(int i = 0 ; i++; i<Empires_Number_In_Game)
{
Empire.Opinion[Empire_I_Rival] = -500;
}


A little bit wrong but you must get the idea.
 
limit = { <triggers> }

Must be there something like

limit = { if its is my rival then true}

?

How to find specific country that IS my rival? Does this "every_rival_country" searches only thru MY rivals?
Do you know any database with examples so I can dig? Cuz I feel like I HAVE to ask for every step I do. And I feel kinda cringe cuz when you ask a lot it is a 146% way to make ppl hate you.


If it would be something like C++ I would do the next:

int Empire_I_Rival;

for(int i = 0 ; i++; i<Empires_Number_In_Game)
{
if (Empire.rivalry_with_me == true)
{
Empire_I_Rival = i;
break;
}
}


for(int i = 0 ; i++; i<Empires_Number_In_Game)
{
Empire.Opinion[Empire_I_Rival] = -500;
}


A little bit wrong but you must get the idea.
The limit = <triggers> applies if you want to narrow things more than just rivals (eg, if you only wanted to do something to rivals who have a smaller fleet than you, for instance). If you want it to apply to all of your rivals, you could do something like:
Code:
every_rival_country = {
    limit = { always = true } #So all rivals are affected
    add_opinion_modifier = { <Your opinion modifier here> } #Scopes are annoying; I believe "this" should be
                                                            #your rival, "prev" should be you
}
 
  • 1Like
Reactions:
The limit = <triggers> applies if you want to narrow things more than just rivals (eg, if you only wanted to do something to rivals who have a smaller fleet than you, for instance). If you want it to apply to all of your rivals, you could do something like:
Code:
every_rival_country = {
    limit = { always = true } #So all rivals are affected
    add_opinion_modifier = { <Your opinion modifier here> } #Scopes are annoying; I believe "this" should be
                                                            #your rival, "prev" should be you
}

So I made something like this:

country_event = { id = hate.66 title = hate.66.name desc = hate_.66.desc is_triggered_only = yes option = { name = hate.66.a #every_country = # { limit = { always = true } add_opinion_modifier = { who = every_country modifier = opinion_shielded_my_world } # } } option = { name = hate.exit } }

Hiiran is me.
Trying just to make everyone hates me and ingame it says "Hiiran opinin of will be changed with -200"
If I delete "#" it will says nothing. If I change who = every_country on who = root it will be "Hiiran opinin of Hiiran will be changed with -200"
 
So I made something like this:

country_event = { id = hate.66 title = hate.66.name desc = hate_.66.desc is_triggered_only = yes option = { name = hate.66.a #every_country = # { limit = { always = true } add_opinion_modifier = { who = every_country modifier = opinion_shielded_my_world } # } } option = { name = hate.exit } }

Hiiran is me.
Trying just to make everyone hates me and ingame it says "Hiiran opinin of will be changed with -200"
If I delete "#" it will says nothing. If I change who = every_country on who = root it will be "Hiiran opinin of Hiiran will be changed with -200"
You can't write "who" = every_country. Root is your country since that's the scope of the broader event. Try uncommenting out the loop and writing who = this. I think that would do it.
 
You can't write "who" = every_country. Root is your country since that's the scope of the broader event. Try uncommenting out the loop and writing who = this. I think that would do it.
Well. I somehow made it. Now it looks like this:

country_event = { id = hate.66 title = hate.66.name desc = hate.66.desc is_triggered_only = yes option = { name = hate.66.a every_country = { add_opinion_modifier = { who = root modifier = opinion_shielded_my_world } } } option = { name = hate.exit } }

Seems limit = { always = true } was the problem
And every other country now have -200 towards me. But why -200? If the opinion mod is this:

opinion_shielded_my_world = { opinion = { base = -111 } accumulative = yes min = -111 decay = { base = 1 } }

And if I make it -2000 it will be still -200. What if I need more?

Also tooltip is still bugged and stupid. It says "Every empireHiran opinion to Hiran will be -200"
 
Well. I somehow made it. Now it looks like this:

country_event = { id = hate.66 title = hate.66.name desc = hate.66.desc is_triggered_only = yes option = { name = hate.66.a every_country = { add_opinion_modifier = { who = root modifier = opinion_shielded_my_world } } } option = { name = hate.exit } }

Seems limit = { always = true } was the problem
And every other country now have -200 towards me. But why -200? If the opinion mod is this:

opinion_shielded_my_world = { opinion = { base = -111 } accumulative = yes min = -111 decay = { base = 1 } }

And if I make it -2000 it will be still -200. What if I need more?

Also tooltip is still bugged and stupid. It says "Every empireHiran opinion to Hiran will be -200"
No clue about the tooltip, but I've seen that sort of bug with vanilla tooltips as well. As for the opinion modifier, I bet it's because the Vanilla "opinion_shielded_my_world" modifier is -200. Opinion modifier overwriting creates a duplicate with the same name, so your script is adding the original one and not the mod one. Try making a new opinion modifier with the value you want and adding that instead.
 
  • 1Like
Reactions: