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

Silversweeeper

Ichi no Hito
58 Badges
Aug 24, 2012
3.943
2.840
  • Stellaris - Path to Destruction bundle
  • 500k Club
  • Europa Universalis IV: El Dorado
  • Magicka: Wizard Wars Founder Wizard
  • Crusader Kings II: Way of Life
  • Pillars of Eternity
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Cossacks
  • Crusader Kings II: Conclave
  • Europa Universalis IV: Mandate of Heaven
  • Stellaris
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Crusader Kings II: Monks and Mystics
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Rights of Man
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Stellaris: Distant Stars
  • Stellaris: Nemesis
  • Stellaris: Necroids
  • Stellaris: Federations
  • Stellaris: Lithoids
  • Stellaris: Ancient Relics
  • Imperator: Rome Sign Up
  • Imperator: Rome Deluxe Edition
  • Crusader Kings II: Holy Fury
  • Stellaris: Megacorp
  • Europa Universalis IV
  • Stellaris: Apocalypse
  • Stellaris: Humanoids Species Pack
  • Europa Universalis IV: Cradle of Civilization
  • Europa Universalis III Complete
  • Europa Universalis III Complete
  • Europa Universalis IV: Mare Nostrum
  • Crusader Kings II: Charlemagne
  • Stellaris Sign-up
  • Europa Universalis IV: Third Rome
  • Europa Universalis IV: Res Publica
  • Crusader Kings II
  • 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 Complete
  • Magicka
Is it still impossible to change birth gender ratio, or to determine what gender a child will be at birth? It was impossible a couple years ago according to thread/forum search, and I'm guessing it still is.

I know there's a gender change command, but unless there's a way to enact it before the player gets the notification that a baby of x gender is born, it doesn't work for my purposes.

I don't believe it has changed.
 

GodModder

First Lieutenant
39 Badges
May 10, 2021
282
41
  • Shadowrun Returns
  • Stellaris: Leviathans Story Pack
  • Crusader Kings II: Monks and Mystics
  • Stellaris - Path to Destruction bundle
  • Stellaris: Synthetic Dawn
  • Age of Wonders III
  • Crusader Kings II: Jade Dragon
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Stellaris: Distant Stars
  • Stellaris: Digital Anniversary Edition
  • Shadowrun: Hong Kong
  • Stellaris: Megacorp
  • Crusader Kings II: Holy Fury
  • Stellaris: Ancient Relics
  • Stellaris: Lithoids
  • Stellaris: Federations
  • Crusader Kings III
  • Stellaris: Necroids
  • Stellaris: Nemesis
  • Crusader Kings II: Way of Life
  • 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
  • Majesty 2 Collection
  • Crusader Kings II
  • Pillars of Eternity
  • Magicka 2
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Conclave
  • Stellaris
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Crusader Kings II: Reapers Due
I'm having trouble figuring out how to apply commands to scopes that aren't characters. I've made an event with an option to force a surrender, but I'm not sure how to end the war in question.

The trigger works, because when the target is in a defensive war, the option shows up, but my various attempts to construct the command cause the game to crash when the option is selected.

Code:
option = { # Demand they surrender their defensive war(s)
        name = EVTOPTB_D3_2006
        trigger = {
            any_war = {
                event_target:awe_target = { is_primary_war_defender = yes }
            }
        }
        any_war = {
            limit = { event_target:awe_target = { is_primary_war_defender = yes } }
            end_war = success
        }
    }
 

Whizzer

CKPlus Triumvirate
77 Badges
Jun 17, 2014
1.621
793
  • Semper Fi
  • Hearts of Iron III Collection
  • Heir to the Throne
  • King Arthur II
  • Knights of Pen and Paper +1 Edition
  • Leviathan: Warships
  • The Kings Crusade
  • Magicka
  • Victoria: Revolutions
  • Rome Gold
  • Cities in Motion
  • Sengoku
  • Sword of the Stars
  • Sword of the Stars II
  • Victoria 2
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • Rome: Vae Victis
  • Warlock: Master of the Arcane
  • Europa Universalis IV: Mare Nostrum
  • Hearts of Iron III
  • A Game of Dwarves
  • Cities in Motion 2
  • 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
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sword of Islam
  • Dungeonland
  • Crusader Kings II: Sunset Invasion
  • Europa Universalis III
  • Divine Wind
  • Hearts of Iron III: Their Finest Hour
  • For the Motherland
  • Europa Universalis IV: Rights of Man
  • Crusader Kings II: Reapers Due
  • Crusader Kings II: Conclave
  • Crusader Kings II: Monks and Mystics
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Way of Life
  • Magicka: Wizard Wars Founder Wizard
  • Europa Universalis IV: El Dorado
  • Cities: Skylines
  • War of the Roses
  • Crusader Kings III
  • Europa Universalis IV
I'm having trouble figuring out how to apply commands to scopes that aren't characters. I've made an event with an option to force a surrender, but I'm not sure how to end the war in question.

The trigger works, because when the target is in a defensive war, the option shows up, but my various attempts to construct the command cause the game to crash when the option is selected.

Code:
option = { # Demand they surrender their defensive war(s)
        name = EVTOPTB_D3_2006
        trigger = {
            any_war = {
                event_target:awe_target = { is_primary_war_defender = yes }
            }
        }
        any_war = {
            limit = { event_target:awe_target = { is_primary_war_defender = yes } }
            end_war = success
        }
    }
Try this:
Code:
option = { # Demand they surrender their defensive war(s)
    name = EVTOPTB_D3_2006
    trigger = {
        any_war = {
            attacker = { character = event_target:awe_target }
        }
    }
        
    any_war = {
        limit = { attacker = { character = event_target:awe_target } }
        end_war = success
    }
}
 

GodModder

First Lieutenant
39 Badges
May 10, 2021
282
41
  • Shadowrun Returns
  • Stellaris: Leviathans Story Pack
  • Crusader Kings II: Monks and Mystics
  • Stellaris - Path to Destruction bundle
  • Stellaris: Synthetic Dawn
  • Age of Wonders III
  • Crusader Kings II: Jade Dragon
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Stellaris: Distant Stars
  • Stellaris: Digital Anniversary Edition
  • Shadowrun: Hong Kong
  • Stellaris: Megacorp
  • Crusader Kings II: Holy Fury
  • Stellaris: Ancient Relics
  • Stellaris: Lithoids
  • Stellaris: Federations
  • Crusader Kings III
  • Stellaris: Necroids
  • Stellaris: Nemesis
  • Crusader Kings II: Way of Life
  • 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
  • Majesty 2 Collection
  • Crusader Kings II
  • Pillars of Eternity
  • Magicka 2
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Conclave
  • Stellaris
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Crusader Kings II: Reapers Due
Try this:
Code:
option = { # Demand they surrender their defensive war(s)
    name = EVTOPTB_D3_2006
    trigger = {
        any_war = {
            attacker = { character = event_target:awe_target }
        }
    }
       
    any_war = {
        limit = { attacker = { character = event_target:awe_target } }
        end_war = success
    }
}
Thank you! That worked, except I changed attacker to defender. So it looks like the solution was to use a scope rather than a condition. Makes sense when I think about it. Scripting gives me a headache, lol.
 

Silversweeeper

Ichi no Hito
58 Badges
Aug 24, 2012
3.943
2.840
  • Stellaris - Path to Destruction bundle
  • 500k Club
  • Europa Universalis IV: El Dorado
  • Magicka: Wizard Wars Founder Wizard
  • Crusader Kings II: Way of Life
  • Pillars of Eternity
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Cossacks
  • Crusader Kings II: Conclave
  • Europa Universalis IV: Mandate of Heaven
  • Stellaris
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Crusader Kings II: Monks and Mystics
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Rights of Man
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Stellaris: Distant Stars
  • Stellaris: Nemesis
  • Stellaris: Necroids
  • Stellaris: Federations
  • Stellaris: Lithoids
  • Stellaris: Ancient Relics
  • Imperator: Rome Sign Up
  • Imperator: Rome Deluxe Edition
  • Crusader Kings II: Holy Fury
  • Stellaris: Megacorp
  • Europa Universalis IV
  • Stellaris: Apocalypse
  • Stellaris: Humanoids Species Pack
  • Europa Universalis IV: Cradle of Civilization
  • Europa Universalis III Complete
  • Europa Universalis III Complete
  • Europa Universalis IV: Mare Nostrum
  • Crusader Kings II: Charlemagne
  • Stellaris Sign-up
  • Europa Universalis IV: Third Rome
  • Europa Universalis IV: Res Publica
  • Crusader Kings II
  • 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 Complete
  • Magicka
