• 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.
Here is what I modded, first I removed all the "is_republic" variables in the open elective definitions:

succ_open_elective = {
potential = {
NOT = { title = k_papal_state }
temporary = no
OR = {
is_primary_type_title = yes
holy_order = yes
AND = {
tier = baron
OR = {

is_theocracy = yes
NOT = { holder_scope = { religion_group = muslim } }
}
}
holder_scope = {
OR = {

is_theocracy = yes
NOT = { religion_group = muslim }
}
}
}
OR = {
is_landless_type_title = yes
holder_scope = { is_theocracy = no }
holder_scope = {
NOT = { religion = catholic }
NOT = { religion = fraticelli }
}
}
holder_scope = {
is_patrician = no
is_merchant_republic = no
OR = {
independent = yes
is_feudal = no
NOT = {
any_liege = {
holy_order = yes
}
}
}
}
NAND = {
has_law = succession_voting_power_1
has_law = succ_feudal_elective
}
}

effect = {
succession = open_elective
}
revoke_allowed = {
always = no
}
}

Then I added a "is_republic" variable to the primogeniture law definitions:

succ_primogeniture = {
oldest_child_opinion = 10
youngest_child_opinion = -15
child_opinion = -10
dynasty_opinion = -5
potential = {
holder_scope = {
NOT = { religion_group = muslim }
is_merchant_republic = no
is_patrician = no
}
OR = {
is_republic = yes
}
OR = {
holder_scope = { # Viceroyalties can always have primogeniture if not muslim
any_demesne_title = {
is_vice_royalty = yes
}
}
AND = {
holder_scope = {
OR = {
independent = yes
NOT = {
any_liege = {
holy_order = yes
}
}
}
OR = {
NOT = { religion_group = pagan_group }
is_reformed_religion = yes
religion = hellenic_pagan
}
}
OR = {
is_landless_type_title = no
is_tribal_type_title = yes
temporary = yes
}
is_primary_type_title = no
OR = {
AND = {
tier = baron
is_feudal = yes
}
holder_scope = { is_feudal = yes }
}
}
}
}
allow = {
OR = {
holder_scope = { # Viceroyalties can always have primogeniture if not muslim
any_demesne_title = {
is_vice_royalty = yes
}
}
AND = {
has_dlc = "Zeus"
holder_scope = {
primary_title = {
OR = {
has_law = ze_administration_laws_1
has_law = ze_administration_laws_2
}
}
}
}
hidden_tooltip = {
has_crown_law_title = no
NOT = { has_dlc = "Zeus" }
}
crownlaw_title = {
OR = {
has_law = crown_authority_3
has_law = crown_authority_4
}
}
}
holder_scope = { NOT = { has_character_flag = liege_forced_succ_law } }
NAND = {
has_law = succession_voting_power_1
has_law = succ_feudal_elective
}
}

effect = {
succession = primogeniture
}
revoke_allowed = {
always = no
}
}

The game crashes before loading now.
 
Here is what I modded, first I removed all the "is_republic" variables in the open elective definitions:

succ_open_elective = {
potential = {
NOT = { title = k_papal_state }
temporary = no
OR = {
is_primary_type_title = yes
holy_order = yes
AND = {
tier = baron
OR = {

is_theocracy = yes
NOT = { holder_scope = { religion_group = muslim } }
}
}
holder_scope = {
OR = {

is_theocracy = yes
NOT = { religion_group = muslim }
}
}
}
OR = {
is_landless_type_title = yes
holder_scope = { is_theocracy = no }
holder_scope = {
NOT = { religion = catholic }
NOT = { religion = fraticelli }
}
}
holder_scope = {
is_patrician = no
is_merchant_republic = no
OR = {
independent = yes
is_feudal = no
NOT = {
any_liege = {
holy_order = yes
}
}
}
}
NAND = {
has_law = succession_voting_power_1
has_law = succ_feudal_elective
}
}

effect = {
succession = open_elective
}
revoke_allowed = {
always = no
}
}

Then I added a "is_republic" variable to the primogeniture law definitions:

succ_primogeniture = {
oldest_child_opinion = 10
youngest_child_opinion = -15
child_opinion = -10
dynasty_opinion = -5
potential = {
holder_scope = {
NOT = { religion_group = muslim }
is_merchant_republic = no
is_patrician = no
}
OR = {
is_republic = yes
}
OR = {
holder_scope = { # Viceroyalties can always have primogeniture if not muslim
any_demesne_title = {
is_vice_royalty = yes
}
}
AND = {
holder_scope = {
OR = {
independent = yes
NOT = {
any_liege = {
holy_order = yes
}
}
}
OR = {
NOT = { religion_group = pagan_group }
is_reformed_religion = yes
religion = hellenic_pagan
}
}
OR = {
is_landless_type_title = no
is_tribal_type_title = yes
temporary = yes
}
is_primary_type_title = no
OR = {
AND = {
tier = baron
is_feudal = yes
}
holder_scope = { is_feudal = yes }
}
}
}
}
allow = {
OR = {
holder_scope = { # Viceroyalties can always have primogeniture if not muslim
any_demesne_title = {
is_vice_royalty = yes
}
}
AND = {
has_dlc = "Zeus"
holder_scope = {
primary_title = {
OR = {
has_law = ze_administration_laws_1
has_law = ze_administration_laws_2
}
}
}
}
hidden_tooltip = {
has_crown_law_title = no
NOT = { has_dlc = "Zeus" }
}
crownlaw_title = {
OR = {
has_law = crown_authority_3
has_law = crown_authority_4
}
}
}
holder_scope = { NOT = { has_character_flag = liege_forced_succ_law } }
NAND = {
has_law = succession_voting_power_1
has_law = succ_feudal_elective
}
}

effect = {
succession = primogeniture
}
revoke_allowed = {
always = no
}
}

The game crashes before loading now.
 
I'm making an event where when the Byzantine Empire loses d_thrace and Constantinople, the empire is destroyed and turns into the Kingdom of Nicaea. Specifically, I want the former vassals of the Byzantine Empire in the de jure region of the kingdom of Greece to become vassals of Nicaea. So far, the event is triggered properly, and the kingdom is granted to the then emperor of the Byzantines.

