• 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.
Plenty of ways to do that. One easy way would be to make a basic event that automatically moves unwanted characters. Such as...
Code:
character_event = {
   id = <ID>

   is_triggered_only = yes
   hide_window = yes

   trigger = { #Add conditions as needed
       host = { ai = no } # Trigger only for characters in the player's court
       host = { NOT = { dynasty = ROOT } } #...all except dynasty members
   }
 
    immediate = {
       random_playable_ruler = {
           limit = {
               ai = yes
               religion_group = ROOT
           }
           ROOT = { move_character = PREV }   #Moves the character to a random AI court.
       }
   }

   option = {
       name = OK
   }
}
...just fire it from both on_avoided_imprison_fled_country and on_exiled on_actions, and that'll get rid of most newcomers. Not the auto-generated court fillers, though.

As for me, I handled them by making a new trait 'stranger', which allows any ruler (AI included) to manage new courtiers in various ways through decisions (welcome to court, banish, imprison or execute under certain conditions, etc), without suffering from normal penalties for e.g. banishing courtiers.

Thanks for the reply :)
For my issue, I ended up just sending them to somewhere else right before abdicating and killing them; I still get the messages (apparently they still come to me, but then instantly leave), so I'm not stuck with them :D
 
The Council positions names are handled by localization keys. The main ones are job_chancellor, job_marshal, job_tresurer, job_spymaster, and job_spiritual. Some, however, are overridden based off religion or culture, like job_spiritual_christian or job_chancellor_arabic. I'm not sure where it specifies to do that.

To add characters that already exist at the start of the game, add them in a file in the history/characters folder. (For more details: http://www.ckiiwiki.com/Character_modding)
If you are wanting them to be added mid-game, they'll need to be added in an event with the create_character command.
 
Does anyone know the basis of code to make people swap culture in an area? For example I want the greeks in the middle east to become a my new custom culture while those in greece remain greek
 
In an event, you can use the culture command in a province scope to change that province's culture.

So, something like
Code:
any_province = {
   limit = {
      region = world_middle_east
      culture = greek
   }
   culture = my_culture
}
 
In an event, you can use the culture command in a province scope to change that province's culture.

So, something like
Code:
any_province = {
   limit = {
      region = world_middle_east
      culture = greek
   }
   culture = my_culture
}
Thanks!
 
I would to assign a dynasty to a specific coat of arms like a historical dynasties (eg. Karlings). How can I do this?

It's done via a coat_of_arms = {} block in the dynasty definition (see http://www.ckiiwiki.com/Dynasty_modding#Coat_of_Arms).
The texture index is the index of tga sprite file to use (defined in the coats_of_arms.txt textures array for that religion). You'll need to create a new entry at the end.
The texture_internal is the frame to use inside that sprite file.
 
Add this before the any_* scope:
Code:
set_variable = { which = global_counter   value = 0 }
Then this to the limit of the scope:
Code:
limit = {
   ...
   NOT = { check_variable = { which = global_counter   value = 5 } }
}
...and this to the scope effect:
Code:
change_variable = { which = global_counter   value = 1 }

Now it's capped at five matches, and works even if there's less than five. And you can use the generated variable for other purposes afterwards, such as making sure that it found at least one match.
How about just using 'count'?

Code:
any_scope = {
    count = 5
    limit = {
        # pick them here
    }
    # do something
}
 
Problem: When editing the flag files in the gfx folder, the game continues to use the default flag from the vanilla.

Details:
- My mod has "gfx/flags" as a replace path
- Some image files I had made previously for the flag folder are working correctly in my mod.
> Several dutchies and counties are displaying the .tga files I created for them ~year ago.
> I'm using the same software (gimp 2) to create these hand made files as I did then.
- Right now I'm exporting the files from gimp as .tga files from a drop down menu, and dis-selecting the RLE compression box option (when I don't do this the image exports as a bunch of colour distorted lines of the original image). Origin is set to bottom left (I'm not sure what this means).
> The resulting files show as being .tga files when I look at their properties, and they display correctly when I open the flag file in gimp.

BUT THEN! When I load CK2 with the mod turned on, I get all the old flag files showing correctly, but any that I've created recently revert back to vanilla files.

I'm baffled. Anyone know what I'm doing wrong?

P.S. You know you're a bit OCD when you've spend 3 hours trying to fix the fact that the Isle of Man flags are off center.
 
Last edited:
My 00_province_setup.txt is failing to apply. Everything looks fine in the file, all the provinces point to the correct numbers and even have an overwrite in the .mod file for the folder. Is there anything I'm missing other than making sure that all the provinces are present?
 
Is there any way of adding a truce as an effect? I didn't find any mention of it on the wiki.
 
Is there any way of adding a truce as an effect? I didn't find any mention of it on the wiki.
I don't believe so, you can do it through an opinion modifier then block wars from being declared if you have that modifier or do a penalty if you declare with it. Could also start then end a war instantly but that would give pop ups saying so.
But there is no command to start a truce though as far as I remember.
 
Is there any way of adding a truce as an effect? I didn't find any mention of it on the wiki.
There is, actually.

Code:
ROOT = {
               set_truce = {
                   who = FROM
                   years = 5
               }
}
In the above case, ROOT would have a truce, and would not be able to attack FROM for five years.
 
There is, actually.

Code:
ROOT = {
               set_truce = {
                   who = FROM
                   years = 5
               }
}
In the above case, ROOT would have a truce, and would not be able to attack FROM for five years.
Wait that actually works? When did that command get added? Can't see a mention of it on the wiki although checking the exe it does in fact seem to be a command. Also can see it in some stuff from vanilla, can't believe I missed that :(
 
Thank you for the answer! I will put it to use. :)
 
Why doesn't this code work? I think it should work but the event target is not actually saved (I checked in the savefile).
Code:
    immediate = {
        ROOT = {
            save_event_target_as = target_father
        }
    }
The code also doesn't work if I replace ROOT with father. Any way to solve this?
 
Why doesn't this code work? I think it should work but the event target is not actually saved (I checked in the savefile).
Code:
    immediate = {
        ROOT = {
            save_event_target_as = target_father
        }
    }
The code also doesn't work if I replace ROOT with father. Any way to solve this?
That should work, you would need to post more of your code so we can tell