Spawning great works via decisions or events would be possible? or the only way to insert great works is editing province history files?

It's definitely possible; simply use "build_wonder = <wonder>" in the relevant province scope.
 
  • 1
Reactions:

GodModder

First Lieutenant
39 Badges
May 10, 2021
282
41
  • Shadowrun Returns
  • Stellaris: Leviathans Story Pack
  • Crusader Kings II: Monks and Mystics
  • Stellaris - Path to Destruction bundle
  • Stellaris: Synthetic Dawn
  • Age of Wonders III
  • Crusader Kings II: Jade Dragon
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Stellaris: Distant Stars
  • Stellaris: Digital Anniversary Edition
  • Shadowrun: Hong Kong
  • Stellaris: Megacorp
  • Crusader Kings II: Holy Fury
  • Stellaris: Ancient Relics
  • Stellaris: Lithoids
  • Stellaris: Federations
  • Crusader Kings III
  • Stellaris: Necroids
  • Stellaris: Nemesis
  • Crusader Kings II: Way of Life
  • 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
  • Majesty 2 Collection
  • Crusader Kings II
  • Pillars of Eternity
  • Magicka 2
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Conclave
  • Stellaris
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Crusader Kings II: Reapers Due
So I was planning to implement a custom decision that would use spawn_unit to create units in a targeted province, i.e. whatever province's county title the player right-clicks on and selects the decision from. But then I reread the spawn_unit command on the wiki and it says it's a character scope, not a province scope. Is there any way I might be able to work around this and get units to spawn via decision in whatever province the player chooses?
 

Silversweeeper

Ichi no Hito
58 Badges
Aug 24, 2012
3.943
2.840
  • Stellaris - Path to Destruction bundle
  • 500k Club
  • Europa Universalis IV: El Dorado
  • Magicka: Wizard Wars Founder Wizard
  • Crusader Kings II: Way of Life
  • Pillars of Eternity
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Cossacks
  • Crusader Kings II: Conclave
  • Europa Universalis IV: Mandate of Heaven
  • Stellaris
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Crusader Kings II: Monks and Mystics
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Rights of Man
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Stellaris: Distant Stars
  • Stellaris: Nemesis
  • Stellaris: Necroids
  • Stellaris: Federations
  • Stellaris: Lithoids
  • Stellaris: Ancient Relics
  • Imperator: Rome Sign Up
  • Imperator: Rome Deluxe Edition
  • Crusader Kings II: Holy Fury
  • Stellaris: Megacorp
  • Europa Universalis IV
  • Stellaris: Apocalypse
  • Stellaris: Humanoids Species Pack
  • Europa Universalis IV: Cradle of Civilization
  • Europa Universalis III Complete
  • Europa Universalis III Complete
  • Europa Universalis IV: Mare Nostrum
  • Crusader Kings II: Charlemagne
  • Stellaris Sign-up
  • Europa Universalis IV: Third Rome
  • Europa Universalis IV: Res Publica
  • Crusader Kings II
  • 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 Complete
  • Magicka
So I was planning to implement a custom decision that would use spawn_unit to create units in a targeted province, i.e. whatever province's county title the player right-clicks on and selects the decision from. But then I reread the spawn_unit command on the wiki and it says it's a character scope, not a province scope. Is there any way I might be able to work around this and get units to spawn via decision in whatever province the player chooses?

Yes.

Code:
<potential, from_potential, allow, etc.>
effect = {
    # ROOT is a county
    capital_scope = {
        save_event_target_as = spawn_province
    }
    FROM = { # Decision-taker
        spawn_unit = {
            <other stuff>
            location = event_target:spawn_province
        }
    }
}

You can also do it without an event target by having the FROM bit inside the capital_scope, with "location = PREVPREV" in that case.
 

GodModder

First Lieutenant
39 Badges
May 10, 2021
282
41
  • Shadowrun Returns
  • Stellaris: Leviathans Story Pack
  • Crusader Kings II: Monks and Mystics
  • Stellaris - Path to Destruction bundle
  • Stellaris: Synthetic Dawn
  • Age of Wonders III
  • Crusader Kings II: Jade Dragon
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Stellaris: Distant Stars
  • Stellaris: Digital Anniversary Edition
  • Shadowrun: Hong Kong
  • Stellaris: Megacorp
  • Crusader Kings II: Holy Fury
  • Stellaris: Ancient Relics
  • Stellaris: Lithoids
  • Stellaris: Federations
  • Crusader Kings III
  • Stellaris: Necroids
  • Stellaris: Nemesis
  • Crusader Kings II: Way of Life
  • 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
  • Majesty 2 Collection
  • Crusader Kings II
  • Pillars of Eternity
  • Magicka 2
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Conclave
  • Stellaris
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Crusader Kings II: Reapers Due
Yes.

Code:
<potential, from_potential, allow, etc.>
effect = {
    # ROOT is a county
    capital_scope = {
        save_event_target_as = spawn_province
    }
    FROM = { # Decision-taker
        spawn_unit = {
            <other stuff>
            location = event_target:spawn_province
        }
    }
}

You can also do it without an event target by having the FROM bit inside the capital_scope, with "location = PREVPREV" in that case.
Thank you! If I understand right, selecting the right potential parameters will make it scope to a county, and capital_scope will necessarily return that county because it is its own capital?
 

Whizzer

CKPlus Triumvirate
77 Badges
Jun 17, 2014
1.621
793
  • Semper Fi
  • Hearts of Iron III Collection
  • Heir to the Throne
  • King Arthur II
  • Knights of Pen and Paper +1 Edition
  • Leviathan: Warships
  • The Kings Crusade
  • Magicka
  • Victoria: Revolutions
  • Rome Gold
  • Cities in Motion
  • Sengoku
  • Sword of the Stars
  • Sword of the Stars II
  • Victoria 2
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • Rome: Vae Victis
  • Warlock: Master of the Arcane
  • Europa Universalis IV: Mare Nostrum
  • Hearts of Iron III
  • A Game of Dwarves
  • Cities in Motion 2
  • 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
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sword of Islam
  • Dungeonland
  • Crusader Kings II: Sunset Invasion
  • Europa Universalis III
  • Divine Wind
  • Hearts of Iron III: Their Finest Hour
  • For the Motherland
  • Europa Universalis IV: Rights of Man
  • Crusader Kings II: Reapers Due
  • Crusader Kings II: Conclave
  • Crusader Kings II: Monks and Mystics
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Way of Life
  • Magicka: Wizard Wars Founder Wizard
  • Europa Universalis IV: El Dorado
  • Cities: Skylines
  • War of the Roses
  • Crusader Kings III
  • Europa Universalis IV
Thank you! If I understand right, selecting the right potential parameters will make it scope to a county, and capital_scope will necessarily return that county because it is its own capital?
capital_scope links to a province, in this case, the one belonging to that county. An alternative would be location.
 

GodModder

First Lieutenant
39 Badges
May 10, 2021
282
41
  • Shadowrun Returns
  • Stellaris: Leviathans Story Pack
  • Crusader Kings II: Monks and Mystics
  • Stellaris - Path to Destruction bundle
  • Stellaris: Synthetic Dawn
  • Age of Wonders III
  • Crusader Kings II: Jade Dragon
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Stellaris: Distant Stars
  • Stellaris: Digital Anniversary Edition
  • Shadowrun: Hong Kong
  • Stellaris: Megacorp
  • Crusader Kings II: Holy Fury
  • Stellaris: Ancient Relics
  • Stellaris: Lithoids
  • Stellaris: Federations
  • Crusader Kings III
  • Stellaris: Necroids
  • Stellaris: Nemesis
  • Crusader Kings II: Way of Life
  • 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
  • Majesty 2 Collection
  • Crusader Kings II
  • Pillars of Eternity
  • Magicka 2
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Conclave
  • Stellaris
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Crusader Kings II: Reapers Due
I'm making a society power allowing you to build a holding of your choice in any province that has an empty holding slot. The power itself works, but after that test I tried to limit the potential to a province that the player controls, rather than any province, and I can't seem to do this. Either the power appears on every province still, or it doesn't appear at all. Here's the decision in question:

Code:
god_society_construction = {
        is_in_society = yes
    
        from_potential = {
            society_rank = {
                society = god_society
                rank = 1
            }
        }
    
        potential = {
            any_province = {
                owned_by = FROMFROM
                num_of_empty_holdings > 0
            }
        }
    
        allow = {
            FROM = {
                society_currency >= 100 #need 100 society currency, can be anything
                trait = divine
            }
        }
    
        effect = {
            # ROOT is a county
            capital_scope = {
                save_event_target_as = construction_province
            }
            FROM = { # Decision-taker
                character_event = { id = D3.2017 }
                change_society_currency = -100
            }
        }
    
        ai_will_do = {
            factor = 0
        }
    }

