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

ROBAXX

Recruit
32 Badges
Jun 24, 2017
6
0
  • Europa Universalis IV: Common Sense
  • Europa Universalis IV: Golden Century
  • Crusader Kings II: Holy Fury
  • Europa Universalis IV: Dharma
  • Europa Universalis IV: Rule Britannia
  • Crusader Kings II: Jade Dragon
  • Europa Universalis IV: Cradle of Civilization
  • Europa Universalis IV: Third Rome
  • Europa Universalis IV: Mandate of Heaven
  • Crusader Kings II: Monks and Mystics
  • Europa Universalis IV: Rights of Man
  • Crusader Kings II: Reapers Due
  • Crusader Kings II: Conclave
  • Europa Universalis IV: Cossacks
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: Pre-order
  • Europa Universalis IV: El Dorado
  • Europa Universalis IV: Res Publica
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Art of War
  • Europa Universalis IV
  • 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 IV: Mare Nostrum
  • Crusader Kings II
I'm not sure if there's a better way to accomplish it (it could be good to use scripted triggers, in case you want to change it more easily later).

I don't think this would have any significant performance impact, specially since triggers for descriptions and option names likely aren't computed for the AI at all.
Thank you!
Yes, I better add a second scripted trigger instead of the religion_group check to complement r_is_evil_race, if I intend to do this type of description modding for more events.

I hope I can find a definite answer on whether the AI computes descriptions or not. If I do, I'll be sure to let you know.

Hello. Your syntax looks already quite optimized to me. I think the higher treat on your performance will be the on_action link with the event, not the event itself in this current state, and the number of character receiving the alert/opinion_modifiers about the tortured one.. Or are you planning to add many options? (Many way to torture, here for instance).

My newbie suggestion would be to add a large random specter to the on_action triggerer (days) so the performance is diluted at different dates (this was one of the reason for old patch to cause crashes while saving). Another idea would be to use 2 separated event, one for the player, one for the ia (with everything in hidden mode, a bit less code).

And what about religion_group events? You wouldn't have to check anything because the check for religion is already made. But that would require global optimization of your mod and would only benefit if you're using many check like this one.

I hope this was helpful! Even a bit.
Thank you!
This is an event from the base game where, if you have prisoners in your dungeon you may randomly get an option to torture them (If you're cruel/not just etc. - MTTH based).
The only thing that I changed/added was text descriptions with triggers based on what religion you have. I don't dare change anything else to make sure that the performance isn't affected negatively.
I just hope that the checks for descriptions aren't computed by the AI.
 

blackninja9939

Experienced Programmer - Crusader Kings 3
Paradox Staff
78 Badges
Aug 28, 2013
2.401
7.847
  • Crusader Kings III
  • Stellaris: Federations
  • Battle for Bosporus
  • Stellaris: Nemesis
  • Hearts of Iron IV: No Step Back
  • Europa Universalis IV
  • Crusader Kings III: Royal Edition
  • Europa Universalis 4: Emperor
  • Stellaris: Necroids
  • Crusader Kings II
  • Crusader Kings II: Holy Fury
  • Imperator: Rome - Magna Graecia
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: The Old Gods
  • Europa Universalis IV: Rights of Man
  • Europa Universalis IV: Cradle of Civilization
  • Stellaris: Synthetic Dawn
  • Surviving Mars
  • BATTLETECH
  • Europa Universalis IV: Mandate of Heaven
  • Crusader Kings II: Monks and Mystics
  • Tyranny: Archon Edition
  • Europa Universalis IV: Rule Britannia
  • Crusader Kings II: Reapers Due
  • Hearts of Iron IV: Colonel
  • Stellaris Sign-up
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Apocalypse
  • Stellaris: Lithoids
  • Stellaris: Distant Stars
  • Europa Universalis IV: Dharma
  • Shadowrun Returns
  • Imperator: Rome Deluxe Edition
  • Prison Architect
  • Imperator: Rome Sign Up
  • Stellaris: Ancient Relics
  • Age of Wonders: Planetfall
  • Crusader Kings II: Conclave
  • Crusader Kings II: The Republic
  • Victoria 2
  • Cities: Skylines
  • Europa Universalis IV: El Dorado
  • Crusader Kings II: Way of Life
  • Stellaris
  • Mount & Blade: Warband
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Sunset Invasion
I posted my question at the base ck2 forum, but I am posting it here as well. Thoughts?

Details:
Guide: Your first mod

Question:
Guide: Your first mod
As I just responded to you there, if you are unsure of any rule or if what you are doing is fine according to the rule then post in the User Mod rules thread that I linked you in that thread and ask your question.
 

Attila2131

Recruit
33 Badges
Dec 16, 2015
8
0
  • Crusader Kings II: Charlemagne
  • Crusader Kings II
  • Magicka
  • 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
  • Stellaris: Necroids
  • Crusader Kings III
  • Stellaris: Federations
  • Stellaris: Lithoids
  • Stellaris: Ancient Relics
  • Stellaris: Megacorp
  • Stellaris: Distant Stars
  • Stellaris: Apocalypse
  • Stellaris: Humanoids Species Pack
  • Stellaris: Synthetic Dawn
  • Stellaris - Path to Destruction bundle
  • Crusader Kings II: Monks and Mystics
  • Stellaris: Leviathans Story Pack
  • Stellaris: Digital Anniversary Edition
  • Crusader Kings II: Reapers Due
  • Stellaris
  • Crusader Kings II: Conclave
  • Crusader Kings II: Horse Lords
  • Pillars of Eternity
  • Crusader Kings II: Way of Life
  • Victoria 2: Heart of Darkness
  • Victoria 2: A House Divided
  • Victoria 2
Hello, is there a way to count the number of specific unit a player has raised?

For instance, how to count the number of raised pikemen by a player? I plan to use this counting for a special unit type only created as retinue, so it seems I can only use "the character = { any_army = {" scope => the Unit scope. However, I can't found any way to checkup what's inside, I only have found effects to modify what's inside.

What data can you extract as conditions in the Unit scope? There must be a way to check "if a player has raised 10 000 pikemen" then action.
 

LordPeter

Marjoram
49 Badges
Mar 5, 2012
2.249
382
  • Cities: Skylines - After Dark
  • Europa Universalis IV: Cossacks
  • Cities: Skylines - Snowfall
  • Europa Universalis IV: Mare Nostrum
  • Crusader Kings II: Monks and Mystics
  • Crusader Kings II: Conclave
  • Stellaris Sign-up
  • Hearts of Iron IV: Cadet
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Rights of Man
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Prison Architect
  • Stellaris - Path to Destruction bundle
  • Cities: Skylines - Mass Transit
  • Europa Universalis IV: Mandate of Heaven
  • Stellaris: Synthetic Dawn
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Stellaris: Distant Stars
  • Stellaris: Megacorp
  • Crusader Kings II: Holy Fury
  • Imperator: Rome
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Way of Life
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: El Dorado
  • 500k Club
  • Europa Universalis IV: Res Publica
  • Europa Universalis IV: Call to arms event
  • 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: Sunset Invasion
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Art of War
  • Europa Universalis IV
  • Crusader Kings II: Sword of Islam
  • Stellaris
  • Europa Universalis IV: Third Rome
  • Cities: Skylines
  • Crusader Kings II: Jade Dragon
  • Europa Universalis IV: Cradle of Civilization
So, I don't entirely get stacking modifiers, and sadly can't find much info about them in the wiki.
My question is, how do I contain them?
If I want a maximum of say 4 stacks, can I check if there are 4 in a province, and thus stop my event from layering another one on top? Similarly, can I remove individual stacks?
 

Slime99

Major
15 Badges
May 3, 2017
556
368
  • 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: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Way of Life
  • Crusader Kings II: Reapers Due
  • Crusader Kings II: Jade Dragon
  • Crusader Kings II: Holy Fury
  • Imperator: Rome Sign Up
  • Crusader Kings III
How do I define a nation to be a Merchant republic? The nations I want to be merchant republics show up as regular republics before I hit 'play', but become merchant republics after it.
 

Andrelvis

The Last Ghibelline
76 Badges
Apr 30, 2006
5.598
9.962
  • 500k Club
  • Majesty 2 Collection
  • March of the Eagles
  • Europa Universalis III Complete
  • Europa Universalis IV: Res Publica
  • Victoria: Revolutions
  • Rome Gold
  • Semper Fi
  • Sengoku
  • Victoria 2
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • Rome: Vae Victis
  • Europa Universalis III Complete
  • Europa Universalis IV: El Dorado
  • Europa Universalis IV: Pre-order
  • Rise of Prussia
  • 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
  • Stellaris: Galaxy Edition
  • Crusader Kings III
  • Europa Universalis III Complete
  • 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: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Darkest Hour
  • Deus Vult
  • Europa Universalis III
  • Hearts of Iron II: Armageddon
  • Divine Wind
  • Europa Universalis IV
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Call to arms event
  • For The Glory
  • For the Motherland
  • Hearts of Iron III
  • Hearts of Iron III: Their Finest Hour
How do I define a nation to be a Merchant republic? The nations I want to be merchant republics show up as regular republics before I hit 'play', but become merchant republics after it.

You have to give the merchant republic title holder a family palace holding. To do so, define a barony in landed_titles.txt WITHOUT making it the de jure territory of any country. And then in its history use (for the appropriate date) "holding_dynasty = X", where X is the character's dynasty.
 

Slime99

Major
15 Badges
May 3, 2017
556
368
  • 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: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Way of Life
  • Crusader Kings II: Reapers Due
  • Crusader Kings II: Jade Dragon
  • Crusader Kings II: Holy Fury
  • Imperator: Rome Sign Up
  • Crusader Kings III
You have to give the merchant republic title holder a family palace holding. To do so, define a barony in landed_titles.txt WITHOUT making it the de jure territory of any country. And then in its history use (for the appropriate date) "holding_dynasty = X", where X is the character's dynasty.
Thanks going to check it out.
 

Andrelvis

The Last Ghibelline
76 Badges
Apr 30, 2006
5.598
9.962
  • 500k Club
  • Majesty 2 Collection
  • March of the Eagles
  • Europa Universalis III Complete
  • Europa Universalis IV: Res Publica
  • Victoria: Revolutions
  • Rome Gold
  • Semper Fi
  • Sengoku
  • Victoria 2
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • Rome: Vae Victis
  • Europa Universalis III Complete
  • Europa Universalis IV: El Dorado
  • Europa Universalis IV: Pre-order
  • Rise of Prussia
  • 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
  • Stellaris: Galaxy Edition
  • Crusader Kings III
  • Europa Universalis III Complete
  • 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: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Darkest Hour
  • Deus Vult
  • Europa Universalis III
  • Hearts of Iron II: Armageddon
  • Divine Wind
  • Europa Universalis IV
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Call to arms event
  • For The Glory
  • For the Motherland
  • Hearts of Iron III
  • Hearts of Iron III: Their Finest Hour
This piece of code doesn't seem to work (it doesn't set the population size for the province), anyone has an idea why?

Code:
       any_province = {
           if = {
               limit = {
                   NOT = { check_variable = { which = population_size value = 1 } } #if the province has no historical population number set, give a portion of the number given for its de jure duchy to it
               }
               
               save_event_target_as = province_target

               county = {
                   dejure_liege_title = {
                       if = {
                           limit = {
                               check_variable = { which = population_size value = 1 }
                           }
                           
                           set_variable = { which = quantity_of_provinces value = 0 }
                               
                           any_de_jure_vassal_title = {
                               change_variable = { which = quantity_of_provinces value = 1 }
                           }
                       
                           event_target:province_target = {
                               set_variable = { which = population_size which = PREV }
                               set_variable = { which = quantity_of_provinces which = PREV }
                               divide_variable = { which = population_size which = quantity_of_provinces }
                               set_variable = { which = quantity_of_provinces value = 0 }
                           }
                           
                           set_variable = { which = quantity_of_provinces value = 0 }
                       }
                   }
               }
           }
        }
 

Attila2131

Recruit
33 Badges
Dec 16, 2015
8
0
  • Crusader Kings II: Charlemagne
  • Crusader Kings II
  • Magicka
  • 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
  • Stellaris: Necroids
  • Crusader Kings III
  • Stellaris: Federations
  • Stellaris: Lithoids
  • Stellaris: Ancient Relics
  • Stellaris: Megacorp
  • Stellaris: Distant Stars
  • Stellaris: Apocalypse
  • Stellaris: Humanoids Species Pack
  • Stellaris: Synthetic Dawn
  • Stellaris - Path to Destruction bundle
  • Crusader Kings II: Monks and Mystics
  • Stellaris: Leviathans Story Pack
  • Stellaris: Digital Anniversary Edition
  • Crusader Kings II: Reapers Due
  • Stellaris
  • Crusader Kings II: Conclave
  • Crusader Kings II: Horse Lords
  • Pillars of Eternity
  • Crusader Kings II: Way of Life
  • Victoria 2: Heart of Darkness
  • Victoria 2: A House Divided
  • Victoria 2
This piece of code doesn't seem to work (it doesn't set the population size for the province), anyone has an idea why?

Code:
       any_province = {
           if = {
               limit = {
                   NOT = { check_variable = { which = population_size value = 1 } } #if the province has no historical population number set, give a portion of the number given for its de jure duchy to it
               }
              
               save_event_target_as = province_target

               county = {
                   dejure_liege_title = {
                       if = {
                           limit = {
                               check_variable = { which = population_size value = 1 }
                           }
                          
                           set_variable = { which = quantity_of_provinces value = 0 }
                              
                           any_de_jure_vassal_title = {
                               change_variable = { which = quantity_of_provinces value = 1 }
                           }
                      
                           event_target:province_target = {
                               set_variable = { which = population_size which = PREV }
                               set_variable = { which = quantity_of_provinces which = PREV }
                               divide_variable = { which = population_size which = quantity_of_provinces }
                               set_variable = { which = quantity_of_provinces value = 0 }
                           }
                          
                           set_variable = { which = quantity_of_provinces value = 0 }
                       }
                   }
               }
           }
        }

I'm not sure about it, but your scope sequence is "any province" (GLOBAL -> PROVINCE) then "county " (HOLDING -> COUNTY). Don't you need the "any province holding" link (PROVINCE -> HOLDING) ?
 

Andrelvis

The Last Ghibelline
76 Badges
Apr 30, 2006
5.598
9.962
  • 500k Club
  • Majesty 2 Collection
  • March of the Eagles
  • Europa Universalis III Complete
  • Europa Universalis IV: Res Publica
  • Victoria: Revolutions
  • Rome Gold
  • Semper Fi
  • Sengoku
  • Victoria 2
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • Rome: Vae Victis
  • Europa Universalis III Complete
  • Europa Universalis IV: El Dorado
  • Europa Universalis IV: Pre-order
  • Rise of Prussia
  • 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
  • Stellaris: Galaxy Edition
  • Crusader Kings III
  • Europa Universalis III Complete
  • 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: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Darkest Hour
  • Deus Vult
  • Europa Universalis III
  • Hearts of Iron II: Armageddon
  • Divine Wind
  • Europa Universalis IV
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Call to arms event
  • For The Glory
  • For the Motherland
  • Hearts of Iron III
  • Hearts of Iron III: Their Finest Hour
I'm not sure about it, but your scope sequence is "any province" (GLOBAL -> PROVINCE) then "county " (HOLDING -> COUNTY). Don't you need the "any province holding" link (PROVINCE -> HOLDING) ?

I meant to scope to the province's corresponding county. According to the wiki page on scopes it should work for provinces; do you think it doesn't work that way?
 

Attila2131

Recruit
33 Badges
Dec 16, 2015
8
0
  • Crusader Kings II: Charlemagne
  • Crusader Kings II
  • Magicka
  • 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
  • Stellaris: Necroids
  • Crusader Kings III
  • Stellaris: Federations
  • Stellaris: Lithoids
  • Stellaris: Ancient Relics
  • Stellaris: Megacorp
  • Stellaris: Distant Stars
  • Stellaris: Apocalypse
  • Stellaris: Humanoids Species Pack
  • Stellaris: Synthetic Dawn
  • Stellaris - Path to Destruction bundle
  • Crusader Kings II: Monks and Mystics
  • Stellaris: Leviathans Story Pack
  • Stellaris: Digital Anniversary Edition
  • Crusader Kings II: Reapers Due
  • Stellaris
  • Crusader Kings II: Conclave
  • Crusader Kings II: Horse Lords
  • Pillars of Eternity
  • Crusader Kings II: Way of Life
  • Victoria 2: Heart of Darkness
  • Victoria 2: A House Divided
  • Victoria 2
From the wiki:

1920px-Scopes_modding_quickcard.png


According to this picture, you can only link "county" with a holding and not a province. But it's true that the wiki text says it can be linked from the province scope directly. That's a contradiction... What about trying the picture configuration and tell me if it worked?
 

Andrelvis

The Last Ghibelline
76 Badges
Apr 30, 2006
5.598
9.962
  • 500k Club
  • Majesty 2 Collection
  • March of the Eagles
  • Europa Universalis III Complete
  • Europa Universalis IV: Res Publica
  • Victoria: Revolutions
  • Rome Gold
  • Semper Fi
  • Sengoku
  • Victoria 2
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • Rome: Vae Victis
  • Europa Universalis III Complete
  • Europa Universalis IV: El Dorado
  • Europa Universalis IV: Pre-order
  • Rise of Prussia
  • 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
  • Stellaris: Galaxy Edition
  • Crusader Kings III
  • Europa Universalis III Complete
  • 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: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Darkest Hour
  • Deus Vult
  • Europa Universalis III
  • Hearts of Iron II: Armageddon
  • Divine Wind
  • Europa Universalis IV
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Call to arms event
  • For The Glory
  • For the Motherland
  • Hearts of Iron III
  • Hearts of Iron III: Their Finest Hour
From the wiki:

1920px-Scopes_modding_quickcard.png


According to this picture, you can only link "county" with a holding and not a province. But it's true that the wiki text says it can be linked from the province scope directly. That's a contradiction... What about trying the picture configuration and tell me if it worked?

I've looked for and found many instances in vanilla of "county" being used from the province scope (i.e. in byzantine_events.txt), so I don't think that's it...

Actually, I've found the error now. I was increasing "quantity_of_provinces" for each of the duchy's counties, instead of for the duchy itself, making the population be divided by zero later on. This is the ammended code:

Code:
                           any_direct_de_jure_vassal_title = {
                               dejure_liege_title = {
                                   change_variable = { which = quantity_of_provinces value = 1 }
                               }
                           }

Unfortunately however, I have hit a further stumbling block. If the duchy has a population of over 4 million, then the population variable doesn't get applied properly to the provinces. If the duchy's population is something like 300,000 it works fine though. So it seems like I've hit a maximum limit to how large a variable can be?

Since variables use three decimals, then probably their maximum limit is 2,147,483.647 (they are probably just integers with the three last numbers appearing as decimals).

I suppose I could use thousands of people for the variable instead, though that isn't as appealing, visually.

Thanks for the help with this issue, @Attila2131 :)
 
Last edited:

jursamaj

General
125 Badges
Aug 20, 2012
2.360
216
  • Victoria 2: Heart of Darkness
  • Hearts of Iron III
  • Heir to the Throne
  • Knights of Pen and Paper +1 Edition
  • Cities in Motion
  • Europa Universalis IV: Res Publica
  • Victoria: Revolutions
  • Stellaris: Galaxy Edition
  • Stellaris - Path to Destruction bundle
  • Victoria 2: A House Divided
  • Leviathan: Warships
  • Rome: Vae Victis
  • Stellaris
  • Europa Universalis IV: Pre-order
  • Magicka 2 - Signup Campaign
  • Crusader Kings II: Horse Lords
  • Cities: Skylines - After Dark
  • Europa Universalis IV: Cossacks
  • Cities: Skylines - Snowfall
  • Europa Universalis IV: Mare Nostrum
  • Europa Universalis IV: Call to arms event
  • 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: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Europa Universalis III
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis III Complete
  • Europa Universalis IV: Conquest of Paradise
  • Divine Wind
  • Europa Universalis IV: Art of War
  • Europa Universalis III: Chronicles
  • Crusader Kings II: Way of Life
  • Crusader Kings II: Conclave
  • Europa Universalis III Complete
  • Europa Universalis IV: Common Sense
  • Europa Universalis III Complete
  • Pillars of Eternity
  • Europa Universalis IV
  • Europa Universalis IV: El Dorado
  • 500k Club
  • Stellaris Sign-up
  • Hearts of Iron IV Sign-up
  • Hearts of Iron IV: No Step Back
Unfortunately however, I have hit a further stumbling block. If the duchy has a population of over 4 million, then the population variable doesn't get applied properly to the provinces. If the duchy's population is something like 300,000 it works fine though. So it seems like I've hit a maximum limit to how large a variable can be?

Since variables use three decimals, then probably their maximum limit is 2,147,483.647 (they are probably just integers with the three last numbers appearing as decimals).

I suppose I could use thousands of people for the variable instead, though that isn't as appealing, visually.

Thanks for the help with this issue, @Attila2131 :)
Reasonable compromise: You could use thousands of people in the variable, but display it with an extra ",000".
 

Thezezeal

Captain
3 Badges
Dec 28, 2014
375
3
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Monks and Mystics
  • Crusader Kings II: Charlemagne
I have this event :
Code:
character_event = {
 id = TestEvent.2
 hide_window = yes
 is_triggered_only = yes
 trigger = {
  always = yes
 }
 option = {
  capital_scope = {
   ROOT = {
    spawn_unit = {
     owner = ROOT
     province = PREV
     home = PREV
     match_character = ROOT
     match_mult = 0.50
     attrition = 1.0
    }
   }
  }
 }
}

which was based on this vanilla event:
Code:
# Faction Revolt - Great numbers of Rebels flock to your banner
character_event = {
 id = 45000
 desc = "EVTDESC45000"
 picture = "GFX_evt_battle"
 border = "GFX_event_normal_frame_war"
 is_triggered_only = yes
 trigger = {
  war_with = FROM
 }
 option = {
  name = "EXCELLENT"
 
  hidden_tooltip = {
   FROM = {
    character_event = { id = 45001 }
   }
  }
 
  capital_scope = {
   tooltip = {
    ROOT = {
     spawn_unit = {
      province = PREV
      owner = ROOT
      match_character = FROM
      match_mult = 0.05
      attrition = 1.0
     }

The problem is that no troops spawn when it fires. Anyone know what might be wrong?
 

Alvis14

Sergeant
37 Badges
Feb 17, 2013
91
27
  • 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
  • Crusader Kings II: Sword of Islam
  • Europa Universalis IV: Conquest of Paradise
  • Crusader Kings Complete
  • Crusader Kings III
  • Surviving Mars
  • Age of Wonders III
  • Crusader Kings II: Jade Dragon
  • Surviving Mars: Digital Deluxe Edition
  • Crusader Kings II: Holy Fury
  • Imperator: Rome Sign Up
  • Age of Wonders: Planetfall
  • Age of Wonders: Planetfall Deluxe edition
  • Age of Wonders: Planetfall Premium edition
  • Age of Wonders: Planetfall Season pass
  • Stellaris: Lithoids
  • Age of Wonders: Planetfall - Revelations
  • Stellaris - Path to Destruction bundle
  • Crusader Kings II: Monks and Mystics
  • Stellaris: Leviathans Story Pack
  • Crusader Kings II: Reapers Due
  • Stellaris Sign-up
  • Stellaris
  • Crusader Kings II: Conclave
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Way of Life
  • 500k Club
  • Victoria 2
  • Europa Universalis IV
  • Crusader Kings II: Sunset Invasion
Run the Validator on your events. I suspect that the reason it can't find the event is that the game can't recognize it as a valid event, due to stray brackets or an unrecognized command.
I've finally tried the Validator on this one and nothing came up. This is so frustrating ^^. I've tried to create a new event, similar, and when i tried to cheat-run those two event, the game says there's not event responding to the ID 100000003 or 100000004..
 

Andrelvis

The Last Ghibelline
76 Badges
Apr 30, 2006
5.598
9.962
  • 500k Club
  • Majesty 2 Collection
  • March of the Eagles
  • Europa Universalis III Complete
  • Europa Universalis IV: Res Publica
  • Victoria: Revolutions
  • Rome Gold
  • Semper Fi
  • Sengoku
  • Victoria 2
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • Rome: Vae Victis
  • Europa Universalis III Complete
  • Europa Universalis IV: El Dorado
  • Europa Universalis IV: Pre-order
  • Rise of Prussia
  • 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
  • Stellaris: Galaxy Edition
  • Crusader Kings III
  • Europa Universalis III Complete
  • 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: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Darkest Hour
  • Deus Vult
  • Europa Universalis III
  • Hearts of Iron II: Armageddon
  • Divine Wind
  • Europa Universalis IV
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Call to arms event
  • For The Glory
  • For the Motherland
  • Hearts of Iron III
  • Hearts of Iron III: Their Finest Hour
Reasonable compromise: You could use thousands of people in the variable, but display it with an extra ",000".

I haven't even been able to get the variable to show properly outside of building requirements... which cannot be changed in their format on a per-variable basis, in any case. But thanks anyway :)

I have this event :
Code:
character_event = {
 id = TestEvent.2
 hide_window = yes
 is_triggered_only = yes
 trigger = {
  always = yes
 }
 option = {
  capital_scope = {
   ROOT = {
    spawn_unit = {
     owner = ROOT
     province = PREV
     home = PREV
     match_character = ROOT
     match_mult = 0.50
     attrition = 1.0
    }
   }
  }
 }
}

which was based on this vanilla event:
Code:
# Faction Revolt - Great numbers of Rebels flock to your banner
character_event = {
 id = 45000
 desc = "EVTDESC45000"
 picture = "GFX_evt_battle"
 border = "GFX_event_normal_frame_war"
 is_triggered_only = yes
 trigger = {
  war_with = FROM
 }
 option = {
  name = "EXCELLENT"
 
  hidden_tooltip = {
   FROM = {
    character_event = { id = 45001 }
   }
  }
 
  capital_scope = {
   tooltip = {
    ROOT = {
     spawn_unit = {
      province = PREV
      owner = ROOT
      match_character = FROM
      match_mult = 0.05
      attrition = 1.0
     }

The problem is that no troops spawn when it fires. Anyone know what might be wrong?

I'm not sure if that's the origin of your problem, but you should use "immediate" instead of "option" for events with a hidden window.
 

Attila2131

Recruit
33 Badges
Dec 16, 2015
8
0
  • Crusader Kings II: Charlemagne
  • Crusader Kings II
  • Magicka
  • 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
  • Stellaris: Necroids
  • Crusader Kings III
  • Stellaris: Federations
  • Stellaris: Lithoids
  • Stellaris: Ancient Relics
  • Stellaris: Megacorp
  • Stellaris: Distant Stars
  • Stellaris: Apocalypse
  • Stellaris: Humanoids Species Pack
  • Stellaris: Synthetic Dawn
  • Stellaris - Path to Destruction bundle
  • Crusader Kings II: Monks and Mystics
  • Stellaris: Leviathans Story Pack
  • Stellaris: Digital Anniversary Edition
  • Crusader Kings II: Reapers Due
  • Stellaris
  • Crusader Kings II: Conclave
  • Crusader Kings II: Horse Lords
  • Pillars of Eternity
  • Crusader Kings II: Way of Life
  • Victoria 2: Heart of Darkness
  • Victoria 2: A House Divided
  • Victoria 2
Can you modify vassalization/marriage?

I want to change the parameters for which the targets consider your offer a bit,
I think yes, but you'll have to override existing conditions (just adding new won't do, IA will go for vanilla). That means "replace path" concerned with all the files inside and modify the conditions to add your own.
 

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
Reworking marriages/etc. is doable, but not recommended. Implementing proper AI logic for making and accepting such interactions is not trivial (as knowing the exact reasoning it uses now is rather difficult), nor is making it work without hurting performance a lot if you want the AI to use this system (which it has to do if you want it to be using the same calculations when marrying other AI characters as it would do if you use a modified system).
 

ogarrr

Captain
30 Badges
Sep 17, 2010
306
412
  • Crusader Kings II: Charlemagne
  • Stellaris: Synthetic Dawn
  • Stellaris: Galaxy Edition
  • Crusader Kings II
  • Rome Gold
  • 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
  • Imperator: Rome - Magna Graecia
  • Imperator: Rome
  • Imperator: Rome Deluxe Edition
  • Crusader Kings II: Holy Fury
  • Stellaris: Humanoids Species Pack
  • Crusader Kings II: Jade Dragon
  • Crusader Kings III
  • Stellaris - Path to Destruction bundle
  • Crusader Kings II: Monks and Mystics
  • Stellaris: Leviathans Story Pack
  • Stellaris: Digital Anniversary Edition
  • Crusader Kings II: Reapers Due
  • Stellaris: Galaxy Edition
  • Stellaris
  • Crusader Kings II: Conclave
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Way of Life
  • Rome: Vae Victis
Does any one know why this would be happening, the issue seems to be the fact that I've changed the saxongfx's headgear to a personally made one for middle era.

http://i.imgur.com/u7rV82O.png


included are the relevant bits (it only messes up when I change the headgear and clothes and only when I click on characters with theocracies). It's a very strange bug as it effects literally everyone who uses the headgear and clothes that I make. It's an altered saxon headgear and clothes file with only the Emperor crown and the military headgear changed. It looks like so:

http://i.imgur.com/Wu3nn93.png

Code:
    portraitType = {
        name = "PORTRAIT_saxongfx_male"
        effectFile = "gfx/FX/portrait.lua"
        layer = { # GFX_TYPE:[d|p]INDEX:COLOR_LINK:DONT_REFRESH_IF_VALID:CULTURE_INDEX
            "GFX_character_background:p0"
            "GFX_norse_male_clothes_behind_christian:p3:c0"
            "GFX_norse_male_headgear_behind_christian:p5:c1"
            "GFX_saxon_male_hair_behind:p1:h:y"
            "GFX_norse_male_beard_behind_christian:p4:o-2x2:h:y"
            "GFX_english_male_base:p2"
            "GFX_english_male_neck:d0"
            "GFX_english_male_cheeks:d4"
            "GFX_english_male_chin:d1"
            "GFX_english_male_mouth:d2"
            "GFX_saxon_male_eyes:d6:o26x30"
            "GFX_english_male_eyes2:d6:e:o-2x0"
            "GFX_english_male_nose:d3"
            "GFX_character_scars:p7:y"
            "GFX_character_reddots:p8"
            "GFX_character_boils:p9"
            "GFX_character_blinded_eyes:p10"
            "GFX_character_eyepatch:p13:y:o30x63"
            "GFX_english_male_ear:d7"  
            "GFX_norse_male_clothes_christian:p3:c2"
            "GFX_norse_male_beard_christian:p4:o-2x2:h:y"
               "GFX_saxon_male_hair:p1:h:y"
            "GFX_character_mask:p12:y:o40x45"
            "GFX_empty:p3:c4"
            "GFX_norse_male_clothes_infront_christian:p3:c4"
            "GFX_norse_male_headgear_christian:p5:c5"
            "GFX_character_imprisoned:p6"
            "GFX_player_overlay:p11"
        }