• 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.
In a modifier clause (for MTTH, random_list weights, etc) can there be AND/OR/NOT/NOR conditions?

Code:
        modifier = {
            factor = 0.95
            OR = {
                has_character_flag = t2a
                has_character_flag = t3b
                has_character_flag = t3c
            }
        }
        modifier = {
            factor = 1.2
            learning = 5
            NOT = { learning = 14 }
        }
 
Last edited:
Does my mod's on_actions random_events modifiers get weighted with just those in the mod or are they added to vanilla's total weight of chances?

For example, do all on_yearly_pulse random events in my mod weight themselves against just the events in the mod or against those plus all the vanilla on_yearly random_events?
 
Last edited:
Can somebody recommend a simple mod (or a change I can do myself) that makes it possible for mercenaries to secure land more easily? From memory the only way they can do it at the moment is if they backstab an employer. I like the idea of them taking over a few counties (and possibly opening up the door to vassalisation if they do)
 
I seem to be doing something wrong when making a 'Major River'..
1) Choose an unused ID from definition.csv
2) Give it a name
3) In Provinces.bmp, colour the river in the respective colour
4) In rivers.bmp make the respective river pink (like the sea)
5) In default.map add the ID to major_rivers

Except, when I do this it registers as an unoccupied "no character" Province.
 
EDIT: Nope it's not a bug i found out what i was doing wrong.

This is a bug right?

For a targetted_decision:

This works for both conditions:
Code:
allow = {
      OR = {
           is_landed = no
           host = { character = FROM }
      }
}

But this only works for unlanded characters: EDIT: I moved this to potential and changed is_landed to FROM = { is_landed = no }
Code:
from_potential = {
      OR = {
           is_landed = no
           host = { character = FROM }
      }
}

While this works fine: EDIT: This never worked, it did in the potential scope.
Code:
from_potential = {
      host = { character = FROM }
}
 
Last edited:
I am modding a cb that is allowed when the target has a X amount of courtiers. There doesn't seem to be a condition that checks how many courtiers you have. (I would like to know the amount of unlanded ones)
Is the best way to do this counting them with variables? Because that seems really cumbersome. :(
 
I am modding a cb that is allowed when the target has a X amount of courtiers. There doesn't seem to be a condition that checks how many courtiers you have. (I would like to know the amount of unlanded ones)
Is the best way to do this counting them with variables? Because that seems really cumbersome. :(

use any_courter and the count condition. So use the any_courtier, a condition that would check if they are landed, and have it with a count = x
 
  • 1
Reactions:
Ah thanks, does the count condition work for the random_courtier scope as well?
No, random_courtier is an effect scope, and grabs one courtier who meets the conditions. Use any_courtier + count to grab more than one.
 
But isn't any_ also kind of random?
Any scopes to all that are availiable. You use it for instance to open a check in a trigger for if a holding has a building across an entire realm. But when your applying an effect, if you only want to do it to one, you use random, otherwise the any_ becomes defacto an all_ and will do the effect on everyone.
 
  • 1
Reactions:
No, random_courtier is an effect scope, and grabs one courtier who meets the conditions. Use any_courtier + count to grab more than one.

Oh, I thought that e.g. random_courtier = { count = 2 <do things> } would execute <do things> for two random courtiers. Is that not a thing?
 
Oh, I thought that e.g. random_courtier = { count = 2 <do things> } would execute <do things> for two random courtiers. Is that not a thing?
random_courtier is a scope for effects that should always scope to one courtier who meets any further conditions. You can use it in a while loop to do the action more than once, but you will never be certain that it won't scope to the same courtier multiple times, unless you use a flag + maintaince event to stop it doing so.

Count is also a condition, it can only be used in a limit or in a trigger block.
 
How is this giving a different amount of prisoners to ROOT each time? o_O
Shouldn't it always be 5 prisoners or crash the game when there aren't enough courtiers?
(FROM is the character that triggered this event with another event)

Code:
character_event = {
    id = 1010
    is_triggered_only = yes
    hide_window = yes
 
    immediate = {
        set_variable = { which = counter value = 0 }
        while {
            limit = {
                NOT = {check_variable = { which = counter value = 5 }}
            }
            FROM = {
                random_courtier = {
                    if = {
                        limit = {
                            is_ruler = no
                        }
                        imprison = ROOT
                        ROOT = {change_variable = { which = counter value = 1 }}
                    }
                }
            }
        }
    }
}

PS: any_courtier isn't random it works its way down the list order of the courtier tab in the character screen it seems. :p
 
Last edited:
How is this giving a different amount of prisoners to ROOT each time? o_O
Shouldn't it always be 5 prisoners or crash the game when there aren't enough courtiers?
(FROM is the character that triggered this event with another event)

Code:
character_event = {
    id = 1010
    is_triggered_only = yes
    hide_window = yes
 
    immediate = {
        set_variable = { which = counter value = 0 }
        while {
            limit = {
                NOT = {check_variable = { which = counter value = 5 }}
            }
            FROM = {
                random_courtier = {
                    if = {
                        limit = {
                            is_ruler = no
                        }
                        imprison = ROOT
                        ROOT = {change_variable = { which = counter value = 1 }}
                    }
                }
            }
        }
    }
}

PS: any_courtier isn't random it works its way down the list order of the courtier tab in the character screen it seems. :p
First thing: you can put the limit clause directly in the random clause:
Code:
                random_courtier = {
                    limit = {
                        is_ruler = no
                    }
                    imprison = ROOT
                    ROOT = {change_variable = { which = counter value = 1 }}
                }

2nd thing: You could skip the while and variable:
Code:
                random_courtier = {
                    limit = {
                        is_ruler = no
                    }
                    imprison = ROOT
                }
                random_courtier = {
                    limit = {
                        is_ruler = no
                    }
                    imprison = ROOT
                }
                random_courtier = {
                    limit = {
                        is_ruler = no
                    }
                    imprison = ROOT
                }
                random_courtier = {
                    limit = {
                        is_ruler = no
                    }
                    imprison = ROOT
                }
                random_courtier = {
                    limit = {
                        is_ruler = no
                    }
                    imprison = ROOT
                }

Vanilla code does this. If there aren't enough non-rulers, the later attempts can silently fail. Or you could still use the while loop, as done without the 'if' it will count up each time thru, even if you run out of people to imprison.

3rd thing: The reason you can get different amounts is that prisoner *are* courtiers. If one gets imprisoned again, the engine doesn't care. As long as you have at least one non-ruler courtier, your while will *always* find somebody to imprison, even if it's the same guy 5 times. :) In the limit clause, you might also want to add 'prisoner = no'.
 
  • 1
Reactions:
Question: I'm trying to take advantage of the new "lacks_dlc" trigger. My mod requires portrait DLC to run, and if the player is missing a certain portrait DLC, it outputs an event, reminding the player they're missing the required DLC. Let's say my mod requires the African Portrait dlc. What do I use in lacks_dlc = ?

I've tried: African Portraits, African_Portraits, "African_Portraits", dlc067, none of these work.

Does the lacks_dlc trigger simply not work on portrait dlc? Perhaps it's only reserved for the bigger DLC, like Charlemagne?
 
Last edited:
Question: I'm trying to take advantage of the new "lacks_dlc" trigger. My mod requires portrait DLC to run, and if the player is missing a certain portrait DLC, it outputs an event, reminding the player they're missing the required DLC. Let's say my mod requires the African Portrait dlc. What do I use in lacks_dlc = ?

I've tried: African Portraits, African_Portraits, "African_Portraits", dlc067, none of these work.

Does the lacks_dlc trigger simply not work on portrait dlc? Perhaps it's only reserved for the bigger DLC, like Charlemagne?
The DLC has to have a codename, so yeah, basically the major ones. On http://www.ckiiwiki.com/Conditions scroll down to 'has_dlc' for the full list.
 
  • 1
Reactions:
Does the lacks_dlc trigger simply not work on portrait dlc? Perhaps it's only reserved for the bigger DLC, like Charlemagne?
That's correct. It currently only works for the DLC that get listed in the campaign start window, plus the Ruler Designer.
 
  • 3
Reactions: