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

KNiko1

Private
25 Badges
Feb 19, 2018
17
1
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Nemesis
  • Stellaris: Necroids
  • Battle for Bosporus
  • Stellaris: Federations
  • Hearts of Iron IV: La Resistance
  • Stellaris: Lithoids
  • Stellaris: Ancient Relics
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Megacorp
  • Stellaris: Distant Stars
  • Stellaris: Apocalypse
  • Stellaris: Humanoids Species Pack
  • Hearts of Iron IV: Death or Dishonor
  • Stellaris - Path to Destruction bundle
  • Hearts of Iron IV: Together for Victory
  • Stellaris: Leviathans Story Pack
  • Stellaris: Digital Anniversary Edition
  • Hearts of Iron IV: Cadet
  • Stellaris
  • Darkest Hour
  • Stellaris: Synthetic Dawn
  • Semper Fi
  • Hearts of Iron III
  • For the Motherland
Specifically, Crystal Infused Plating.

I'm using the Starnet AI mod, and while I'm generally enjoying it, I don't like that it outfits all its fleets with Crystal Infused Plating and such as soon as its available for them; it takes the fun out of designing fleets. I'd rather make it so that its a player-only technology.

How would I go about that?
 
Specifically, Crystal Infused Plating.

I'm using the Starnet AI mod, and while I'm generally enjoying it, I don't like that it outfits all its fleets with Crystal Infused Plating and such as soon as its available for them; it takes the fun out of designing fleets. I'd rather make it so that its a player-only technology.

How would I go about that?
Each tech can have a potential section like:

potential = {
has_country_flag = crystal_infused_plating_allowed
}

So add that potential to the crystal infused plating tech.

Then create a country event like:

country_event = { id = stevecustomshiptech.10 hide_window = yes trigger = { is_ai = no NOT = { has_country_flag = crystal_infused_plating_allowed } } immediate = { set_country_flag = crystal_infused_plating_allowed } }
 
Each tech can have a potential section like:

potential = {
has_country_flag = crystal_infused_plating_allowed
}

So add that potential to the crystal infused plating tech.

Then create a country event like:

country_event = { id = stevecustomshiptech.10 hide_window = yes trigger = { is_ai = no NOT = { has_country_flag = crystal_infused_plating_allowed } } immediate = { set_country_flag = crystal_infused_plating_allowed } }

I was doing some testing on my own, and I did something like this.

potential = {
is_ai = no
}

Might something like this do the trick?
 
I was doing some testing on my own, and I did something like this.

potential = {
is_ai = no
}

Might something like this do the trick?
I don't remember as it has been several months since I did it for myself. I think I would have tried that and for some reason I went with the country flag. I think I saw another example using the flag and decided to go with it. I am not the best at testing so I like using things others have already used. The game is strange sometimes about is_ai = no. Might work????
 
I don't remember as it has been several months since I did it for myself. I think I would have tried that and for some reason I went with the country flag. I think I saw another example using the flag and decided to go with it. I am not the best at testing so I like using things others have already used. The game is strange sometimes about is_ai = no. Might work????
I’ll give them both a shot, and I’ll see what works. Thanks for the tip!
 
I don't remember as it has been several months since I did it for myself. I think I would have tried that and for some reason I went with the country flag. I think I saw another example using the flag and decided to go with it. I am not the best at testing so I like using things others have already used. The game is strange sometimes about is_ai = no. Might work????
Ok, so unless I did something wrong, is_ai =no didn’t work.

So, I’m new to modding stellaris. In what file would I make this country event?
 
Ok, so unless I did something wrong, is_ai =no didn’t work.

So, I’m new to modding stellaris. In what file would I make this country event?
just make a new one. The important thing is at the top of the file you have a line namespace = and the namespace = can be something like freds_events. Then in the events you use freds_events like:

id = freds_events.1
 
just make a new one. The important thing is at the top of the file you have a line namespace = and the namespace = can be something like freds_events. Then in the events you use freds_events like:

id = freds_events.1

Ok, I made a new event and all. I went into the console and confirmed that the event got triggered on startup. Before I get into a new game, is there a way for me to confirm that it restricted crystal plating to player only?
 
Ok, I made a new event and all. I went into the console and confirmed that the event got triggered on startup. Before I get into a new game, is there a way for me to confirm that it restricted crystal plating to player only?
Sorry I do no know. I guess maybe you could create an event that would fire if a default country ( not fallen empire etc but a regular ai = yes tag has the tech ) some thing like:

country_event = { id = steveships.1 title = steveships.1.title desc = steveships.1.desc picture = GFX_evt_fleet_good show_sound = event_mystic_reveal trigger = { is_ai = no any_country = { is_ai = yes is_country_type = default has_technology = tech_crystal_armor_1 } } option = { name = steveships.1.a ok } }

note please double check everything above as I threw it together fast and I am not sure I have things correct.
 
Crystal Plating is given out as a research option from the first contact with the crystals, which I think ignores tech limitations. You'll probably have to edit those.
 
Alright, alright.

Code:
first_contact_event = {
    id = first_contact_critters.35
    title = story.201.name
    # Phile
    desc = {
        trigger = {
            owner = {
                OR = {
                    has_ethic = ethic_xenophile
                    has_ethic = ethic_fanatic_xenophile
                }
            }
        }
        text = story.201.desc.phile
    }
    # Phobe
    desc = {
        trigger = {
            owner = {
                OR = {
                    has_ethic = ethic_xenophobe
                    has_ethic = ethic_fanatic_xenophobe
                }
            }
        }
        text = story.201.desc.phobe
    }
    # Pacif
    desc = {
        trigger = {
            owner = {
                OR = {
                    has_ethic = ethic_pacifist
                    has_ethic = ethic_fanatic_pacifist
                }
            }
        }
        text = story.201.desc.pacif
    }
    # Spiri
    desc = {
        trigger = {
            owner = {
                OR = {
                    has_ethic = ethic_spiritualist
                    has_ethic = ethic_fanatic_spiritualist
                }
            }
        }
        text = story.201.desc.spiri
    }
    # Milit
    desc = {
        trigger = {
            owner = {
                OR = {
                    has_ethic = ethic_militarist
                    has_ethic = ethic_fanatic_militarist
                }
            }
        }
        text = story.201.desc.milit
    }
    # Generic / Gestalt
    desc = {
        trigger = {
            owner = {
                NOR = {
                    has_ethic = ethic_militarist
                    has_ethic = ethic_fanatic_militarist
                    has_ethic = ethic_spiritualist
                    has_ethic = ethic_fanatic_spiritualist
                    has_ethic = ethic_pacifist
                    has_ethic = ethic_fanatic_pacifist
                    has_ethic = ethic_xenophobe
                    has_ethic = ethic_fanatic_xenophobe
                    has_ethic = ethic_xenophile
                    has_ethic = ethic_fanatic_xenophile
                }
            }
        }
        text = story.201.desc
    }
    picture = GFX_evt_fleet_evil
    show_sound = event_space_crystals

    is_triggered_only = yes
    first_contact = yes

    immediate = {
        set_site_progress_locked = yes
    }

    option = { # Hunting Buff
        name = story.201.aa
        trigger = {
            owner = {
                OR = {
                    is_xenophobe = yes
                    is_militarist = yes
                    is_homicidal = yes
                }
            }
        }
        owner = {
            add_modifier = {
                modifier = crystal_hunting_buff
                days = -1
            }
        }
        custom_tooltip = story.201.aa.crystalhunt
    }

    option = { # Special Project
        name = story.201.bb
        owner = {
            if = {
                limit = { is_ai = no }
                capital_scope = {
                    enable_special_project = {
                        name = "CRYSTALS_PROJECT"
                        location = this
                        owner = root.owner
                    }
                }
            }
        }
    }

    option = {
        name = story.201.cc
        trigger = {
            owner = {
                OR = {
                    is_xenophile = yes
                    is_pacifist = yes
                }
            }
        }
        owner = {
            if = {
                limit = { is_ai = no }
                capital_scope = {
                    enable_special_project = {
                        name = "CRYSTALS_PACIFICATION_PROJECT"
                        location = this
                        owner = root.owner
                    }
                }
            }
        }
    }

    after = {
        finish_first_contact_effect = yes
        set_site_progress_locked = no
    }
}

Didn't test it, but it should work.
 
Wow, thank you for this! I wrote in the changed code, and I'll give it a whirl. I just had two questions.

1. Is it necessary to start a new game for these to be implemented?
2. How necessary is indentation to code like this? I tabbed and spaced "if = {" to make it look exactly as you had it here, so that the "r" is directly above the "i." Was that correct?
 
1.) You can just add it an existing save, but it if AIs have already finished the first contact, they will keep the tech.
2.) Doesn't really matter to the game, as long as there's at least one space or tab between the different words. As far as I know, it's for human readability only.

In default formatting, the content between two curly brackets is usually indented with a tab so the different parts of the code can be distinguished from each other at a glance, and syntax errors such as missing curly brackets are easier to spot.
 
Ok, so I’m starting a new save, since my last save was in 2210, and I’m sure that was ample time for the ai to research the plating.

Oneast question. If I’m using Starnet, which alters AI behavior, would that overwrite ehat I did, or is it ok to use?
 
Ok, so I’m starting a new save, since my last save was in 2210, and I’m sure that was ample time for the ai to research the plating.

Oneast question. If I’m using Starnet, which alters AI behavior, would that overwrite ehat I did, or is it ok to use?
put you mod last on the list and it should overwrite Starnet.