But there are two problems:
1) The event window itself doesn't seem to appear anymore (it used to)
2) every vassal becomes independent instead of just the ones NOT inside the de_jure region of k_greece. (in the game files, k_greece = k_byzantium, just an FYI if you're reading the code)

Here's the code, if you could tell me whats wrong, thanks in advance.

Code:
namespace = fob
narrative_event = {
    title = EVTNAMEfob01
    id = fob.01
    desc = EVTDESCfob01
    picture = GFX_evt_fob

    mean_time_to_happen = {
        days = 1
    }
   
    trigger = {
        AND = {
            has_landed_title = e_byzantium
            NOT = {
                k_nicaea = {
                    has_title_flag = fob
                }
            }
            c_byzantion = {
                holder_scope = {
                    NOR = {
                        character = ROOT
                        any_liege = {character = ROOT }
                    }
                }
            }
            d_thrace = {
                holder_scope = {
                    NOR = {
                        character = ROOT
                        any_liege = { character = ROOT }
                    }
                }
            }
        }
    }
   
    option = {
        name = EVTOPTAfob01
        e_byzantium = {
            set_title_flag = lost_thrace
        }
        activate_title = { title = k_nicaea status = yes }
        activate_title = { title = k_byzantium status yes }
        k_nicaea = {
            set_title_flag = fob
            copy_title_history = e_byzantium
            copy_title_laws = e_byzantium
            grant_title = root
        }
        e_byzantium = {
            any_vassal = {
                if = {
                    limit = {
                        NOT = {
                            de_jure_liege = k_byzantium
                        }
                    }
                    set_defacto_liege = THIS
                }
            }
        }
    }
   
    after = {
        e_byzantium = { destroy_landed_title = THIS }
    }
}
 
I'm making an event where when the Byzantine Empire loses d_thrace and Constantinople, the empire is destroyed and turns into the Kingdom of Nicaea. Specifically, I want the former vassals of the Byzantine Empire in the de jure region of the kingdom of Greece to become vassals of Nicaea. So far, the event is triggered properly, and the kingdom is granted to the then emperor of the Byzantines.

But there are two problems:
1) The event window itself doesn't seem to appear anymore (it used to)
2) every vassal becomes independent instead of just the ones NOT inside the de_jure region of k_greece. (in the game files, k_greece = k_byzantium, just an FYI if you're reading the code)

Here's the code, if you could tell me whats wrong, thanks in advance.

Code:
namespace = fob
narrative_event = {
    title = EVTNAMEfob01
    id = fob.01
    desc = EVTDESCfob01
    picture = GFX_evt_fob

    mean_time_to_happen = {
        days = 1
    }
  
    trigger = {
        AND = {
            has_landed_title = e_byzantium
            NOT = {
                k_nicaea = {
                    has_title_flag = fob
                }
            }
            c_byzantion = {
                holder_scope = {
                    NOR = {
                        character = ROOT
                        any_liege = {character = ROOT }
                    }
                }
            }
            d_thrace = {
                holder_scope = {
                    NOR = {
                        character = ROOT
                        any_liege = { character = ROOT }
                    }
                }
            }
        }
    }
  
    option = {
        name = EVTOPTAfob01
        e_byzantium = {
            set_title_flag = lost_thrace
        }
        activate_title = { title = k_nicaea status = yes }
        activate_title = { title = k_byzantium status yes }
        k_nicaea = {
            set_title_flag = fob
            copy_title_history = e_byzantium
            copy_title_laws = e_byzantium
            grant_title = root
        }
        e_byzantium = {
            any_vassal = {
                if = {
                    limit = {
                        NOT = {
                            de_jure_liege = k_byzantium
                        }
                    }
                    set_defacto_liege = THIS
                }
            }
        }
    }
  
    after = {
        e_byzantium = { destroy_landed_title = THIS }
    }
}
When you test it, do you *have* any duke vassals directly under the emperor who are de jure vassals of k_byzantium? (d_nikaea, d_adrianopolis, d_thessalonika, d_dyrrachion, d_epirus, d_athens, d_achaia, d_aegean_islands, d_krete, or d_cyprus. But not d_thrace since you're specifically triggering on losing that.) If not, then of course you won't keep any of them.

Note: using de_jure_liege as you do will miss any counts & barons who are directly under the emperor at the moment. I'd use de_jure_liege_or_above instead to catch them.
 
How would I go about making a council member title that can also command armies? So like the advisor title is now but with an added bonus of being able to command troops without having the commander minor title. I figured it would be some property like can_command_armies = yes but that doesn't exist.
 
When you test it, do you *have* any duke vassals directly under the emperor who are de jure vassals of k_byzantium? (d_nikaea, d_adrianopolis, d_thessalonika, d_dyrrachion, d_epirus, d_athens, d_achaia, d_aegean_islands, d_krete, or d_cyprus. But not d_thrace since you're specifically triggering on losing that.) If not, then, of course, you won't keep any of them.

Note: using de_jure_liege as you do will miss any counts & barons who are directly under the emperor at the moment. I'd use de_jure_liege_or_above instead to catch them.

I also tried de_jure_liege_or_above and it didn't work, but I just changed to see if any other command would. But when I do test it, I do the 769 start, so they have plenty of vassals at the Duke level that are direct vassals
 
@Meneth with artifacts, is it possible to have say a ring that can be equipped in multiple defined slots? So a left/right ring slot, and one artifact defined as being able to be used in both slots?
 
Has anyone ever managed to get the damage_unit effect working correctly? Targeting the right type and everything? Not just theoretically, but actually gotten it to do something? If so, can I see an example?

Also, is there a way to pull unit size, or army size, to a variable? So for example, not allowing certain events to fire if one army dramatically outnumbers the other.


EDIT: Apparently, using the damage unit 'amount' is very dangerous as well, as it will take you into negative troops, and thus crash the game. Only the percentage way is safe to use, seemingly. Unless somebody can possibly show me an example otherwise.

it will not crash the game. Just will cause some wierdness. The current Gehimisnacht release uses it for all damaging spell effects.
 
@Meneth with artifacts, is it possible to have say a ring that can be equipped in multiple defined slots? So a left/right ring slot, and one artifact defined as being able to be used in both slots?
I am gonna go out on a guess here and say no but why would you even need that? Just increase the number of potential items that can be equipped for a generic "rings" slot so then you can have two equipped.
 
I am gonna go out on a guess here and say no but why would you even need that? Just increase the number of potential items that can be equipped for a generic "rings" slot so then you can have two equipped.

It is more for things handled in the abstract. For instance, for an event sequence in which having a particular item equipped should be capable of altering the variables in the event. I wanted to be able to stack defensive bonuses from the same "ring type" within the Gehimisnacht duel engine. Now as far as I know, there is no intention to add a count condition to the artifact checking conditions, though I do understand there to be an intention to add a condition to check if an artifact is equipped. Hence why I was going to try doing the count another way.
 
It is more for things handled in the abstract. For instance, for an event sequence in which having a particular item equipped should be capable of altering the variables in the event. I wanted to be able to stack defensive bonuses from the same "ring type" within the Gehimisnacht duel engine. Now as far as I know, there is no intention to add a count condition to the artifact checking conditions, though I do understand there to be an intention to add a condition to check if an artifact is equipped. Hence why I was going to try doing the count another way.
I might be misunderstanding you but the "count = " condition works in any any_ scope already. So you can check if someone has a certain amount of the same/any artifact already.
 
I might be misunderstanding you but the "count = " condition works in any any_ scope already. So you can check if someone has a certain amount of the same/any artifact already.
What I mean is more, say you have two ring slots, and two rings that are the same, each is supposed to boost damage by 1 while equipped in a scripted duel engine. When you check, if the item is equipped, it will only count once for increasing the damage. Now if what you are suggesting is true, I would now need an extra line to check if the count of the equipped artifacts is x. That's if the new condition makes it in for Jade Dragon, and if it count will work within the has_equipped_artifact condition that has been talked about.
 
Is there any way to account for the size of an army that a commander is leading? I'd like an event to fire, but have it be much more unlikely with a small force.

Also. Is there a modifier for how much maintenance cost is paid for mercenary forces? There seems to be only for retinues and hordes. I'm experimenting with a system where a certain type of government has to rely mostly on mercenaries, but the AI seems unwilling to hire more than 1-2 companies, even with a ton of gold.
 
How do I mod the AI's willingness to get married?

In the defines, are a number of variables directly related to AI's willingness to marry. They're all fairly self-explanatory. How much it values prestige, or prefers landed heirs, or to marry threatening powers, etc.
 
I don't see anything in there to, say, change its preference for matrilineal marriage or its willingness to marry councilors. Where can I edit the +++s and ---s that certain conditions cause?
 
I don't see anything in there to, say, change its preference for matrilineal marriage or its willingness to marry councilors. Where can I edit the +++s and ---s that certain conditions cause?

Matrillineal marriages can be turned off in its religion. The +++ and the ----s are the AI weighting logic. Some of it hardcoded, but most of it in defines.

MARRIAGE_AI_PRESTIGE_VALUE = (set this to at least 10 to better improve AI marriage logic)

With matrillineal marriages turned off in religions, the above set higher, you can then tweak the following values to affect how they decide which other realms to intermarry with. I tend to lower the allowed betrothal age as well.

MARRIAGE_THREATENING_FOR_THEM_MODIFIER
MARRIAGE_THREATENING_FOR_US
MARRIAGE_LANDED_AND_NO_NAP
MARRIAGE_PRIMARY_HEIR
MARRIAGE_SECONDARY_HEIR
MARRIAGE_CHILD_OF_RULER
MARRIAGE_ALLIED_AND_NO_NAP
MARRIAGE_EXISTING_NAP
 
Ok, but I mostly want it to require matrilineal marriages for landed women and heiresses more often, and be willing to marry its children if they are councilors. None of those seem to do that.