• 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.
Laws are in title scope so no, it didn't work setting that modifier on laws. But it do now :)

I did test it not that long ago and the results of that testing is that most, if not all of the character modifiers are valid for titles. Given, most of my knowlege on CK2 modding is based off of observation since there is not much in the way of documentation.
 
I imagine it would keep CK2 from generating random traits for a character on starting at a bookmark.

Yes. There is a define (currently set to 4) which is the minimum of traits a historical character will get. So Scripting William the Conqueror with only two would result in him getting another two radnom ones. Setting this flag will let him stay with just two.

If there were also a condition to see if this happened via inheritance or usurpation would also be nice.

Split it into three separate: on_new_holder_inheritance, on_new_holder_usurpation and on_new_holder. FROMFROM is the old holder (if there was a valid one).

That does not sound very hopeful, does it mean that you will not do it?

It means that it would be a mamoth task that would take me a lot of time to do.

I did test it not that long ago and the results of that testing is that most, if not all of the character modifiers are valid for titles. Given, most of my knowlege on CK2 modding is based off of observation since there is not much in the way of documentation.

The modifiers are stored on the title, not the character. So you specifically need to get whatever value you think should be applied. For instance, adding the demesne_size modifier to a law made it show up in the tooltip for the law, but it did not actually change the character's demesne limit. Because the function that calculates the limit needs to be told specifically to retrieve that value from the title.
 
Split it into three separate: on_new_holder_inheritance, on_new_holder_usurpation and on_new_holder. FROMFROM is the old holder (if there was a valid one).
on_new_holder triggers for either, I take it? Which is great; some events definitely don't care how you got the title.
 
on_new_holder would (I imagine) trigger on usurpation, inheritance or creation, which latter wouldn't be handled by either of the others.
 
on_new_holder triggers for either, I take it? Which is great; some events definitely don't care how you got the title.

Actually no, it triggers if none of the other are valid. So if you want an event to always trigger, no matter what, then add that event to all three on actions.
 
Actually no, it triggers if none of the other are valid. So if you want an event to always trigger, no matter what, then add that event to all three on actions.
Okay. As long as the lack of overlap is entirely consistent that's fine :)
 
Update:

- Added trigger is_allied_with
- Added trigger scope any_allied_character
- Added effect scope any_allied_character
- Added effect scope random_allied_character

NOTE: the reson allies have been absent as triggers is that it is an expensive calculation. So these triggers should be used with care.
 
Last edited:
The command "on_create_title" could be used for titles as "The Roman Empire" that is it could be shown as creatable in the normal title interface (with all the usual requirements) and then after the creation the event that destroy the original title make it de jure and so on would be called with "on_create_title = { e_roman_empire }" or similar?

I've always seen the fact that some titles needed to be created via decision as a sort of ... mistake.

You are working on alliances I see, could do I make a question to you? How much could be difficult to add a command to create an alliance without marriage? The alliance could broke on one of the characters death as usually and have the same game limitations (lost opinion if called in war and so on).
 
The command "on_create_title" could be used for titles as "The Roman Empire" that is it could be shown as creatable in the normal title interface (with all the usual requirements) and then after the creation the event that destroy the original title make it de jure and so on would be called with "on_create_title = { e_roman_empire }" or similar?

I've always seen the fact that some titles needed to be created via decision as a sort of ... mistake.

on_create_title is not an effect, it's just an on action for shooting events.

You are working on alliances I see, could do I make a question to you? How much could be difficult to add a command to create an alliance without marriage? The alliance could broke on one of the characters death as usually and have the same game limitations (lost opinion if called in war and so on).

Very, very unlikely to happen. Unless the CK2 team adds it in as a feature at some point.
 
Update:

- Added trigger is_allied_with
- Added trigger scope any_allied_character
- Added effect scope any_allied_character
- Added effect scope random_allied_character

NOTE: the reson allies have been absent as triggers is that it is an expensive calculation. So these triggers should be used with care.
In PB, we currently use this block of code a number of places to check for alliances:
Code:
custom_tooltip = {
    text = is_not_allied
    hidden_tooltip = {
        ROOT = {
            NOT = { dynasty = FROM }
            NOT = { is_close_relative = FROM }
            NOT = { any_spouse = { character = FROM } }
            NOT = { any_spouse = { is_close_relative = FROM } }
            NOT = { FROM = { any_spouse = { is_close_relative = ROOT } } }
        }
    }
}
Compared to this, roughly how expensive is is_allied_with?
 
In PB, we currently use this block of code a number of places to check for alliances:
Code:
custom_tooltip = {
    text = is_not_allied
    hidden_tooltip = {
        ROOT = {
            NOT = { dynasty = FROM }
            NOT = { is_close_relative = FROM }
            NOT = { any_spouse = { character = FROM } }
            NOT = { any_spouse = { is_close_relative = FROM } }
            NOT = { FROM = { any_spouse = { is_close_relative = ROOT } } }
        }
    }
}
Compared to this, roughly how expensive is is_allied_with?

I can't say. That would have to be tested. My guess is that is_close_relative is somewhat expensive as well.
 
I can't say. That would have to be tested. My guess is that is_close_relative is somewhat expensive as well.
As long as it is roughly comparable we on the PB team are rather happy. Simplifying it down to one line instead of the current ~10 will make the code a lot more compact at the very least, and ensure that all ​alliances are covered.
 
Update:

- Untangled and made cardinal election moddable
The cardinal title override the main title of theocracy character in the vanilla game (a Ducal bishop with cardinal title will display cardinal as their title in the character screen, not Archbishop). Does the same rule apply to feudal and republic character now?
 
This Cardinal election modding sounds great. Also the allies
 
Update:

- Added remove_nickname effect
 
Very, very unlikely to happen. Unless the CK2 team adds it in as a feature at some point.
Would this apply to alliances with more distant family members as a moddable feature? (Ex. Aunts/Uncles/Cousins/Grandparents/Nephews/Nieces)
And if this could become a moddable feature, might you make it so we can adjust the prestige cost of refusing for these 'weaker' alliances?

It's just a thought. I really like what you are doing here so far. :)
 
on_create_title is not an effect, it's just an on action for shooting events.

So it could be used in the trigger section or not? That is one could create "The Roman Empire" using the normal title interface (or Tamriel or the Iron Throne or or "The United Kingdoms of Gondor and Arnor" or whatever) and after an event could fire for this and do the normal stuff of "The Roman Empire"? I'd see this more elegant that doing this as a decision...
(is it possible to use the "gain_effect" in landed_titles to emulate this or there are performance reasons because Paradox is not using this?)

Very, very unlikely to happen. Unless the CK2 team adds it in as a feature at some point.

So it is hard coded that an ally is a parent? In some cases this was not true (imagine for example the status of a "tributary" not a proper vassal that is, if attacked by someone else the Protector would have intervened, right? They not needed to be married...), now to emulate this I need to call the "ally" via event in any war...
 
So it could be used in the trigger section or not? That is one could create "The Roman Empire" using the normal title interface (or Tamriel or the Iron Throne or or "The United Kingdoms of Gondor and Arnor" or whatever) and after an event could fire for this and do the normal stuff of "The Roman Empire"? I'd see this more elegant that doing this as a decision...
(is it possible to use the "gain_effect" in landed_titles to emulate this or there are performance reasons because Paradox is not using this?)
You'd either stick something in gain_title (works rather well if you want something for a single specific title), or you'd make an event and stick it in the on_create_title on_action, and give it triggers so that it only triggers for the title(s) you want.
E.G., "FROM = e_roman_empire".