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

Empires91

Corporal
57 Badges
Aug 7, 2007
33
0
  • Crusader Kings II
  • Stellaris: Galaxy Edition
  • Stellaris - Path to Destruction bundle
  • Stellaris: Synthetic Dawn
  • Europa Universalis IV: Pre-order
  • Semper Fi
  • Europa Universalis IV: Res Publica
  • Magicka
  • Leviathan: Warships
  • Hearts of Iron III: Their Finest Hour
  • Hearts of Iron III
  • For the Motherland
  • Europa Universalis IV: Call to arms event
  • Europa Universalis IV: Conquest of Paradise
  • Cities in Motion 2
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: The Republic
  • Europa Universalis IV: Wealth of Nations
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: Reapers Due
  • Stellaris: Necroids
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Crusader Kings II: Monks and Mystics
  • Crusader Kings II: Jade Dragon
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Stellaris: Distant Stars
  • Stellaris: Megacorp
  • Crusader Kings II: Holy Fury
  • Imperator: Rome Deluxe Edition
  • Hearts of Iron IV: Colonel
  • Hearts of Iron IV: Cadet
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Stellaris
  • Crusader Kings II: Conclave
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: El Dorado
  • 500k Club
  • Victoria 2: Heart of Darkness
  • Victoria 2: A House Divided
  • Victoria 2
  • Victoria: Revolutions
Hi! I've tried with this command, but all it does is create a bazzilion characters and crash the game.

Code:
while = {
                    limit = {
                        check_variable = {
                            which = count
                            value = 20
                        }
                    }   
                    subtract_variable = {
                        which = count
                        value = 1
                    }
                    create_character = {
                        random_traits = yes
                        dynasty = 8000003
                        female = no
                        age = RANDOM
                        religion = ROOT
                        culture = ROOT
                    }
                }
 
Hi! I've tried with this command, but all it does is create a bazzilion characters and crash the game.

Code:
while = {
                    limit = {
                        check_variable = {
                            which = count
                            value = 20
                        }
                    }  
                    subtract_variable = {
                        which = count
                        value = 1
                    }
                    create_character = {
                        random_traits = yes
                        dynasty = 8000003
                        female = no
                        age = RANDOM
                        religion = ROOT
                        culture = ROOT
                    }
                }
Did you set the variable first ?
 
Does this need to be a previous event?
Not mandatory but maybe easier/more flexible/clearer. You can set it in a on start event f.e.
If not set, your check_variable and substract_variable do nothing, hence why the create_character repeats itself.
 
Not mandatory but maybe easier/more flexible/clearer. You can set it in a on start event f.e.
If not set, your check_variable and substract_variable do nothing, hence why the create_character repeats itself.
Non-existing variables are assumed to be existing but with value zero (that's how save files get optimised). So the above block should never fire, since the check_variable should fail the first time. I don't understand why it would fire infinitely.
 
Non-existing variables are assumed to be existing but with value zero (that's how save files get optimised). So the above block should never fire, since the check_variable should fail the first time. I don't understand why it would fire infinitely.
I guess it assumes it is at zero, so creates it at the first substract, so at -1. Since -1 will always be <20 and so valid it loops forever.