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

gomurr

the ancient
63 Badges
Aug 8, 2011
94
16
  • Magicka
  • Knights of Pen and Paper 2
  • Europa Universalis IV: Mare Nostrum
  • Europa Universalis IV: Pre-order
  • Warlock: Master of the Arcane
  • Rome: Vae Victis
  • Victoria 2: Heart of Darkness
  • Victoria 2: A House Divided
  • Sword of the Stars II
  • Sword of the Stars
  • Rome Gold
  • Europa Universalis IV: Res Publica
  • Impire
  • Hearts of Iron III: Their Finest Hour
  • Hearts of Iron III
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • For the Motherland
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Europa Universalis III: Chronicles
  • A Game of Dwarves
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • Hearts of Iron IV: Together for Victory
  • Stellaris: Digital Anniversary Edition
  • Hearts of Iron IV: Death or Dishonor
  • Crusader Kings II: Monks and Mystics
  • Crusader Kings II: Reapers Due
  • Hearts of Iron IV: Cadet
  • Stellaris Sign-up
  • Stellaris
  • Crusader Kings II: Conclave
  • Europa Universalis IV: Cossacks
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Common Sense
  • Pillars of Eternity
  • Crusader Kings II: Way of Life
  • Pride of Nations
  • Europa Universalis IV: El Dorado
  • 500k Club
  • Victoria 2
  • Supreme Ruler 2020
  • Imperator: Rome - Magna Graecia
Tried to create a name list for randomly generated stars. It works but there's a lot of stars appearing with the name "unreadable string." I've got all multi-word names in quotes like I would got a ship namelist. Not sure what's causing this. Can anyone let me know if they've run into this too, or what its cause is and how to fix it?
 

Rodmar18

General
8 Badges
Sep 19, 2018
1.959
346
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Stellaris: Humanoids Species Pack
  • Stellaris: Distant Stars
  • Stellaris: Synthetic Dawn
Did you add a file in common\random_names\base\ or in localisation_synced\ ?
The former has to be encoded in utf-8 while the later requires utf-8-bom.

While I think that you refer to the former, note that the later adds localization keys and that each single star name has to be in quotes.
What does the error.log file tell about this?
 

gomurr

the ancient
63 Badges
Aug 8, 2011
94
16
  • Magicka
  • Knights of Pen and Paper 2
  • Europa Universalis IV: Mare Nostrum
  • Europa Universalis IV: Pre-order
  • Warlock: Master of the Arcane
  • Rome: Vae Victis
  • Victoria 2: Heart of Darkness
  • Victoria 2: A House Divided
  • Sword of the Stars II
  • Sword of the Stars
  • Rome Gold
  • Europa Universalis IV: Res Publica
  • Impire
  • Hearts of Iron III: Their Finest Hour
  • Hearts of Iron III
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • For the Motherland
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Europa Universalis III: Chronicles
  • A Game of Dwarves
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • Hearts of Iron IV: Together for Victory
  • Stellaris: Digital Anniversary Edition
  • Hearts of Iron IV: Death or Dishonor
  • Crusader Kings II: Monks and Mystics
  • Crusader Kings II: Reapers Due
  • Hearts of Iron IV: Cadet
  • Stellaris Sign-up
  • Stellaris
  • Crusader Kings II: Conclave
  • Europa Universalis IV: Cossacks
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Common Sense
  • Pillars of Eternity
  • Crusader Kings II: Way of Life
  • Pride of Nations
  • Europa Universalis IV: El Dorado
  • 500k Club
  • Victoria 2
  • Supreme Ruler 2020
  • Imperator: Rome - Magna Graecia
Thanks for your reply. I'm altering the 00_random_names file in common\random_names\base. Unfortunately, I don't know what you mean by encoded in utf-8 - previously when I wanted to tweak a file like this I'd just it up in notepad and type in my additions. I've attached the error log, but it doesn't seem to say anything about this. The game may not be registering it as an error - it still creates the star system, it just names it "unreadable string".
 

Attachments

  • error.log
    129,2 KB · Views: 3

Rodmar18

General
8 Badges
Sep 19, 2018
1.959
346
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Stellaris: Humanoids Species Pack
  • Stellaris: Distant Stars
  • Stellaris: Synthetic Dawn
You should have deactivated all the other mods first! :D
I don't see anything concerning that 00_random_names.txt, though.

1) I remember now that I have had a similar issue when localizing some star names: the game can read simple diacritics 'é', but not ligatures 'œ', whereas it can in localization files. I bet that you have issue only on names that include "exotic" polish diacrited characters. If not an oversight, I interpret this as the game using unicode utf-8 encoding overall, but not the older parts of the display engine. Perhaps this vintage code still uses ansi or a western iso encoding. If so, you can't change anything, AFAIK.

2) As I wrote, another reason could be that the game engine can read polish characters, but you are not sending it them with the proper binary code.
Depending on what character a star name is written with, it may be unreadable by the game if the character binary code is not a displayable one. Stellaris uses utf-8, like every modern computer. However, perhaps for some reason, yours, or notepad++ uses another encoding, and you are using another "trick" to display polish characters. Even with problem 1 above, it should be worth to check or set this in notepad++:
Settings -> Preferences -> New document -> Encoding -> choose UTF-8 without BOM

3) I'm not a modder myself, so I can't tell if it's normal to have some error lines in the error.log while you activate a new mod, for example, when overwriting instead of replacing game data (is it normal to have "dirty" mods?), and this is not what you're doing with 00_random_names.txt, but there's a bunch of them in your uploaded file that should benefit from some attention (like not defined modifiers, unknown planet classes, etc).
 
Last edited:

Little Tee

Recruit
24 Badges
Oct 29, 2017
8
7
  • Cities: Skylines - Green Cities
  • Stellaris: Nemesis
  • Stellaris: Necroids
  • Stellaris: Federations
  • Stellaris: Lithoids
  • Stellaris: Ancient Relics
  • Stellaris: Megacorp
  • Cities: Skylines Industries
  • Stellaris: Distant Stars
  • Cities: Skylines - Parklife
  • Stellaris: Apocalypse
  • Stellaris: Humanoids Species Pack
  • Cities: Skylines
  • Cities: Skylines - Mass Transit
  • Stellaris - Path to Destruction bundle
  • Cities: Skylines - Natural Disasters
  • Stellaris: Leviathans Story Pack
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Galaxy Edition
  • Cities: Skylines - Snowfall
  • Cities: Skylines - After Dark
  • Age of Wonders III
  • Stellaris: Synthetic Dawn
  • Stellaris
I'm tinkering with traits. Specifically in relation to habitability.

I've been trying to find a way to create a species trait that independently modifies the values for primary, secondary and tertiary planet habitability separately, rather than just the global pop_environment_tolerance or the specific pc_XXXX_habitability.

Basically, I want to have a species can have its ideal class as any planet, but with separate bonus and malus values applied to primary, secondary and tertiary.

I'd prefer not to have to make a game start event, but equally, if that's the only/best/easiest way to do it, I'd greatly appreciate advice on how to do this.

Also, if there's a better thread for this question, link me to it.
 

Mitchz95

Field Marshal
17 Badges
Feb 4, 2016
3.535
2.571
  • Stellaris: Synthetic Dawn
  • Stellaris: Humanoids Species Pack
  • Stellaris: Nemesis
  • Stellaris: Necroids
  • Stellaris: Federations
  • Stellaris: Lithoids
  • Stellaris: Ancient Relics
  • Stellaris: Megacorp
  • Stellaris: Distant Stars
  • Stellaris: Apocalypse
  • Stellaris
  • Stellaris - Path to Destruction bundle
  • Stellaris: Leviathans Story Pack
  • Stellaris: Digital Anniversary Edition
  • Major Wiki Contributor
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
Vassal Capital

Is there any way through event or console command to move a vassals capital to another planet?

:)

You can use "debugtooltip" and mouse over their flag to find their ID number, then "play <ID>" to take control of the vassal, then change their capital normally, and then "play x" to go back to your original empire.
 

diagrapher

Sergeant
50 Badges
Sep 1, 2019
53
21
  • Europa Universalis IV: Rule Britannia
  • Crusader Kings II: Reapers Due
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Crusader Kings II: Monks and Mystics
  • Stellaris - Path to Destruction bundle
  • Europa Universalis IV: Mandate of Heaven
  • Surviving Mars
  • Age of Wonders III
  • Europa Universalis IV: Cradle of Civilization
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Europa Universalis IV: Rights of Man
  • Stellaris: Distant Stars
  • Europa Universalis IV: Dharma
  • Stellaris: Megacorp
  • Crusader Kings II: Holy Fury
  • Stellaris: Ancient Relics
  • Stellaris: Lithoids
  • Stellaris: Federations
  • Crusader Kings III
  • Stellaris: Necroids
  • Stellaris: Nemesis
  • Europa Universalis IV: Common Sense
  • Europa Universalis IV
  • Europa Universalis IV: El Dorado
  • Crusader Kings II: Way of Life
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Cossacks
  • Crusader Kings II: Conclave
  • Stellaris
  • Stellaris: Galaxy Edition
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Rajas of India
  • Stellaris: Galaxy Edition
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Res Publica
  • Crusader Kings II: Jade Dragon
  • Stellaris: Synthetic Dawn
  • Europa Universalis IV: Third Rome
  • Europa Universalis IV: Mare Nostrum
  • Crusader Kings II
So, I'm making a mod which will a) reduce the point value of ethic_gestalt_consciousness such that gestalts will be able to have other ethics and 2) sometimes change what those other ethics are. If I do that with shift_ethic is there a risk it will remove ethic_gestalt_consciousness?
 

Rostyk.96

Sergeant
6 Badges
Feb 11, 2020
70
67
  • Crusader Kings II
  • Crusader Kings II: Horse Lords
  • Stellaris
  • Surviving Mars
  • Age of Wonders III
  • Surviving Mars: Digital Deluxe Edition
Where files for living standards are located (i dont mean common/species_rights/etc ones), those that define pop consumer goods upkeep and stuff, so i can create new living standard, if thats possible?
 

Mitchz95

Field Marshal
17 Badges
Feb 4, 2016
3.535
2.571
  • Stellaris: Synthetic Dawn
  • Stellaris: Humanoids Species Pack
  • Stellaris: Nemesis
  • Stellaris: Necroids
  • Stellaris: Federations
  • Stellaris: Lithoids
  • Stellaris: Ancient Relics
  • Stellaris: Megacorp
  • Stellaris: Distant Stars
  • Stellaris: Apocalypse
  • Stellaris
  • Stellaris - Path to Destruction bundle
  • Stellaris: Leviathans Story Pack
  • Stellaris: Digital Anniversary Edition
  • Major Wiki Contributor
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
Can anyone help me understand why my custom planet class is invisible (ie has no model)?

Code:
pc_rogue_gas_giant = {
   entity = "gas_giant"
   picture = "pc_gas_giant"
   entity_scale = 14
   icon_frame = 14

   star = yes
   star_gfx = no

   orbit_lines = no
   enable_tilt = no

   chance_of_ring = 0.6
 
   atmosphere_color        = hsv { 0.1 0.15 1.1 }       #DONE
   atmosphere_intensity    = 1.1
   atmosphere_width        = 0.5
 
   spawn_odds = 0
   extra_orbit_size = 1
 
   space_monster_target = yes

   colonizable = no
}

Error log says "Failed to find entity "gas_giant_xx_entity" for planet pc_rogue_gas_giant".

I don't have anything overwriting _planetary_entities.asset, so idk what the problem could be.
 

Rodmar18

General
8 Badges
Sep 19, 2018
1.959
346
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Stellaris: Humanoids Species Pack
  • Stellaris: Distant Stars
  • Stellaris: Synthetic Dawn
Can anyone help me understand why my custom planet class is invisible (ie has no model)?

Error log says "Failed to find entity "gas_giant_xx_entity" for planet pc_rogue_gas_giant".

I don't have anything overwriting _planetary_entities.asset, so idk what the problem could be.
Sorry for this uninformed contribution, but this aroused my curiosity.
As you know, there are no "gas_giant" entity (nor any "tundra_planet", etc) defined in files. My guess would be that this shorten form calls for a randomization between all existing "gas_giant_xx_entity" defined in _planetary_entities.asset (or between all existing "tundra_planet_xx_entity). The question is why this doesn't work for you. Perhaps the randomization is only possible for known planetary classes, or for planetary classes that are in a special file in a special folder.

Did you try to use A) one of the existing gas giant entities (explicitly), or B) the same file as a renamed custom entity?

I don't have Planetary Diversity currently installed, but Real Space always use custom entities for its new planet class (stars, actually) (granted, they are new types, so it's no wonder)
 

Mitchz95

Field Marshal
17 Badges
Feb 4, 2016
3.535
2.571
  • Stellaris: Synthetic Dawn
  • Stellaris: Humanoids Species Pack
  • Stellaris: Nemesis
  • Stellaris: Necroids
  • Stellaris: Federations
  • Stellaris: Lithoids
  • Stellaris: Ancient Relics
  • Stellaris: Megacorp
  • Stellaris: Distant Stars
  • Stellaris: Apocalypse
  • Stellaris
  • Stellaris - Path to Destruction bundle
  • Stellaris: Leviathans Story Pack
  • Stellaris: Digital Anniversary Edition
  • Major Wiki Contributor
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
Sorry for this uninformed contribution, but this aroused my curiosity.
As you know, there are no "gas_giant" entity (nor any "tundra_planet", etc) defined in files. My guess would be that this shorten form calls for a randomization between all existing "gas_giant_xx_entity" defined in _planetary_entities.asset (or between all existing "tundra_planet_xx_entity). The question is why this doesn't work for you. Perhaps the randomization is only possible for known planetary classes, or for planetary classes that are in a special file in a special folder.

Did you try to use A) one of the existing gas giant entities (explicitly), or B) the same file as a renamed custom entity?

I don't have Planetary Diversity currently installed, but Real Space always use custom entities for its new planet class (stars, actually) (granted, they are new types, so it's no wonder)

Using an explicit entity did the trick! Thank you so much! :D
 

17blue17

Field Marshal
68 Badges
Nov 9, 2003
6.597
379
  • Stellaris: Galaxy Edition
  • Cities: Skylines
  • Cities: Skylines Deluxe Edition
  • Europa Universalis III: Collection
  • Europa Universalis IV: El Dorado
  • Europa Universalis IV: Pre-order
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Cossacks
  • Crusader Kings II: Conclave
  • Europa Universalis IV: Mare Nostrum
  • Stellaris
  • 500k Club
  • Stellaris: Galaxy Edition
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV: Colonel
  • Europa Universalis IV: Rights of Man
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Hearts of Iron IV: Together for Victory
  • Stellaris - Path to Destruction bundle
  • Europa Universalis IV: Mandate of Heaven
  • Europa Universalis IV: Third Rome
  • Hearts of Iron IV: Death or Dishonor
  • Stellaris: Nemesis
  • Europa Universalis IV: Conquest of Paradise
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Europa Universalis III
  • Divine Wind
  • Europa Universalis IV
  • Europa Universalis IV: Art of War
  • Crusader Kings II
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Call to arms event
  • Heir to the Throne
  • Europa Universalis III Complete
  • Leviathan: Warships
  • Europa Universalis III Complete
  • Europa Universalis IV: Res Publica
  • Victoria: Revolutions
  • Victoria 2
  • Victoria 2: A House Divided
Two questions please :)

1) Create Fleet using while

I want an event to create colony ships - specifically if I have less than 10 then create 10. I know how to do a one time event but when I try to do a simple event using WHILE it never seems to make more than 1 and I have no idea on how to do the trigger to check how many I have. So taking the event below that works how can I change it to add the trigger I want and do the while part?

Code:
country_event = {
    id = steveships.31
    hide_window = yes
         
    trigger = {
        is_ai = no
        has_country_flag = steve_battleship_design_ready
        NOT = { has_country_flag = steve_colony_ship1 }
    }
 
    immediate = {
        set_country_flag = steve_colony_ship1
     
        capital_scope = {
            create_fleet = {
                name = "HMS Colony Ship 1"
                effect = {
                    set_owner = root
                    while = {
                        count = 1
                        create_ship = {
                            name = random
                            random_existing_design = colonizer
                            graphical_culture = "humanoid_01"
                        }
                    }
                }
            }
            create_fleet = {
                name = "HMS Colony Ship 2"
                effect = {
                    set_owner = root
                    while = {
                        count = 1
                        create_ship = {
                            name = random
                            random_existing_design = colonizer
                            graphical_culture = "humanoid_01"
                        }
                    }
                }
            }
            create_fleet = {
                name = "HMS Colony Ship 3"
                effect = {
                    set_owner = root
                    while = {
                        count = 1
                        create_ship = {
                            name = random
                            random_existing_design = colonizer
                            graphical_culture = "humanoid_01"
                        }
                    }
                }
            }
            create_fleet = {
                name = "HMS Colony Ship 4"
                effect = {
                    set_owner = root
                    while = {
                        count = 1
                        create_ship = {
                            name = random
                            random_existing_design = colonizer
                            graphical_culture = "humanoid_01"
                        }
                    }
                }
            }
            create_fleet = {
                name = "HMS Colony Ship 5"
                effect = {
                    set_owner = root
                    while = {
                        count = 1
                        create_ship = {
                            name = random
                            random_existing_design = colonizer
                            graphical_culture = "humanoid_01"
                        }
                    }
                }
            }
            create_fleet = {
                name = "HMS Colony Ship 6"
                effect = {
                    set_owner = root
                    while = {
                        count = 1
                        create_ship = {
                            name = random
                            random_existing_design = colonizer
                            graphical_culture = "humanoid_01"
                        }
                    }
                }
            }
            create_fleet = {
                name = "HMS Colony Ship 7"
                effect = {
                    set_owner = root
                    while = {
                        count = 1
                        create_ship = {
                            name = random
                            random_existing_design = colonizer
                            graphical_culture = "humanoid_01"
                        }
                    }
                }
            }
            create_fleet = {
                name = "HMS Colony Ship 8"
                effect = {
                    set_owner = root
                    while = {
                        count = 1
                        create_ship = {
                            name = random
                            random_existing_design = colonizer
                            graphical_culture = "humanoid_01"
                        }
                    }
                }
            }
            create_fleet = {
                name = "HMS Colony Ship 9"
                effect = {
                    set_owner = root
                    while = {
                        count = 1
                        create_ship = {
                            name = random
                            random_existing_design = colonizer
                            graphical_culture = "humanoid_01"
                        }
                    }
                }
            }
            create_fleet = {
                name = "HMS Colony Ship 10"
                effect = {
                    set_owner = root
                    while = {
                        count = 1
                        create_ship = {
                            name = random
                            random_existing_design = colonizer
                            graphical_culture = "humanoid_01"
                        }
                    }
                }
            }
        }
    }
}


2) Fallen Empires

Edit: apparnently holy guardians use the fallen empire trigger and are not included in the awaken empire trigger.


After Fallen Empires have awaken I have some events to make them stronger but it does not seem to work for all awaken empires - for example the swarm and holy guardian and I am trying to figure out why.

For example the first event covers:

Code:
OR = {
            has_ai_personality = awakened_fallen_empire_spiritualist     # Doctrinal Enforcers
            has_ai_personality = awakened_fallen_empire_materialist     # Watchful Regulators
            has_ai_personality = awakened_fallen_empire_xenophobe         # Jingoistic Reclaimers
            has_ai_personality = awakened_fallen_empire_xenophile        # Benevolent Interventionists
        }

and this seems to work

The second event is supposed to cover the other fallen empires and does not seem to cover them all:

Code:
         is_country_type = awakened_fallen_empire
        NOR = {
            has_ai_personality = awakened_fallen_empire_spiritualist     # Doctrinal Enforcers
            has_ai_personality = awakened_fallen_empire_materialist     # Watchful Regulators
            has_ai_personality = awakened_fallen_empire_xenophobe         # Jingoistic Reclaimers
            has_ai_personality = awakened_fallen_empire_xenophile        # Benevolent Interventionists
        }

why would the swam and holy guardian not be included in this second event? Are they not considered awakened empires???


thanks
 
Last edited:

Rodmar18

General
8 Badges
Sep 19, 2018
1.959
346
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Stellaris: Humanoids Species Pack
  • Stellaris: Distant Stars
  • Stellaris: Synthetic Dawn
You should start with the Paradox Wiki. There are no thoroughful examples, and it's not a tutorial, but it covers all aspects of modding, and it's quite encyclopedic.

Then you have existing mods. At first, dowload the simplest ones and study them: their description, organization, and scripts. Much can be learned this way.

The error.log file in /Paradox Interactive/Stellaris/logs is a source of knowledge as well: reported errors are quite detailed, and you'll see how many mods aren't "clean", or rather (?), how they became obsolete the more the game has evolved.

Have a good character string file finder (such as grep on GNU/Linux).

And stay tune to this thread!
 
Last edited:

Rodmar18

General
8 Badges
Sep 19, 2018
1.959
346
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Stellaris: Humanoids Species Pack
  • Stellaris: Distant Stars
  • Stellaris: Synthetic Dawn
I want an event to create colony ships - specifically if I have less than 10 then create 10. I know how to do a one time event but when I try to do a simple event using WHILE it never seems to make more than 1 and I have no idea on how to do the trigger to check how many I have. So taking the event below that works how can I change it to add the trigger I want and do the while part?

Code:
    immediate = {
        set_country_flag = steve_colony_ship1
   
        capital_scope = {
            create_fleet = {
                name = "HMS Colony Ship 1"
                effect = {
                    set_owner = root
                    while = {
                        count = 1
                        create_ship = {
                            name = random
                            random_existing_design = colonizer
                            graphical_culture = "humanoid_01"
                        }
                    }
                }
            }
   (...)
1) I don't know why you're using a "while = {}" loop to spam but one single ship each time.

2) Why don't you use an encompassing "while = {}" loop to actually have a looped action, like:
(just guessing because of my general programming skills; never tried this on a mod)
Code:
while  = {count = 10 create_fleet = {}}
3) You want to add a limiting trigger (number < 10). If you just want to build 10 ships out of 0, you could study events that spawn fleets, rather.
If you really need to increment a variable and test its value, I guess that you could create a local variable. Look at the wiki (set_variable) for the syntax and possible operations.


why would the swam and holy guardian not be included in this second event? Are they not considered awakened empires???
Apparently, the Swarm is considered a country. Perhaps testing a country type instead of an ai type would work.

For both issues, check on_action_events.txt (e.g.). Good luck.
 

17blue17

Field Marshal
68 Badges
Nov 9, 2003
6.597
379
  • Stellaris: Galaxy Edition
  • Cities: Skylines
  • Cities: Skylines Deluxe Edition
  • Europa Universalis III: Collection
  • Europa Universalis IV: El Dorado
  • Europa Universalis IV: Pre-order
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Cossacks
  • Crusader Kings II: Conclave
  • Europa Universalis IV: Mare Nostrum
  • Stellaris
  • 500k Club
  • Stellaris: Galaxy Edition
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV: Colonel
  • Europa Universalis IV: Rights of Man
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Hearts of Iron IV: Together for Victory
  • Stellaris - Path to Destruction bundle
  • Europa Universalis IV: Mandate of Heaven
  • Europa Universalis IV: Third Rome
  • Hearts of Iron IV: Death or Dishonor
  • Stellaris: Nemesis
  • Europa Universalis IV: Conquest of Paradise
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Europa Universalis III
  • Divine Wind
  • Europa Universalis IV
  • Europa Universalis IV: Art of War
  • Crusader Kings II
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Call to arms event
  • Heir to the Throne
  • Europa Universalis III Complete
  • Leviathan: Warships
  • Europa Universalis III Complete
  • Europa Universalis IV: Res Publica
  • Victoria: Revolutions
  • Victoria 2
  • Victoria 2: A House Divided
1) I don't know why you're using a "while = {}" loop to spam but one single ship each time.

2) Why don't you use an encompassing "while = {}" loop to actually have a looped action, like:
(just guessing because of my general programming skills; never tried this on a mod)
Code:
while  = {count = 10 create_fleet = {}}
3) You want to add a limiting trigger (number < 10). If you just want to build 10 ships out of 0, you could study events that spawn fleets, rather.
If you really need to increment a variable and test its value, I guess that you could create a local variable. Look at the wiki (set_variable) for the syntax and possible operations.


Apparently, the Swarm is considered a country. Perhaps testing a country type instead of an ai type would work.

For both issues, check on_action_events.txt (e.g.). Good luck.

thank you for responding to my questions. :)