The owned_by line is the difficulty. When I first tested the power, that line wasn't in there, and the power works fine, albeit in every province with an empty slot instead of just those the player controls.

I've tried owned_by = FROM, and FROMFROM, and PREV, but those still makes it constructible in every province with an empty slot.

I tried doing owned_by = { any_player } and owned_by = { any_playable_ruler = { ai = no } } but the game choked on that, with the Validator saying I can't give owned_by "a complex type".

I also tried doing variations with any_realm_province instead of any_province and in those cases the power doesn't show up in-game at all.

I'm stumped.
 
Last edited:

swampy111

Second Lieutenant
10 Badges
Apr 3, 2019
146
13
  • Cities: Skylines
  • Magicka 2
  • Cities: Skylines - Parklife
  • Shadowrun Returns
  • Prison Architect
  • Crusader Kings III
  • Crusader Kings II
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Sons of Abraham
  • Magicka
Is it still impossible to change birth gender ratio, or to determine what gender a child will be at birth? It was impossible a couple years ago according to thread/forum search, and I'm guessing it still is.

I know there's a gender change command, but unless there's a way to enact it before the player gets the notification that a baby of x gender is born, it doesn't work for my purposes.
there's a mod that already does that. I think it's Mystical Selection or something. It's on both Steam and LL -- perhaps checking it out will help you
 

Whizzer

CKPlus Triumvirate
77 Badges
Jun 17, 2014
1.621
793
  • Semper Fi
  • Hearts of Iron III Collection
  • Heir to the Throne
  • King Arthur II
  • Knights of Pen and Paper +1 Edition
  • Leviathan: Warships
  • The Kings Crusade
  • Magicka
  • Victoria: Revolutions
  • Rome Gold
  • Cities in Motion
  • Sengoku
  • Sword of the Stars
  • Sword of the Stars II
  • Victoria 2
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • Rome: Vae Victis
  • Warlock: Master of the Arcane
  • Europa Universalis IV: Mare Nostrum
  • Hearts of Iron III
  • A Game of Dwarves
  • Cities in Motion 2
  • 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
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sword of Islam
  • Dungeonland
  • Crusader Kings II: Sunset Invasion
  • Europa Universalis III
  • Divine Wind
  • Hearts of Iron III: Their Finest Hour
  • For the Motherland
  • Europa Universalis IV: Rights of Man
  • Crusader Kings II: Reapers Due
  • Crusader Kings II: Conclave
  • Crusader Kings II: Monks and Mystics
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Way of Life
  • Magicka: Wizard Wars Founder Wizard
  • Europa Universalis IV: El Dorado
  • Cities: Skylines
  • War of the Roses
  • Crusader Kings III
  • Europa Universalis IV
I'm making a society power allowing you to build a holding of your choice in any province that has an empty holding slot. The power itself works, but after that test I tried to limit the potential to a province that the player controls, rather than any province, and I can't seem to do this. Either the power appears on every province still, or it doesn't appear at all. Here's the decision in question:

Code:
god_society_construction = {
        is_in_society = yes
   
        from_potential = {
            society_rank = {
                society = god_society
                rank = 1
            }
        }
   
        potential = {
            any_province = {
                owned_by = FROMFROM
                num_of_empty_holdings > 0
            }
        }
   
        allow = {
            FROM = {
                society_currency >= 100 #need 100 society currency, can be anything
                trait = divine
            }
        }
   
        effect = {
            # ROOT is a county
            capital_scope = {
                save_event_target_as = construction_province
            }
            FROM = { # Decision-taker
                character_event = { id = D3.2017 }
                change_society_currency = -100
            }
        }
   
        ai_will_do = {
            factor = 0
        }
    }

The owned_by line is the difficulty. When I first tested the power, that line wasn't in there, and the power works fine, albeit in every province with an empty slot instead of just those the player controls.

I've tried owned_by = FROM, and FROMFROM, and PREV, but those still makes it constructible in every province with an empty slot.

I tried doing owned_by = { any_player } and owned_by = { any_playable_ruler = { ai = no } } but the game choked on that, with the Validator saying I can't give owned_by "a complex type".

I also tried doing variations with any_realm_province instead of any_province and in those cases the power doesn't show up in-game at all.

I'm stumped.
The problem is the use of any_province. Remove it and check directly inside potential.
 

Rockphed

Uncultured Barbarian
19 Badges
Jan 31, 2017
1.085
93
  • Crusader Kings II
  • Crusader Kings II: Way of Life
  • Crusader Kings II: Holy Fury
  • Shadowrun Returns
  • Surviving Mars: Digital Deluxe Edition
  • Crusader Kings II: Jade Dragon
  • Surviving Mars
  • Crusader Kings II: Monks and Mystics
  • Crusader Kings II: Reapers Due
  • Crusader Kings II: Conclave
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: The Republic
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: Charlemagne
I am trying to create a stacking modifier so I can increase the number of trade posts each patrician gets by building in the capitol. I found the duel experience and battlefield experience modifiers, which I know can stack, but they don't seem to have anything special to make them stack. Is the stacking done in the event that applies the modifier?
 

Whizzer

CKPlus Triumvirate
77 Badges
Jun 17, 2014
1.621
793
  • Semper Fi
  • Hearts of Iron III Collection
  • Heir to the Throne
  • King Arthur II
  • Knights of Pen and Paper +1 Edition
  • Leviathan: Warships
  • The Kings Crusade
  • Magicka
  • Victoria: Revolutions
  • Rome Gold
  • Cities in Motion
  • Sengoku
  • Sword of the Stars
  • Sword of the Stars II
  • Victoria 2
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • Rome: Vae Victis
  • Warlock: Master of the Arcane
  • Europa Universalis IV: Mare Nostrum
  • Hearts of Iron III
  • A Game of Dwarves
  • Cities in Motion 2
  • 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
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sword of Islam
  • Dungeonland
  • Crusader Kings II: Sunset Invasion
  • Europa Universalis III
  • Divine Wind
  • Hearts of Iron III: Their Finest Hour
  • For the Motherland
  • Europa Universalis IV: Rights of Man
  • Crusader Kings II: Reapers Due
  • Crusader Kings II: Conclave
  • Crusader Kings II: Monks and Mystics
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Way of Life
  • Magicka: Wizard Wars Founder Wizard
  • Europa Universalis IV: El Dorado
  • Cities: Skylines
  • War of the Roses
  • Crusader Kings III
  • Europa Universalis IV
I am trying to create a stacking modifier so I can increase the number of trade posts each patrician gets by building in the capitol. I found the duel experience and battlefield experience modifiers, which I know can stack, but they don't seem to have anything special to make them stack. Is the stacking done in the event that applies the modifier?
Yes, use stacking = yes when applying it.
 

GodModder

First Lieutenant
39 Badges
May 10, 2021
282
41
  • Shadowrun Returns
  • Stellaris: Leviathans Story Pack
  • Crusader Kings II: Monks and Mystics
  • Stellaris - Path to Destruction bundle
  • Stellaris: Synthetic Dawn
  • Age of Wonders III
  • Crusader Kings II: Jade Dragon
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Stellaris: Distant Stars
  • Stellaris: Digital Anniversary Edition
  • Shadowrun: Hong Kong
  • Stellaris: Megacorp
  • Crusader Kings II: Holy Fury
  • Stellaris: Ancient Relics
  • Stellaris: Lithoids
  • Stellaris: Federations
  • Crusader Kings III
  • Stellaris: Necroids
  • Stellaris: Nemesis
  • Crusader Kings II: Way of Life
  • 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
  • Majesty 2 Collection
  • Crusader Kings II
  • Pillars of Eternity
  • Magicka 2
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Conclave
  • Stellaris
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Crusader Kings II: Reapers Due
there's a mod that already does that. I think it's Mystical Selection or something. It's on both Steam and LL -- perhaps checking it out will help you
Thanks, I'll have to take a look.

The problem is the use of any_province. Remove it and check directly inside potential.
So like this?
Code:
    potential = {
            owned_by = PREV
            num_of_empty_holdings > 0
        }
Still doesn't work. PREV, FROM, FROMFROM, and any_player (for owned_by) make the decision not show up at all, whereas using { ai = no } (in owned_by) makes the game choke and not know what to do with it. Validator doesn't throw up any errors though.
 
Last edited:

Whizzer

CKPlus Triumvirate
77 Badges
Jun 17, 2014
1.621
793
  • Semper Fi
  • Hearts of Iron III Collection
  • Heir to the Throne
  • King Arthur II
  • Knights of Pen and Paper +1 Edition
  • Leviathan: Warships
  • The Kings Crusade
  • Magicka
  • Victoria: Revolutions
  • Rome Gold
  • Cities in Motion
  • Sengoku
  • Sword of the Stars
  • Sword of the Stars II
  • Victoria 2
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • Rome: Vae Victis
  • Warlock: Master of the Arcane
  • Europa Universalis IV: Mare Nostrum
  • Hearts of Iron III
  • A Game of Dwarves
  • Cities in Motion 2
  • 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
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sword of Islam
  • Dungeonland
  • Crusader Kings II: Sunset Invasion
  • Europa Universalis III
  • Divine Wind
  • Hearts of Iron III: Their Finest Hour
  • For the Motherland
  • Europa Universalis IV: Rights of Man
  • Crusader Kings II: Reapers Due
  • Crusader Kings II: Conclave
  • Crusader Kings II: Monks and Mystics
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Way of Life
  • Magicka: Wizard Wars Founder Wizard
  • Europa Universalis IV: El Dorado
  • Cities: Skylines
  • War of the Roses
  • Crusader Kings III
  • Europa Universalis IV
Thanks, I'll have to take a look.


So like this?
Code:
    potential = {
            owned_by = PREV
            num_of_empty_holdings > 0
        }
Still doesn't work. PREV, FROM, FROMFROM, and any_player (for owned_by) make the decision not show up at all, whereas using { ai = no } (in owned_by) makes the game choke and not know what to do with it. Validator doesn't throw up any errors though.
Please provide the script for your entire decision.
 

GodModder

First Lieutenant
39 Badges
May 10, 2021
282
41
  • Shadowrun Returns
  • Stellaris: Leviathans Story Pack
  • Crusader Kings II: Monks and Mystics
  • Stellaris - Path to Destruction bundle
  • Stellaris: Synthetic Dawn
  • Age of Wonders III
  • Crusader Kings II: Jade Dragon
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Stellaris: Distant Stars
  • Stellaris: Digital Anniversary Edition
  • Shadowrun: Hong Kong
  • Stellaris: Megacorp
  • Crusader Kings II: Holy Fury
  • Stellaris: Ancient Relics
  • Stellaris: Lithoids
  • Stellaris: Federations
  • Crusader Kings III
  • Stellaris: Necroids
  • Stellaris: Nemesis
  • Crusader Kings II: Way of Life
  • 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
  • Majesty 2 Collection
  • Crusader Kings II
  • Pillars of Eternity
  • Magicka 2
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Conclave
  • Stellaris
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Crusader Kings II: Reapers Due
Please provide the script for your entire decision.
The decision is this.
Code:
god_society_construction = {
        is_in_society = yes
        
        from_potential = {
            society_rank = {
                society = god_society
                rank = 1
            }
        }
        
        potential = {
            owned_by = PREV
            num_of_empty_holdings > 0
        }
        
        allow = {
            FROM = {
                society_currency >= 100 #need 100 society currency, can be anything
                trait = divine
            }
        }
        
        effect = {
            # ROOT is a county
            capital_scope = {
                save_event_target_as = construction_province
            }
            FROM = { # Decision-taker
                character_event = { id = D3.2017 }
                change_society_currency = -100
            }
        }
        
        ai_will_do = {
            factor = 0
        }
    }

The event it leads to is this.
Code:
character_event = {
    id = D3.2017
    picture = GFX_evt_council_speaker
    desc = EVTDESC_D3_2017
    border = GFX_event_normal_frame_intrigue
    
    is_triggered_only = yes
    
    option = { # build a castle
        name = EVTOPTA_D3_2017
        event_target:construction_province = {
            build_holding = {
                type = castle
                holder = ROOT
            }
        }
    }
    
    option = { # build temple
        name = EVTOPTB_D3_2017
        event_target:construction_province = {
            build_holding = {
                type = temple
                holder = ROOT
            }
        }
    }
    
    option = { # build city
        name = EVTOPTC_D3_2017
        event_target:construction_province = {
            build_holding = {
                type = city
                holder = ROOT
            }
        }
    }
}

When I didn't have the owned_by restriction, it works as intended, except in any province with an empty holding. What I'm trying to do now is get it to work only in player-owned provinces with an empty holding.