• 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.
Hallo, I want to create an event where at a certain date, 1193, a character is spawned in as a landless kingdom title. She would have a boatload of troops. She would then use those troops to take over land. After about 10 years, all wars with her stop and she gains all the land she had sieged. This would then make the kingdom she had become landed, and all the holdings are instantly de lure. Also. She is a religion head of a new religion. The religion doesn't exist till she does, and when she settles down after ten years she becomes the new religion head. After that, all her vassals become the religion.

1. is this possible?
2. can someone help me with this?

Yes, this is possible.
The creation of the character and their support (title, army, etc.) is just typical scripting. If you want to see something like that, check out the mongol/aztec arrival events for an example. You can also start wars depending on the location of the character or by some other means (see Charlemagne event for auto-declaration of war, CM.1100 with reverse_war) You can set up a hidden event for the pope to activate an event chain (which will likely call an event to notify everyone by setting the event major=yes) for after a certain year (year=yeartobevalid under trigger with another NOT={year=yeartonotbeabletofirepast}) with a MTTH of less than one year (you could make it 1 day, then it will happen really early in the year). Similarly, you can check the time global flags have been active (had_global_flag={ flag=flagname days=numberofdaysactive}). Alternatively, you can set up an event to fire in exactly 10 years (character_event={ id=id.value days=numberofdaysuntillaunch}). At that point, it comes down to scripting the ability to take all the captured provinces. You should check the invasion casus belli under 00_cb_types to annex entire occupied territories, not just the war goal ones. As for assigning de jure-ness for the conquered territory, I am not so sure how to do that. What I can find under the files (at 1:10 am) is that you can set de jure liege via a certain commands. See misc_old_gods_events for event 62910. This demonstrates changing de jure lieges. Another thing that you should check is under realm_decisions for create_aragon. This demonstrates the ability to check for if you have complete control over a title. Religion modding is outside my realm of experience, but it would be similar to the Jewish faith gaining their religious head. Check realm_decisions for restore_high_priesthood for how to do it.
Hopefully I have been able to help in my sleep deprived state!
 
Is there a command to auto-hand out viceroyalities? I've been looking and haven't found anything yet.
 
Is there a command to auto-hand out viceroyalities? I've been looking and haven't found anything yet.

That would be handy. I wish viceroyalties had something like the Catholic Bishopric's "appoint successor" button; if you appointed no one, the game would automatically choose someone who had the best combination of good stats and high opinion of you. Having to hand out every viceroyalty each generation is a bit too much micromanagement.
 
Is there a way to destroy titular county titles? I tried using both "destroy_landed_title" and "unsafe_destroy_landed_title", but it doesn't seem to work.

Here is my code, by the way:

Code:
title_decisions = {
   destroy_titular_county = {
       only_playable = yes
       filter = owned
       ai_target_filter = owned
       
       from_potential = {
           is_playable = yes
       }
       
       potential = {
           owner = {
               character = FROM
           }
           is_titular_county_trigger = yes
       }

       allow = {
           FROM = {
               primary_title = {
                   NOT = { title = ROOT }
               }
           }
       }

       effect = {
           unsafe_destroy_landed_title = THIS
       }

       revoke_allowed = {
           always = no
       }

       ai_will_do = {
           factor = 0
       }
   }
}
 
Is there a way to destroy titular county titles? I tried using both "destroy_landed_title" and "unsafe_destroy_landed_title", but it doesn't seem to work.

Here is my code, by the way:

Code:
title_decisions = {
   destroy_titular_county = {
       only_playable = yes
       filter = owned
       ai_target_filter = owned
      
       from_potential = {
           is_playable = yes
       }
      
       potential = {
           owner = {
               character = FROM
           }
           is_titular_county_trigger = yes
       }

       allow = {
           FROM = {
               primary_title = {
                   NOT = { title = ROOT }
               }
           }
       }

       effect = {
           unsafe_destroy_landed_title = THIS
       }

       revoke_allowed = {
           always = no
       }

       ai_will_do = {
           factor = 0
       }
   }
}
You cannot destroy count tier titles as they are meant to be always be tied to a province. Don't use titular count titles, use duke or above ones instead as that way you can destroy them and also use the activate_title command to ensure they cannot be recreated unless activated again in script.
 
You cannot destroy count tier titles as they are meant to be always be tied to a province. Don't use titular count titles, use duke or above ones instead as that way you can destroy them and also use the activate_title command to ensure they cannot be recreated unless activated again in script.

Thanks for the explanation :)

The titular county titles seem to work well, other than being unable to destroy them (and the less important issue of not being able to search for them). Not being able to destroy them is annoying, but at least it cannot harm the player, and having titular counties allows depicting European aristocracy better, i.e. I can make the von Schwarzenberg family be able to progress (as historically) from baron, to count, to duke. One thing I considered was to have the titular counties as traits instead, but that is less interesting than to have them as counties. If there are any further issues I should consider that approach again, though.
 
is there an event kicking about somewhere that I can use that links a councillor position with a title ? I want it so that a title is automatically giving to the person that's granted the council position of Court Chaplain
 
is there an event kicking about somewhere that I can use that links a councillor position with a title ? I want it so that a title is automatically giving to the person that's granted the council position of Court Chaplain
In common/job_titles/00_job_titles.txt, under job_spiritual, there is a gain_effect = { }. Call an event inside that block, or script the effect right in that block. (There is also a lose_effect = { } block.)
 
Yes, this is possible.
The creation of the character and their support (title, army, etc.) is just typical scripting. If you want to see something like that, check out the mongol/aztec arrival events for an example. You can also start wars depending on the location of the character or by some other means (see Charlemagne event for auto-declaration of war, CM.1100 with reverse_war) You can set up a hidden event for the pope to activate an event chain (which will likely call an event to notify everyone by setting the event major=yes) for after a certain year (year=yeartobevalid under trigger with another NOT={year=yeartonotbeabletofirepast}) with a MTTH of less than one year (you could make it 1 day, then it will happen really early in the year). Similarly, you can check the time global flags have been active (had_global_flag={ flag=flagname days=numberofdaysactive}). Alternatively, you can set up an event to fire in exactly 10 years (character_event={ id=id.value days=numberofdaysuntillaunch}). At that point, it comes down to scripting the ability to take all the captured provinces. You should check the invasion casus belli under 00_cb_types to annex entire occupied territories, not just the war goal ones. As for assigning de jure-ness for the conquered territory, I am not so sure how to do that. What I can find under the files (at 1:10 am) is that you can set de jure liege via a certain commands. See misc_old_gods_events for event 62910. This demonstrates changing de jure lieges. Another thing that you should check is under realm_decisions for create_aragon. This demonstrates the ability to check for if you have complete control over a title. Religion modding is outside my realm of experience, but it would be similar to the Jewish faith gaining their religious head. Check realm_decisions for restore_high_priesthood for how to do it.
Hopefully I have been able to help in my sleep deprived state!
Thanks, sorry I was rather busy these last couple days. I will see what I can get done.
 
:eek: I had no idea CK2 had while loops now!

Thanks for the code! Unfortunately though, it doesn't seem to be working; fractions appear after using it.

EDIT: Ah, I've found out why it wasn't working. There was a missing bracket in the limit of the second while loop. The last subtract_variable should also apparently use "fraction_size" instead of "multiple_size". Now it works fine :)

An update on this: I've found out a simpler and much less performance-expensive way to remove fractions: just divide by 1,000 and then multiply by 1,000. The variables aren't floats, but actually integers with a shifted decimal point.
 
You cannot destroy count tier titles as they are meant to be always be tied to a province. Don't use titular count titles, use duke or above ones instead as that way you can destroy them and also use the activate_title command to ensure they cannot be recreated unless activated again in script.
Thanks for the explanation :)

The titular county titles seem to work well, other than being unable to destroy them (and the less important issue of not being able to search for them). Not being able to destroy them is annoying, but at least it cannot harm the player, and having titular counties allows depicting European aristocracy better, i.e. I can make the von Schwarzenberg family be able to progress (as historically) from baron, to count, to duke. One thing I considered was to have the titular counties as traits instead, but that is less interesting than to have them as counties. If there are any further issues I should consider that approach again, though.
It used to be possible to do workarounds in order to destroy them. That was removed in the last major 2.7 version, AFAIK.
 
It used to be possible to do workarounds in order to destroy them. That was removed in the last major 2.7 version, AFAIK.

Ah yes, I remember reading your post about deactivating county titles no longer being possible. Thanks for the information :)
 