I had tried a encompassing while in the past and it did not work but when I try again it now works so I must have done something wrong the first time. So thanks for the suggestion.

The individual while with 1 was code I copied from an event for battle ships that did have more than 1 and I simply cut and pasted. I have corrected for the colony ships.

I always try to look at the existing code but I will do some more looking to see if I can find the trigger I want.

Thanks again.

EDIT: count_owned_ships is the trigger I was looking for.

Code:
# Colony Ships Auto Build
country_event = {
    id = steveships.32
    hide_window = yes
   
    is_triggered_only = yes  # Country Monthly Pulse
   
    trigger = {
        is_ai = no
        has_country_flag = steve_battleship_design_ready
        count_owned_ships = {
            limit = {
                is_ship_class = shipclass_colonizer
                is_fleet_idle = yes
            }
            count < 10   
        }
    }
   
    immediate = {
        capital_scope = {
            while = {
                count = 15 # usually end up with 30 after two months due to travel delay
                create_fleet = {
                    effect = {
                        set_owner = root
                        create_ship = {
                            name = random
                            random_existing_design = colonizer
                            graphical_culture = "humanoid_01"
                        }
                    }
                }
            }
        }
    }
}
 
Last edited:

Wise Strategist

First Lieutenant
78 Badges
Aug 12, 2007
271
125
  • Stellaris: Synthetic Dawn
  • King Arthur II
  • Europa Universalis III Complete
  • Europa Universalis IV: Res Publica
  • Europa Universalis: Rome
  • Sengoku
  • Sword of the Stars II
  • Stellaris - Path to Destruction bundle
  • Europa Universalis IV: Third Rome
  • Crusader Kings II: Charlemagne
  • Europa Universalis IV: Pre-order
  • Crusader Kings II: Jade Dragon
  • Cities: Skylines - After Dark
  • Europa Universalis IV: Cossacks
  • Cities: Skylines - Snowfall
  • Europa Universalis IV: Mare Nostrum
  • Stellaris
  • Hearts of Iron III
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Europa Universalis III
  • Divine Wind
  • Crusader Kings II
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis III Complete
  • Crusader Kings II: Monks and Mystics
  • Cities: Skylines - Mass Transit
  • Cities: Skylines - Natural Disasters
  • Stellaris: Leviathans Story Pack
  • Stellaris: Digital Anniversary Edition
  • Europa Universalis IV: Rights of Man
  • Europa Universalis IV: Mandate of Heaven
  • Crusader Kings II: Reapers Due
  • Hearts of Iron IV: Cadet
  • Stellaris Sign-up
  • Crusader Kings II: Conclave
  • Stellaris: Nemesis
  • Crusader Kings II: Way of Life
  • Mount & Blade: Warband
  • Europa Universalis IV: El Dorado
  • 500k Club
  • Rome: Vae Victis
  • Victoria 2
I'm running into an odd situation with trying to mod 05_species_controls.
I've been try to make it where vassals will be forced to give species the same rights as their overlord. I've been successful so far, but when trying mod in a condition for migration rights, the game for whatever reason will not read pass the ai_will_do and consider it some kind of error, living colonization rights and population controls out of the game entirely.
However, if double up, the condition like in the spoiler, than error doesn't occur, but the script also doesn't as I'm try to get to do. It supposed to make it to where vassal can only give a species migration rights if the overlord does.

Can some help me out here and tell me what I may be doing wrong?
Code:
NAND = {
            has_citizenship_type = { country = from type = citizenship_slavery }
            OR = {
                has_slavery_type = { country = from type = slavery_livestock }
                has_slavery_type = { country = from type = slavery_matrix }
            }
            if = {
                limit = {
                    from = { is_subject = yes }
                }
                from = {
                    overlord = {
                        NOT = {    has_authority = auth_machine_intelligence }
                        PREVPREV = {
                            has_migration_control = {
                                value = no
                                country = PREV
                            }
                        }
                    }
                }
            }
            if = {
                limit = {
                    from = { is_subject = yes }
                }
                from = {
                    overlord = {
                        NOT = {    has_authority = auth_machine_intelligence }
                        PREVPREV = {
                            has_migration_control = {
                                value = no
                                country = PREV
                            }
                        }
                    }
                }
            }
        }
 
Last edited: