• 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.
How do I stop an artifact from showing up in a portrait? Could someone please clarify this matter? I’m specifically wondering about the Byzantine imperial diadem. I like crown variety and personally I think the diadem feels out of place in the later start dates. At the same time, I would much prefer to retain the associated boni, so I would like to equip it without it changing the portrait. What do I have to edit?
 
Have you tried running the Validator on your mod? That finds a lot of these problems.
I'll run The Validator only If I solve current prov_history files problems. Step by step.
How do I stop an artifact from showing up in a portrait? Could someone please clarify this matter? I’m specifically wondering about the Byzantine imperial diadem. I like crown variety and personally I think the diadem feels out of place in the later start dates. At the same time, I would much prefer to retain the associated boni, so I would like to equip it without it changing the portrait. What do I have to edit?
In "interface\portrait_properties\00_portrait_properties.txt", comment out "artifact_type = crown_byzantine"
 
So I'm not sure if this thread is only for questions in relations to building your own mods, or also questions like looking for mods, but I'm just going to go ahead and if I'm doing it wrong then please point me to where I should be. :)

I'm looking for a mod specifically to add many new traits (and balance them), in particular a better balance for childhood traits with the Conclave DLC. A mod that also includes new or changed events (or an event compatible with a trait mod) would be nice, but other than that I would want to see few to no changes to the base (okay, DLC-buffed) game.
 
So I'm not sure if this thread is only for questions in relations to building your own mods, or also questions like looking for mods, but I'm just going to go ahead and if I'm doing it wrong then please point me to where I should be. :)

I'm looking for a mod specifically to add many new traits (and balance them), in particular a better balance for childhood traits with the Conclave DLC. A mod that also includes new or changed events (or an event compatible with a trait mod) would be nice, but other than that I would want to see few to no changes to the base (okay, DLC-buffed) game.

Only Rich Childhood comes to mind, which adds events instead of traits. Perhaps you could suggest some additions to its creator and work together to create something you want.
 
Sooooo
How does variables and while loops actually work? I can't find much information on the subject.
For example, if I wanted to use a variable inside a while loop

Code:
set_variable = { which = portraitInt value = 0 }

while =
{
    limit =
    {
        portraitInt < 27
    }
    portrait + portraitInt =
    {

    }
    portraitInt = 1
}
I assume it doesn't work since "+" doesn't seem to work.
If so, how could one go about using variables like this?
I'm trying to understand the proper syntax, but since the only resource seems to be the one wiki page on scripting that doesn't do that good a job of explaining it I'm struggling to understand
 
Hi, congrats to your first post ;)
As for how variables work, they are a bit different from what you expect when compare them to variables of regular programming languages.
The Wiki has all the information on it, though I agree it is not very well presented.
About your code:
First, you can't check for a variable directly. Basically everything happens inside a clause, that is within brackets. And you can also not use the new comparison operators like "<"; you are restricted to "greater or equal" and "exact".
So the limit part would instead have to read:
Code:
limit =
    {
        NOT =    # variable is smaller than 27
        {
            check_variable =
            {
                which = portraitInt
                value = 27
            }
        }
    }
Now I'm not perfectly sure what you are trying to do in the second part. But if you are trying to add variables together, you again have to do it inside a clause. Like in this example:
Code:
change_variable =
    {
        which = portraitInt    # variable to modify
        which = portrait    # variable by which to modify the first one
    }
That would add the value of "portrait" to "portraitInt" and store the result in "portraitInt".
There are several possibilities for variable manipulation as listed on the wiki, but you always have to do them within such a clause.
Hope that clears things up :)
 
Thank you for the quick reply!
I read through the wiki article again, and with that plus your reply I think I understand basically how it works
Though, in the second part I was actually trying to add the number inside the variable portraitInt to the end of the string "portrait" to have it say, portrait1, portrait2 etc
Again, thanks for the great answer!
 
Ah okay, well no then you can't do that last part.
These are not real variables, and neither do we have actual strings that are this flexible. iirc Stellaris and/or HoI4 have gotten some magic that allows to do some dynamic behaviour related to naming, but in CK2 we are stuck with what we have. Which means a lot of boilerplate code at times :/
 
How to add clothing for societies without clothing? Trying to give nestorian's society the orthodox clothing, but to no avail
 
How to add clothing for societies without clothing? Trying to give nestorian's society the orthodox clothing, but to no avail
Edit dlc/dlc070.zip/interface/portraits/society_clothes.gfx:
Replace portrait_society = monastic_order_orthodox with
Code:
				OR = {
					portrait_society = monastic_order_orthodox
					portrait_society = monastic_order_monophysite
					portrait_society = monastic_order_nestorian
				}
 
Ah okay, well no then you can't do that last part.
These are not real variables, and neither do we have actual strings that are this flexible. iirc Stellaris and/or HoI4 have gotten some magic that allows to do some dynamic behaviour related to naming, but in CK2 we are stuck with what we have. Which means a lot of boilerplate code at times :/

And Imperator's modding is even more powerful, you get actual variables I believe.
 
What's the number to input for a plain red coat of arms?

Like this:

Code:
    coat_of_arms=
    {
        data=
        {
0 3 0 12 0 0 0             }
        religion="catholic"
    }
}
 
I'm toying around with some ideas for traits that I may make a mod out of, and I had a bit of a two-fold question. When you personally lead an army, that army gets +X% morale. First, does this simply mean it takes longer before the morale is depleted, or does it do something else, and second, can this modifier be added to a trait? Edit: Clarification, for now I'm not asking how to add the modifier, just if it can be done.
 
Last edited:
I'm toying around with some ideas for traits that I may make a mod out of, and I had a bit of a two-fold question. When you personally lead an army, that army gets +X% morale. First, does this simply mean it takes longer before the morale is depleted, or does it do something else, and second, can this modifier be added to a trait? Edit: Clarification, for now I'm not asking how to add the modifier, just if it can be done.

Armies with more morale can take more casualties before fleeing. It can be added to traits, yes. 'land_morale' is the one to use.
 
This is probably a very common, and stupid, question, but:

How does one mod marriages?

I'm making a mod (will eventually be full conversion mod based on a fantasy world I'm creating), and one of the ideas I have is to allow close kin marriages (including parent-child) for all religions, but only under certain conditions (for example, if they're already lovers and both have the arbitrary or lustful traits) and they would both get a penalty to general opinion of at least -100. How would I set up the conditions on two characters getting married like that?

It's easy enough to do it for seduction, but I don't know how for marriage.
 
How does one mod marriages?
Marriage modding is extremely limited sadly.

How would I set up the conditions on two characters getting married like that?
You can bypass marrige restrictions using the add_spouse command (think that's what its called) so have a targeted descion usable on sibling who are also a lovers. Add a modifer to both characters the gives general opinion -100 and +100 spouse opinion.
 
Code:
    allow = {
       conditional_tooltip = {
           trigger = {
               k_antioch = {
                   is_titular = yes
               }
           }
           k_antioch = {
               is_titular = no
           }
       }
       hidden_tooltip = {
           OR = {
               ai = no
               religion = catholic
           }
       }

I'm interested in the hidden tooltip bit.

Does it means that the AI will never do it (create k_antioch) and only a player could, or does it mean that it will only create it if it is catholic?
I'm trying to remove the restrictions on the AI, but I'm not sure if replacing all ai = no instances by always = yes will do the job or if the always = yes will always return the OR part as positive no matter what the other conditions are.
 
Code:
    allow = {
       conditional_tooltip = {
           trigger = {
               k_antioch = {
                   is_titular = yes
               }
           }
           k_antioch = {
               is_titular = no
           }
       }
       hidden_tooltip = {
           OR = {
               ai = no
               religion = catholic
           }
       }

I'm interested in the hidden tooltip bit.

Does it means that the AI will never do it (create k_antioch) and only a player could, or does it mean that it will only create it if it is catholic?
I'm trying to remove the restrictions on the AI, but I'm not sure if replacing all ai = no instances by always = yes will do the job or if the always = yes will always return the OR part as positive no matter what the other conditions are.
The "OR" clause will evaluate to true if at least one condition is true - so it is possible if the character is a player (because then "ai = no" is true), or if they are catholic (because then "religion = catholic" is true).
So a catholic AI can do it.

"always = yes", however, will always evaluate to true. So if you put it in there, the OR clause will evaluate to true all the time. Which might not be what you want in some cases.
In your example, however, the player is always able to do it. So if you want the AI to get the same conditions as the player, you could indeed just remove the whole OR clause and just put "always = yes" there.

In other cases where the OR clause checks for more elaborate combinations, just replacing the "ai = no" with "always = yes" might break the intended behaviour.
Code:
NAND = {
   ai = no   # replacing this with "always = yes" will always yield a negative result for jain characters, even for the player!
   religion = jain
}
In this example, the clause evaluates true only if the character is not both an AI and Jain. However, if you replace "ai = no" with "always = yes", then it will evaluate to true if the character is not Jain.
So when at first a Jain player could still create the title, in the replaced script not even a Jain player would be able to create it. It would be completely forbidden for Jain characters, which wouldn't be what you intended. Instead, to remove the restrictions of the AI compared to the player, you would have to remove simply the entire clause.
I am aware that last example is a bit constructed and probably does not make sense for a title anyway. But it still shows that you need to watch out for weird situations where you can't just replace things, but may need to understand the code and which result you want to have.
 
Last edited:
I am aware that last example is a bit constructed and probably does not make sense for a title anyway. But it still shows that you need to watch out for weird situations where you can't just replace things, but may need to understand the code and which result you want to have.

I never really understood the code, I have no knowledge in coding other than trial and error modding and copy/pasting/adapting bits of code I understand. Some things are really straightforward like defines, other bits I mostly understand but long strings are really confusing (like CB) and I never found a ressource that helps in deciphering it. Here it is particularly annoying because I can't check from the AI perspective, only long testing would let me check if an AI in position to create the title would do it (and often it looks like it spend its money doing something else anyway). So thanks for the thorough explanation!
 
Yeah it can be confusing, especially complicated stuff like CBs or some events. The best source for explanation is still the wiki, for example the scripting page has some info on boolean operators: https://ck2.paradoxwikis.com/Scripting
But it does help only so much to understand the actual code. Sometimes it might help first consult the wiki, and then spell out what the code would supposedly do for different situations (as I did above). And this, if necessary, clause by clause, one at a time. Reading it in "plain language" has helped me grasp a few particularly convoluted coding constructions in the past.