sorry if it has been asked before.

Is there a way that certain building works differently for different cultures?

What I want is that for some cultures, the building has certain technology/law requirements, while for others it doesn't. Is this possible?

In fact, to have this condition only for certain cultures.
Code:
    tb_hillfort_4 = {
        desc = tb_hillfort_4_desc
        trigger = {
            TECH_CASTLE_CONSTRUCTION = 1
            OR = {
            has_law = tribal_organization_0
            has_law = tribal_organization_1
            }
        }
        upgrades_from = tb_hillfort_3
        gold_cost = 100
        build_time = 365
      
        fort_level = 0.25
        levy_size = 0.05
        ai_creation_factor = 100
        ai_feudal_modifier = 10
        ai_republic_modifier = -10
      
        convert_to_city = ct_wall_2
      
        extra_tech_building_start = 2.5
    }

where should I place this condition to make it work only for these cultures, and for others to work without that law condition?
Code:
      potential = {
            FROM = {
                OR = {
                    culture_group = north_african
                    culture = bedouin_arabic
                    culture = beja
                }
            }
        }
 
sorry if it has been asked before.

Is there a way that certain building works differently for different cultures?

What I want is that for some cultures, the building has certain technology/law requirements, while for others it doesn't. Is this possible?

In fact, to have this condition only for certain cultures.
Code:
    tb_hillfort_4 = {
        desc = tb_hillfort_4_desc
        trigger = {
            TECH_CASTLE_CONSTRUCTION = 1
            OR = {
            has_law = tribal_organization_0
            has_law = tribal_organization_1
            }
        }
        upgrades_from = tb_hillfort_3
        gold_cost = 100
        build_time = 365
     
        fort_level = 0.25
        levy_size = 0.05
        ai_creation_factor = 100
        ai_feudal_modifier = 10
        ai_republic_modifier = -10
     
        convert_to_city = ct_wall_2
     
        extra_tech_building_start = 2.5
    }

where should I place this condition to make it work only for these cultures, and for others to work without that law condition?
Code:
      potential = {
            FROM = {
                OR = {
                    culture_group = north_african
                    culture = bedouin_arabic
                    culture = beja
                }
            }
        }

It is possible, but do you want it to work that way for different cultures for the province, or for the province's owner?
 
Quick question about special characters in names.

I have created a norse pagan culture as part of a mod. All seems fine except for the special characters such as ð or Ð which are displaying as unusual symbols. This surprised me as I thought I had just copy/pasted the common/cultures file section from the norse section into my culture. It is also doing the same for the dynasty names.

Any suggestion of where to look would be very welcome.

PS. validator is turning up nothing
 
Quick question about special characters in names.

I have created a norse pagan culture as part of a mod. All seems fine except for the special characters such as ð or Ð which are displaying as unusual symbols. This surprised me as I thought I had just copy/pasted the common/cultures file section from the norse section into my culture. It is also doing the same for the dynasty names.

Any suggestion of where to look would be very welcome.

PS. validator is turning up nothing

You need to encode your file in ANSI. If you are using Notepad++ click on the "Encoding" menu, and then "Convert to ANSI".
 
Is there any way to give existing characters a random first name (from their culture, as occurs with newly-born characters)? It would be very useful for setting the name of history characters for whom I have data only on the surname.

I'm using this code at the moment:

Code:
    save_event_target_as = name_target
   random_character = {
       limit = {
           culture = PREV
           religion = PREV
       }
       event_target:name_target = {
           copy_name = PREV
       }
   }

It works, but isn't really a good way to go about doing it, specially in regards to performance (though since this is done only when loading history, it is not as bad as doing it in an event).
 
It is possible, but do you want it to work that way for different cultures for the province, or for the province's owner?
thanks!
What matters is the owner
 
Is there any way to give existing characters a random first name (from their culture, as occurs with newly-born characters)? It would be very useful for setting the name of history characters for whom I have data only on the surname.

I'm using this code at the moment:

Code:
    save_event_target_as = name_target
   random_character = {
       limit = {
           culture = PREV
           religion = PREV
       }
       event_target:name_target = {
           copy_name = PREV
       }
   }

It works, but isn't really a good way to go about doing it, specially in regards to performance (though since this is done only when loading history, it is not as bad as doing it in an event).
Create a new character then copy the name and kill the created character?