• 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.
Showing developer posts only. Show all posts in this thread.
For #2, I know the last time I tried it (a few patches back) the validator had a fit and so did the error logs, but I haven't yet taken the time to figure out the actual behavior.
Make a duplicate event id then test it by launching it via the console and via a separate event and see what happens. That way you can tell if it works like decisions in that either way it breaks or if it still works but like with the traits if launched then only the last one fires or if both happen at the same time.
I imagine that they just will not work
 
I am fairy sure that mods will basically overwrite anything thats not hard coded
Only if you create files to actually overwrite said things, if I make a mod to change a trait icon or add an event that will not magically mess up the landed titles or defines just out of the blue. As long as you only overwrite specific things then everything else from vanilla will stay the same.
 
  • 1
Reactions:
I have an event that is designed to expose a character's real father; however, I am missing something in my code and I'm not sure what. Any ideas?
Code:
option = {
        name = OK
      
        if = {
            limit = { father_even_if_dead = { is_father_real_father = no }}
            set_father = real_father_even_if_dead
        }
If I remember correctly the is_father_real_father condition is checked for the character you are seeing if they have the correct real father, also you cannot use scopes like that as a RHS so you would want something like this:
Code:
if = {
    limit = { is_father_real_father = no }
    real_father_even_if_dead = { ROOT = { set_father = PREV } }
}
 
I made ACR and HIP (SWMH, ARKO, EMF, CPR, LTM) compatible by making a merged mod, but a lot of flags are black. All the flag files are there and I even deleted them and added them back, but the flags are still black. The missing flags are all Christian and Jewish, and mostly counties and duchies, most major kingdoms and empires are okay. For example, France is there, but not the county Bourges or the duchy Aquitaine. Castille is missing, but not Leon. Saxony and Oldenburg are fine, but not Provence or Nice.
Clear your graphics cache in User\Documents\Paradox Interactive\Crusader Kings II\gfx or if you have a user dir then in User\Documents\Paradox Interactive\Crusader Kings II\User Dir\gfx
 
  • 1
  • 1
Reactions:
Is there a way to have the duration of a character_modifier be variable?

I attempted "duration = 90 random = 100" but that just left the duration at 90 days?

I know I _could_ set the duration to the maximum I want and then write an event with a random value in its delay and have that event just remove the character modifier, but that seems really kludgey.
I don't believe so, the event method would be the best way
 
Question: How do you start an epidemic in the Reaper's Due DLC via event?

Context: I've tried adding an is_epidemic = yes trait (has_tuberculosis) to several characters, all of which recovered after a few days which leads me to conclude that I either need to fire an event, set a character flag/modifier, or something else to get the ball rolling.
To start an epidemic in a province use spawn_disease = disease_name in a province scope.
If you want to make specific character start developing the disease then follow the same actions taken by the on_character_infection in 00_disease.txt where you set the correct character flags for the illness and the developing_illness flag as well as trigger the event from RD that comes with that illness developing.
If you want to straight up add the trait without its progression of getting symptoms then just trigger the event which adds the illness trait, for example typhus uses the event RIP.5040 and that should work I imagine,
 
  • 1
Reactions:
So I tried to look for it, and I'm not even sure it can be done, but where are is the the data for the set Crown Focus ability stored? I want to lower the requirements for vassals to set one, but I can't find the data. If it's even accessible, and not hard-coded, of course.
decisions/title_decisions the set_crown_focus and move_crown_focus decisions
 
How do you use create_character to have it create a character at your player's (human) court? How do I also force them to be your heir (if it's possible)?
Once you make the character use the new_character scope then do the move_character command to whatever scope the player is in
 
  • 1
Reactions:
Thank you for the fast response! I'll try reading up on the "scopes" in the wiki since I'm new to this.

Is it possible to force change a current player's character's stats outside of attributes/traits, such as their gender for instance? I was hoping to have some 'curse' of sort work on a character, and wondering if I'm chasing an impossible goal, and if I should just think of a workaround idea to the events I am currently working on (just a small mini-mod for myself).
Gender cannot be changed in game
 
I've got a question on variables. I'd like to be able to set a variable on a character based on the same variable for that character's parent. The wiki says that a variable can be set like so:

A scope (in the form of ROOT/FROM/PREV/THIS) which contains a variable with the same name: (set|change|subtract|multiply|divide)_variable = { which = <variable_name> which = <scope> }

Are those the only scopes possible? I tried doing "set_variable = { which = my_var which = father_even_if_dead }", but that didn't work.
I believe only ROOT/FROM/PREV/THIS work as the right hand side for a which argument. What you would want to do is something like father = { ROOT = { set_variable = { which = my_var which = PREV } } }
 
  • 1
  • 1
Reactions:
It probably is because the largest value for a 32-bit signed integer is 2,147,483,647 and the largest value for a 32-bit unsigned integer is 4,294,967,295, and exceeding this limit would cause the integer to "start over" from -2,147,483,648 (signed) or 0 (unsigned) when moving beyond this valie, which be problematic. In practice, though, if you ned to use ids in the billions you probably will have problems long before you hit the breaking point, provided you started sufficiently far from the dangerous value.
Had that in AGOT temporarily in a dev build, all newly generated character ids become negative and break many many many things such as trying to target any character for anything. It is because the game starts generating character ids from the highest one in the history and does not fill in the gaps so it is best practice to make sure you do not leave any gaps with the character ids you use in the history files like we had in AGOT as it causes major problems.
 
  • 2
Reactions:
I'm trying to make a mod that does two things. Add a few government flavors, and make it so that those give you a certain amount of vassals when converting. However the government flavors aren;t working. Anyone know what's wrong with them?

government_flavor = (
name = centralized_state
graphics = GFX_evt_found_hre
priority = 10
trigger = {
government = feudal_government
NOT = {has_law = succ_feudal_elective} AND = {has_law = centralization_2} AND = {religion_group = christian}
}
)

government_flavor = (
name = decentralized_state_1
graphics = GFX_evt_found_hre
priority = 10
trigger = {
government = feudal_government
NOT = {has_law = succ_feudal_elective} AND = {has_law = centralization_1} AND = {religion_group = christian}
}
)

government_flavor = (
name = decentralized_state_0
graphics = GFX_evt_found_hre
priority = 10
trigger = {
government = feudal_government
NOT = {has_law = succ_feudal_elective} AND = {has_law = centralization_0} AND = {religion_group = christian}
}
)
That is not how AND works.
AND = { x y } means that both conditions x and y must be true, OR = { a b } means that one of a and b must be true and NOT = { c } means that c cannot be true, NAND and NOR work the same way as AND and OR but that the conditions inside the brackets are not true.
Also AND is not necessary most of the time as the default for code is AND, it is only really need in an OR to specify something like being either d and e are true, or being f is true like this:
Code:
OR = {
    AND = {
        d
        e
    }
    f
}

Sorry if my explanation is not to clear but check out the wiki for a quick run through of the conditions

So for your code you would want to get rid of the AND = { } to get somethng like this for the first example:
Code:
government_flavor = (
    name = centralized_state
    graphics = GFX_evt_found_hre
    priority = 10
    trigger = {
        government = feudal_government
        NOT = { has_law = succ_feudal_elective }
        has_law = centralization_2
        religion_group = christian
    }
)
 
Ahh okay, when I first started modding a couple of years ago it was called missing paranthesis. :) It appears I have some catching up to do.
You also don't need to specify major = no, that is the default behaviour for all events
 
  • 1
  • 1
Reactions:
Before a certain update, I remember that localisation files were loaded/prioritised in numerical then alphabetical order. Then after the said update, the rules were changed to the opposite where double lower case "z" became the priority. What is the case now?
"0" takes priority, so prefix all your files with "00_" and they should take priority over any vanilla file
 
I seem to recall reading somewhere that we could chain scopes together like so

Code:
    FROM.liege.any_realm_lord = {
        ...
    }

Validator tells me this is an invalid node, but I could have sworn I saw something like this.

Does anyone else remember this, or am I crazy?
That does work, just not in this game ;) It is a feature that got added in during the development of Stellaris so if you are going to be making any Stellaris mods then it will work like that there! But alas not for CK2
 
@Meneth is there a condition to check if an artefact is equipped to a character?
I don't think so. Equipping artifacts (as opposed to them just always having an effect when their activation trigger was met) was added relatively late in development.
Definitely something that does need a trigger though, yeah.
 
While the patch notes for 2.7.0 say that <religion>_opinion is now not hardcoded anymore, it doesn't seem to be working for me. Could someone please confirm if this does indeed work or not?
It does, have you made sure to define the static modifier like it says to do at the top of the religion file?
"Religion-specific opinion can be added to modifiers (E.G., norse_pagan_opinion = 5), but the modifier *has* to be defined in 00_modifier_definitions.txt as well. It also needs localisation. Works for groups as well"
 
How to add pictures of artifacts?
Add a 118x118 and a 59x59 dds image in gfx\interface\inventory\artifacts called <item_name> and <item_name>_small respectively and in an interface file add
Code:
spriteType = {
    name = "GFX_<item_name>"
    texturefile = "gfx\\interface\\inventory\\artifacts\\<item_name>.dds"
}
spriteType = {
    name = "GFX_<item_name>_small"
    texturefile = "gfx\\interface\\inventory\\artifacts\\<item_name>_small.dds"
}