jursamaj

General
121 Badges
Aug 20, 2012
2.334
202
  • 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
  • Stellaris: Nemesis
Hello and I appreciate The time you invest to provide assistance.


I am a mere tester for converter team that provides a possibility for players to enjoy a mega-campaign experience across multiple Paradox games.

One of the projects the converter team is working on at the moment is converting the Imperator Rome into the CK2. I don't feel alone in feeling a game is missing between the I:R era and the Ck2 to cover the historical events of the period between I:R end game and the CKII starting date, but until that game comes to reality one day we are working on a converter connecting I:R to CkII.

The converter has a starting point of 1066 and 100 AD.

Now the inquiry is where is it possible to modify tech modifiers? Feeling a need here to add a modifier dependent on the in game year so that during the 1340 years to come from the 100 AD starting point, the tech has room to advance. A modifier to make the integral of a 1044 to 1440 total research points gained for a medium region, equal to the integral of the 100 AD to 1440 research points gained in the converted game. The modifier would look like the following functions*:

Y= Research point modifier that will be multiplied to the number of research gained and will be a negative value
X= The current year {x>100)

Formula: Y= ( (Radical (X+100)+(X+100)^1/2) / 4 ) - 10

Or a simple y = 0.00373 * x -5.62
Or just y = - 0.5

Is it possible to add such a modifier to the mod's tech. I would really appreciate if you could help me with your insight.

*The formulas are only for example Just to see if such functions can be supported.
Question for clarification: Is this converter being implemented in one of the games, or implemented as a separate program?

If a separate program, it can support any function you like.
If within one of the games, taking roots is not directly supported, but there are methods to get roots with nothing but simple math and iteration. But this seems the hard way.

But honestly, there's a problem with this method of adjusting research. In addition to the monthly gain of research, there are many events that award research points. To the best of my knowledge, these awards are not adjusted by research modifiers. Thus, getting such events will throw the whole system out of wack. For instance, I already like the scholar lifestyle astronomy events, because they can produce research points. If my monthly research were reduced by 80%, those events are 5 times as good, and I should almost always be an astronomer!
 
  • 1Like
Reactions:

Siawosh

Recruit
49 Badges
Aug 26, 2018
2
0
  • Hearts of Iron IV: Expansion Pass
  • Stellaris
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV: Colonel
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Rights of Man
  • Stellaris: Leviathans Story Pack
  • Hearts of Iron IV: Together for Victory
  • Crusader Kings II: Monks and Mystics
  • Stellaris - Path to Destruction bundle
  • Hearts of Iron IV: Death or Dishonor
  • Stellaris: Synthetic Dawn
  • Europa Universalis IV: Cradle of Civilization
  • Crusader Kings II: Conclave
  • Stellaris: Apocalypse
  • Crusader Kings II: Holy Fury
  • Imperator: Rome Deluxe Edition
  • Imperator: Rome
  • Hearts of Iron IV: Expansion Pass
  • Prison Architect
  • Hearts of Iron IV: La Resistance
  • Crusader Kings III
  • Crusader Kings III: Royal Edition
  • Battle for Bosporus
  • Europa Universalis 4: Emperor
  • Victoria 2: Heart of Darkness
  • Crusader Kings II: The Republic
  • Europa Universalis IV
  • Europa Universalis IV: Art of War
  • Crusader Kings II: Rajas of India
  • Europa Universalis IV: Res Publica
  • Crusader Kings II: Legacy of Rome
  • Victoria 2
  • Victoria 2: A House Divided
  • Cities: Skylines
  • Cities: Skylines Deluxe Edition
  • 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: Charlemagne
  • Crusader Kings II
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Sword of Islam
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Call to arms event
  • Rome Gold
  • Rome: Vae Victis
Question for clarification: Is this converter being implemented in one of the games, or implemented as a separate program?

If a separate program, it can support any function you like.
If within one of the games, taking roots is not directly supported, but there are methods to get roots with nothing but simple math and iteration. But this seems the hard way.

But honestly, there's a problem with this method of adjusting research. In addition to the monthly gain of research, there are many events that award research points. To the best of my knowledge, these awards are not adjusted by research modifiers. Thus, getting such events will throw the whole system out of wack. For instance, I already like the scholar lifestyle astronomy events, because they can produce research points. If my monthly research were reduced by 80%, those events are 5 times as good, and I should almost always be an astronomer!
Thank you for being helpful. I appreciate that.

To clarify: The converter is an application that converts a save game from a game to another. It generates the mod so as it converts a mod for the CKII it is out and no more used during the game. It sort of translates the I:R into a mod that the player can enjoy on CKII. But while generating the CKII it can modify certain files such as regions holdings and to a certain level characters and what they own at the moment according to what is in the I:R mode. I assume This means that It is implemented in the game not as a separate program as it is no more in use once the conversion is done.

Actually I have come to understand that It would not be possible to fully control the tech advancement If the modifiers don't work for events or the events can't be modified. unless the tech is disabled or ideally capped for certain years. Or the events are controlled. Well perfection seems further but advancement can be achieved if the modification to the passive research can be gained. Do you know how I can add a modifier to the research so I test the outcome? I mean is it in one of the text files or it is inside the codes of the game?
 

Rockphed

Uncultured Barbarian
19 Badges
Jan 31, 2017
1.060
60
  • 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
SOLVED: See bottom for solution.

So I have made an event that should destroy all of your trade posts and rebuild them as they were even if you have more than your limit. Unfortunately, it seems to have a problem where it steals the tradeposts from other patricians who have run the event. I think it has to do with not clearing a province flag properly, but I am not sure how to fix it if that is the problem. I can't even figure out how to check which province flags a province has in game (scripting I think I understand).

Event:
Code:
character_event = {
    id = repair_TP.4
    is_triggered_only = yes
    is_ruler = yes
    hide_window = yes
   
    trigger = {
        is_patrician = yes
        war = no
        NOT = {
                any_trade_post = {
                    trade_post_is_building = yes
                }
        }
    }
    fail_trigger_effect = {
        if = {
            limit = {
                any_trade_post = {
                    trade_post_is_building = yes
                }
            }
            delay = 50
            character_event = {id = repair_TP.4}
        }
   
    }
    immediate = {
        random_realm_lord = {
                limit = {
                    is_patrician = yes
                    NOT = { character = ROOT }
                }
                save_event_target_as = target_usurper
            }
       
        any_trade_post = {#destroy all the trade posts
       
            province_event = {id = repair_TP.3}
        }
        any_province = {#recreate and give to another patrician
            limit = {
                has_flag = repair_trade_post_being_cleaned
            }
            province_event = {id = repair_TP.5}
        }
       
    }
    after = {
        event_target:target_usurper = {
            any_trade_post = {
                limit = {
                    has_flag = repair_trade_post_being_cleaned
                }
                seize_trade_post = ROOT
                clear_flags_with_prefix = repair_
            }
        }
       
    }
}

All the events involved for the interested:
Code:
province_event = {
    id = repair_TP.3
    is_triggered_only = yes
   
    hide_window = yes
    immediate = {
       
        trade_post_owner = {
            save_event_target_as = target_patrician
            wealth = 100
            #create_tradepost  = ROOT
        }
        if {
            limit = {trade_post_has_building = tr_port_3}
            set_flag = repair_tr_port_3
        }
        if = {
            limit = {trade_post_has_building = tr_port_2}
            set_flag = repair_tr_port_2
        }
        if = {
            limit = {trade_post_has_building = tr_port_1}
            set_flag = repair_tr_port_1
        }
        if {
            limit = {trade_post_has_building = tr_enclave_3}
            set_flag = repair_tr_enclave_3
        }
        if = {
            limit = {trade_post_has_building = tr_enclave_2}
            set_flag = repair_tr_enclave_2
        }
        if = {
            limit = {trade_post_has_building = tr_enclave_1}
            set_flag = repair_tr_enclave_1
        }
        if {
            limit = {trade_post_has_building = tr_garrison_3}
            set_flag = repair_tr_garrison_3
        }
        if = {
            limit = {trade_post_has_building = tr_garrison_2}
            set_flag = repair_tr_garrison_2
        }
        if = {
            limit = {trade_post_has_building = tr_garrison_1}
            set_flag = repair_tr_garrison_1
        }
       
        if {
            limit = {trade_post_has_building = tr_silk_road_3}
            set_flag = repair_tr_silk_road_3
        }
        if = {
            limit = {trade_post_has_building = tr_silk_road_2}
            set_flag = repair_tr_silk_road_2
        }
        if = {
            limit = {trade_post_has_building = tr_silk_road_1}
            set_flag = repair_tr_silk_road_1
        }
        if {
            limit = {trade_post_has_building = trade_offices_3}
            set_flag = repair_trade_offices_3
        }
        if = {
            limit = {trade_post_has_building = trade_offices_2}
            set_flag = repair_trade_offices_2
        }
        if = {
            limit = {trade_post_has_building = trade_offices_1}
            set_flag = repair_trade_offices_1
        }
        if {
            limit = {trade_post_has_building = mercenary_garrison_3}
            set_flag = repair_mercenary_garrison_3
        }
        if = {
            limit = {trade_post_has_building = mercenary_garrison_2}
            set_flag = repair_mercenary_garrison_2
        }
        if = {
            limit = {trade_post_has_building = mercenary_garrison_1}
            set_flag = repair_mercenary_garrison_1
        }
        if {
            limit = {trade_post_has_building = radhanite_quarter_3}
            set_flag = repair_radhanite_quarter_3
        }
        if = {
            limit = {trade_post_has_building = radhanite_quarter_2}
            set_flag = repair_radhanite_quarter_2
        }
        if = {
            limit = {trade_post_has_building = radhanite_quarter_1}
            set_flag = repair_radhanite_quarter_1
        }
        if {
            limit = {trade_post_has_building = tr_sahara_3}
            set_flag = repair_tr_sahara_3
        }
        if = {
            limit = {trade_post_has_building = tr_sahara_2}
            set_flag = repair_tr_sahara_2
        }
        if = {
            limit = {trade_post_has_building = tr_sahara_1}
            set_flag = repair_tr_sahara_1
        }
        if {
            limit = {trade_post_has_building = tr_gold_mine_3}
            set_flag = repair_tr_gold_mine_3
        }
        if = {
            limit = {trade_post_has_building = tr_gold_mine_2}
            set_flag = repair_tr_gold_mine_2
        }
        if = {
            limit = {trade_post_has_building = tr_gold_mine_1}
            set_flag = repair_tr_gold_mine_1
        }
        if {
            limit = {trade_post_has_building = tr_salt_mine_1}
            set_flag = repair_tr_salt_mine_1
        }
        if {
            limit = {trade_post_has_building = tr_cloth_production_1}
            set_flag = repair_cloth_production_1
        }
        trade_post_owner = {
           
            wealth = 100
        }
        destroy_tradepost = THIS
        set_flag = repair_trade_post_being_cleaned
   
   
    }
}   

character_event = {
    id = repair_TP.4
    is_triggered_only = yes
    is_ruler = yes
    hide_window = yes
   
    trigger = {
        is_patrician = yes
        war = no
        NOT = {
                any_trade_post = {
                    trade_post_is_building = yes
                }
        }
    }
    fail_trigger_effect = {
        if = {
            limit = {
                any_trade_post = {
                    trade_post_is_building = yes
                }
            }
            delay = 50
            character_event = {id = repair_TP.4}
        }
   
    }
    immediate = {
        random_realm_lord = {
                limit = {
                    is_patrician = yes
                    NOT = { character = ROOT }
                }
                save_event_target_as = target_usurper
            }
       
        any_trade_post = {#destroy all the trade posts
       
            province_event = {id = repair_TP.3}
        }
        any_province = {#recreate and give to another patrician
            limit = {
                has_flag = repair_trade_post_being_cleaned
            }
            province_event = {id = repair_TP.5}
        }
       
    }
    after = {
        event_target:target_usurper = {
            any_trade_post = {
                limit = {
                    has_flag = repair_trade_post_being_cleaned
                }
                seize_trade_post = ROOT
                clear_flags_with_prefix = repair_
            }
        }
       
    }
}
province_event = {
    id = repair_TP.5
    hide_window = yes
    is_triggered_only = yes

    immediate = {
        FROM = {
           
            create_tradepost  = ROOT
        }
        if {
            limit = {has_flag = repair_tr_port_3}
            add_to_extra_holding = {
                type = trade_post
                building = tr_port_3
            }
        }
        if = {
            limit = {has_flag = repair_tr_port_2}
            add_to_extra_holding = {
                type = trade_post
                building = tr_port_2
            }
        }
        if = {
            limit = {has_flag = repair_tr_port_1}
            add_to_extra_holding = {
                type = trade_post
                building = tr_port_1
            }
        }
        if {
            limit = {has_flag = repair_tr_enclave_3}
            add_to_extra_holding = {
                type = trade_post
                building = tr_enclave_3
            }
        }
        if = {
            limit = {has_flag = repair_tr_enclave_2}
            add_to_extra_holding = {
                type = trade_post
                building = tr_enclave_2
            }
        }
        if = {
            limit = {has_flag = repair_tr_enclave_1}
            add_to_extra_holding = {
                type = trade_post
                building = tr_enclave_1
            }
        }
        if {
            limit = {has_flag = repair_tr_garrison_3}
            add_to_extra_holding = {
                type = trade_post
                building = tr_garrison_3
            }
        }
        if = {
            limit = {has_flag = repair_tr_garrison_2}
            add_to_extra_holding = {
                type = trade_post
                building = tr_garrison_2
            }
        }
        if = {
            limit = {has_flag = repair_tr_garrison_1}
            add_to_extra_holding = {
                type = trade_post
                building = tr_garrison_1
            }
        }
        if {
            limit = {has_flag = repair_tr_silk_road_3}
            add_to_extra_holding = {
                type = trade_post
                building = tr_silk_road_3
            }
        }
        if = {
            limit = {has_flag = repair_tr_silk_road_2}
            add_to_extra_holding = {
                type = trade_post
                building = tr_silk_road_2
            }
        }
        if = {
            limit = {has_flag = repair_tr_silk_road_1}
            add_to_extra_holding = {
                type = trade_post
                building = tr_silk_road_1
            }
        }
        if {
            limit = {has_flag = repair_trade_offices_3}
            add_to_extra_holding = {
                type = trade_post
                building = trade_offices_3
            }
        }
        if = {
            limit = {has_flag = repair_trade_offices_2}
            add_to_extra_holding = {
                type = trade_post
                building = trade_offices_2
            }
        }
        if = {
            limit = {has_flag = repair_trade_offices_1}
            add_to_extra_holding = {
                type = trade_post
                building = trade_offices_1
            }
        }
        if {
            limit = {has_flag = repair_mercenary_garrison_3}
            add_to_extra_holding = {
                type = trade_post
                building = mercenary_garrison_3
            }
        }
        if = {
            limit = {has_flag = repair_mercenary_garrison_2}
            add_to_extra_holding = {
                type = trade_post
                building = mercenary_garrison_2
            }
        }
        if = {
            limit = {has_flag = repair_mercenary_garrison_1}
            add_to_extra_holding = {
                type = trade_post
                building = mercenary_garrison_1
            }
        }
        if {
            limit = {has_flag = repair_radhanite_quarter_3}
            add_to_extra_holding = {
                type = trade_post
                building = radhanite_quarter_3
            }
        }
        if = {
            limit = {has_flag = repair_radhanite_quarter_2}
            add_to_extra_holding = {
                type = trade_post
                building = radhanite_quarter_2
            }
        }
        if = {
            limit = {has_flag = repair_radhanite_quarter_1}
            add_to_extra_holding = {
                type = trade_post
                building = radhanite_quarter_1
            }
        }
        if {
            limit = {has_flag = repair_tr_sahara_3}
            add_to_extra_holding = {
                type = trade_post
                building = tr_sahara_3
            }
        }
        if = {
            limit = {has_flag = repair_tr_sahara_2}
            add_to_extra_holding = {
                type = trade_post
                building = tr_sahara_2
            }
        }
        if = {
            limit = {has_flag = repair_tr_sahara_1}
            add_to_extra_holding = {
                type = trade_post
                building = tr_sahara_1
            }
        }
        if {
            limit = {has_flag = repair_tr_gold_mine_3}
            add_to_extra_holding = {
                type = trade_post
                building = tr_gold_mine_3
            }
        }
        if = {
            limit = {has_flag = repair_tr_gold_mine_2}
            add_to_extra_holding = {
                type = trade_post
                building = tr_gold_mine_2
            }
        }
        if = {
            limit = {has_flag = repair_tr_gold_mine_1}
            add_to_extra_holding = {
                type = trade_post
                building = tr_gold_mine_1
            }
        }
        if {
            limit = {has_flag = repair_tr_salt_mine_3}
            add_to_extra_holding = {
                type = trade_post
                building = tr_salt_mine_3
            }
        }
        if = {
            limit = {has_flag = repair_tr_salt_mine_2}
            add_to_extra_holding = {
                type = trade_post
                building = tr_salt_mine_2
            }
        }
        if = {
            limit = {has_flag = repair_tr_salt_mine_1}
            add_to_extra_holding = {
                type = trade_post
                building = tr_salt_mine_1
            }
        }
        if {
            limit = {has_flag = repair_tr_cloth_production_3}
            add_to_extra_holding = {
                type = trade_post
                building = tr_cloth_production_3
            }
        }
        if = {
            limit = {has_flag = repair_tr_cloth_production_2}
            add_to_extra_holding = {
                type = trade_post
                building = tr_cloth_production_2
            }
        }
        if = {
            limit = {has_flag = repair_tr_cloth_production_1}
            add_to_extra_holding = {
                type = trade_post
                building = tr_cloth_production_1
            }
        }
        seize_trade_post = event_target:target_usurper
    }
}

SOLUTION: When I was transferring the tradeposts to another patrician I was using "random_realm_lord" to select another patrician, but I think that that finds someone below the scope. I changed it to
Code:
liege = {
            random_realm_lord = {
                    limit = {
                        is_patrician = yes
                        NOT = { character = ROOT }
                    }
                    save_event_target_as = target_usurper
            }
        }
and now it works just fine.
 
Last edited:

Rockphed

Uncultured Barbarian
19 Badges
Jan 31, 2017
1.060
60
  • 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 want to fire events when people are no longer involved in wars. I see the 4 ways a war can end and that the attacker is FROM and defender is ROOT. How would I go about scoping to anyone who was called in (or otherwise joined) the war that just ended?

Also, does the "war" condition return true or false if your liege is involved in a war?
 

Silversweeeper

Ichi no Hito
58 Badges
Aug 24, 2012
3.626
2.343
  • Crusader Kings II: Monks and Mystics
  • Pillars of Eternity
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Cossacks
  • Crusader Kings II: Conclave
  • Stellaris
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Rights of Man
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Europa Universalis IV: Common Sense
  • Stellaris - Path to Destruction bundle
  • Europa Universalis IV: Mandate of Heaven
  • Europa Universalis IV: Cradle of Civilization
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Stellaris: Distant Stars
  • Stellaris: Megacorp
  • Crusader Kings II: Holy Fury
  • Imperator: Rome Deluxe Edition
  • Stellaris: Ancient Relics
  • Imperator: Rome Sign Up
  • Crusader Kings II: Way of Life
  • Magicka: Wizard Wars Founder Wizard
  • Europa Universalis IV: El Dorado
  • 500k Club
  • Europa Universalis IV
  • Europa Universalis III Complete
  • Stellaris: Lithoids
  • Stellaris: Federations
  • Europa Universalis III Complete
  • Stellaris: Nemesis
  • Stellaris: Necroids
  • 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
How does the game rank the titles belonging to the same tier? For example, an ai character has many count titles, it usually chooses the first one as the primary title.

As far as I can remember the AI first goes with culture (e.g. a Swedish character will pick Sweden over Denmark 100 % of the time since Sweden has "culture = swedish", but an English character wouldn't consider either better than the other based on culture), then dignity (number of counties in the de jure plus the scripted dignity rating (used in a few places where it is relevant historically, e.g. Lotharingia > Burgundy), after which I don't know if it has any priorities (I suspect the game as a whole goes off of either the order in which it reads the titles (based on file structures and with dynamic ones presumably being appended at the end in creation order) or alphabetically).
 

liyanjifeng

Private
23 Badges
Apr 3, 2020
14
0
  • Crusader Kings II: Way of Life
  • Crusader Kings III Referal
  • Crusader Kings II: Holy Fury
  • Cities: Skylines - Parklife
  • Crusader Kings II: Jade Dragon
  • Cities: Skylines - Green Cities
  • Cities: Skylines - Mass Transit
  • Cities: Skylines - Natural Disasters
  • Cities: Skylines - Snowfall
  • Crusader Kings II: Conclave
  • Cities: Skylines - After Dark
  • Crusader Kings II: Horse Lords
  • Cities: Skylines
  • Crusader Kings II
  • Cities: Skylines Deluxe Edition
  • 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
As far as I can remember the AI first goes with culture (e.g. a Swedish character will pick Sweden over Denmark 100 % of the time since Sweden has "culture = swedish", but an English character wouldn't consider either better than the other based on culture), then dignity (number of counties in the de jure plus the scripted dignity rating (used in a few places where it is relevant historically, e.g. Lotharingia > Burgundy), after which I don't know if it has any priorities (I suspect the game as a whole goes off of either the order in which it reads the titles (based on file structures and with dynamic ones presumably being appended at the end in creation order) or alphabetically).
Thank you, silverweeper.
 

Silversweeeper

Ichi no Hito
58 Badges
Aug 24, 2012
3.626
2.343
  • Crusader Kings II: Monks and Mystics
  • Pillars of Eternity
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Cossacks
  • Crusader Kings II: Conclave
  • Stellaris
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Rights of Man
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Europa Universalis IV: Common Sense
  • Stellaris - Path to Destruction bundle
  • Europa Universalis IV: Mandate of Heaven
  • Europa Universalis IV: Cradle of Civilization
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Stellaris: Distant Stars
  • Stellaris: Megacorp
  • Crusader Kings II: Holy Fury
  • Imperator: Rome Deluxe Edition
  • Stellaris: Ancient Relics
  • Imperator: Rome Sign Up
  • Crusader Kings II: Way of Life
  • Magicka: Wizard Wars Founder Wizard
  • Europa Universalis IV: El Dorado
  • 500k Club
  • Europa Universalis IV
  • Europa Universalis III Complete
  • Stellaris: Lithoids
  • Stellaris: Federations
  • Europa Universalis III Complete
  • Stellaris: Nemesis
  • Stellaris: Necroids
  • 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
it also probly calculates the county holdings development, I gave away a fully developed county castle to a duke and he moved capital there.

Was it the de jure capital of his primary title or the only county in his primary de jure? The AI definitely prefers using the scripted de jure capital if there's not a good reason not to (e.g. holding type mismatch), and I believe it usually prefers being inside the de jure to not being inside the de jure.
 

kiannameiou

Sergeant
1 Badges
Apr 27, 2021
51
5
  • Crusader Kings II
Was it the de jure capital of his primary title or the only county in his primary de jure? The AI definitely prefers using the scripted de jure capital if there's not a good reason not to (e.g. holding type mismatch), and I believe it usually prefers being inside the de jure to not being inside the de jure.
must be de jure, his liege died, and he had eligible heirs, the other count didnt. and i had one of the de jure county to give. So i gave the duchy and everything under it.
 

jursamaj

General
121 Badges
Aug 20, 2012
2.334
202
  • 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
  • Stellaris: Nemesis
Thank you for being helpful. I appreciate that.

To clarify: The converter is an application that converts a save game from a game to another. It generates the mod so as it converts a mod for the CKII it is out and no more used during the game. It sort of translates the I:R into a mod that the player can enjoy on CKII. But while generating the CKII it can modify certain files such as regions holdings and to a certain level characters and what they own at the moment according to what is in the I:R mode. I assume This means that It is implemented in the game not as a separate program as it is no more in use once the conversion is done.

Actually I have come to understand that It would not be possible to fully control the tech advancement If the modifiers don't work for events or the events can't be modified. unless the tech is disabled or ideally capped for certain years. Or the events are controlled. Well perfection seems further but advancement can be achieved if the modification to the passive research can be gained. Do you know how I can add a modifier to the research so I test the outcome? I mean is it in one of the text files or it is inside the codes of the game?
Well the monthly base rate is set in common/defines.lua under NTechnology: "POINTS_PER_ATTRIBUTE = 0.04". Some buildings, wonders and event modifiers also add .01 to 1.0 each to that total. These all have "<type>_techpoints = X" lines. All of these use values that are multiples of .01, but I imagine they can use more decimal places if needed.

Dozens of events give lump sums of -50 to 400, as do some council jobs. They use the same "<type>_techpoints" language as above.

Battles give military tech points. It's not clear how it's calculated, but that doesn't matter if you just want to reduce it overall. You can modify all battle awards in common/defines.lua under NMilitary: "BATTLE_TECH_MULTIPLIER = 0.5". Cutting that to .25 will give half as much from any given battle, and so on.

So, to effectively adjust the technology rate, you'd need to adjust everywhere that "*_techpoints = X" appears, multiplying X by the fraction you want, plus modify the POINTS_PER_ATTRIBUTE & BATTLE_TECH_MULTIPLIER the same way. The last 2 are easy. The other would be a major undertaking. And if the player adds any mods, that could wreck it all.
 

Silversweeeper

Ichi no Hito
58 Badges
Aug 24, 2012
3.626
2.343
  • Crusader Kings II: Monks and Mystics
  • Pillars of Eternity
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Cossacks
  • Crusader Kings II: Conclave
  • Stellaris
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Rights of Man
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Europa Universalis IV: Common Sense
  • Stellaris - Path to Destruction bundle
  • Europa Universalis IV: Mandate of Heaven
  • Europa Universalis IV: Cradle of Civilization
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Stellaris: Distant Stars
  • Stellaris: Megacorp
  • Crusader Kings II: Holy Fury
  • Imperator: Rome Deluxe Edition
  • Stellaris: Ancient Relics
  • Imperator: Rome Sign Up
  • Crusader Kings II: Way of Life
  • Magicka: Wizard Wars Founder Wizard
  • Europa Universalis IV: El Dorado
  • 500k Club
  • Europa Universalis IV
  • Europa Universalis III Complete
  • Stellaris: Lithoids
  • Stellaris: Federations
  • Europa Universalis III Complete
  • Stellaris: Nemesis
  • Stellaris: Necroids
  • 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 there a way to scope only your own commanders? I'm trying to create a remove all your commanders effect. For some reason, the commanders at game start, who own land cant be assigned to armies.

Code:
remove_all_commanders_effect = {
    any_courtier_or_vassal = {
        limit = {
            has_minor_title = title_commander
        }
        remove_title = title_commander
    }
}
 

Rockphed

Uncultured Barbarian
19 Badges
Jan 31, 2017
1.060
60
  • 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 fire an event whenever somebody is no longer involved in a war. I have the event working for the 4 ways wars can end, but people can also be removed from a war during inheritance. Is there a better way to fire my event than using on_death and an event with is_ruler = yes as a pre-trigger that calls my event on their heirs after 1 day? I suppose I need to fire the event for everyone who inherits any titles; is that just "any_demense_title = {current_heir = {character_event = {id = <event id> days = 1}}}"?

Also, am I missing any ways people can stop being involved in wars? Is there a way to leave a crusade after it starts beyond inheriting as someone who either hadn't joined or is the wrong religion?
 

Aerotinge

Gouverneur van Torkia
41 Badges
Aug 1, 2018
527
155
  • Battle for Bosporus
  • Surviving Mars
  • Hearts of Iron IV: Expansion Pass
  • Hearts of Iron IV: Expansion Pass
  • Hearts of Iron IV: Death or Dishonor
  • Hearts of Iron IV: Together for Victory
  • Hearts of Iron IV: Cadet
  • Crusader Kings II
  • Europa Universalis IV: Mare Nostrum
  • Europa Universalis IV: Third Rome
  • Crusader Kings II: Jade Dragon
  • Crusader Kings II: Holy Fury
  • Europa Universalis IV: Dharma
  • Europa Universalis IV: Rule Britannia
  • Europa Universalis IV: Cradle of Civilization
  • Age of Wonders III
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Mandate of Heaven
  • Crusader Kings II: Monks and Mystics
  • Europa Universalis IV: Rights of Man
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Golden Century
  • Crusader Kings II: Conclave
  • Europa Universalis IV: Cossacks
  • Crusader Kings III Referal
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: El Dorado
  • 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: Art of War
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Res Publica
  • Europa Universalis IV: Pre-order
How can I scope to a title that controls religion of a character, in the absence of the religion head?
e.g I want to scope d_iconoclast when being an iconoclast but the "create iconoclast patriarchy" decision is yet taken.
religion_head is a character scope and not working if absence.
 

Silversweeeper

Ichi no Hito
58 Badges
Aug 24, 2012
3.626
2.343
  • Crusader Kings II: Monks and Mystics
  • Pillars of Eternity
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Cossacks
  • Crusader Kings II: Conclave
  • Stellaris
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Rights of Man
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Europa Universalis IV: Common Sense
  • Stellaris - Path to Destruction bundle
  • Europa Universalis IV: Mandate of Heaven
  • Europa Universalis IV: Cradle of Civilization
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Stellaris: Distant Stars
  • Stellaris: Megacorp
  • Crusader Kings II: Holy Fury
  • Imperator: Rome Deluxe Edition
  • Stellaris: Ancient Relics
  • Imperator: Rome Sign Up
  • Crusader Kings II: Way of Life
  • Magicka: Wizard Wars Founder Wizard
  • Europa Universalis IV: El Dorado
  • 500k Club
  • Europa Universalis IV
  • Europa Universalis III Complete
  • Stellaris: Lithoids
  • Stellaris: Federations
  • Europa Universalis III Complete
  • Stellaris: Nemesis
  • Stellaris: Necroids
  • 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
How can I scope to a title that controls religion of a character, in the absence of the religion head?
e.g I want to scope d_iconoclast when being an iconoclast but the "create iconoclast patriarchy" decision is yet taken.
religion_head is a character scope and not working if absence.

You can explicitly scope to the title, and since you know which title it's going to be for which religion (and can check if HF-reformed pagans reformed with a rel head or not) you can create a scripted_effect containing if/else_ifs that simplifies the script in any file where you need to do the scoping.

Code:
find_rel_head_title_scope_effect = {
    if = {
        limit = {
            religion = catholic
        }
        k_papal_state = {
            save_event_target_as = my_rel_head_title_scope
        }
    }
    <Etc.>
}
 

Aerotinge

Gouverneur van Torkia
41 Badges
Aug 1, 2018
527
155
  • Battle for Bosporus
  • Surviving Mars
  • Hearts of Iron IV: Expansion Pass
  • Hearts of Iron IV: Expansion Pass
  • Hearts of Iron IV: Death or Dishonor
  • Hearts of Iron IV: Together for Victory
  • Hearts of Iron IV: Cadet
  • Crusader Kings II
  • Europa Universalis IV: Mare Nostrum
  • Europa Universalis IV: Third Rome
  • Crusader Kings II: Jade Dragon
  • Crusader Kings II: Holy Fury
  • Europa Universalis IV: Dharma
  • Europa Universalis IV: Rule Britannia
  • Europa Universalis IV: Cradle of Civilization
  • Age of Wonders III
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Mandate of Heaven
  • Crusader Kings II: Monks and Mystics
  • Europa Universalis IV: Rights of Man
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Golden Century
  • Crusader Kings II: Conclave
  • Europa Universalis IV: Cossacks
  • Crusader Kings III Referal
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: El Dorado
  • 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: Art of War
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Res Publica
  • Europa Universalis IV: Pre-order
You can explicitly scope to the title, and since you know which title it's going to be for which religion (and can check if HF-reformed pagans reformed with a rel head or not) you can create a scripted_effect containing if/else_ifs that simplifies the script in any file where you need to do the scoping.

Code:
find_rel_head_title_scope_effect = {
    if = {
        limit = {
            religion = catholic
        }
        k_papal_state = {
            save_event_target_as = my_rel_head_title_scope
        }
    }
    <Etc.>
}
Thanks, so I end up have to enumerate these titles first. :/

Update:
Code:
any_title = {
    limit = {
        controls_religion = yes
        has_holder = no
        # more conditions...
    }
}
works for me, but it's CPU heavy and bad for trigger block like law and governent.
 
Last edited: