• 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.

Kurd.

Recruit
14 Badges
Jan 25, 2023
9
3
  • Crusader Kings II
  • Cities: Skylines
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV: Together for Victory
  • Steel Division: Normandy 44
  • Hearts of Iron IV: Death or Dishonor
  • Hearts of Iron IV: Expansion Pass
  • Shadowrun Returns
  • Hearts of Iron IV: Expansion Pass
  • Hearts of Iron IV: La Resistance
  • Crusader Kings III
  • Crusader Kings III: Royal Edition
  • Battle for Bosporus
  • Hearts of Iron IV: No Step Back
Hello so I recently made my first ever mod it's called Extra tradition's by Golden And I was wondering how do I make it Player Only? so that AI could not use the mods. someone told me to use this line
limit = {
is_ai = no
}
But I tried it everywhere and it has not worked, could anybody help me out? Thank you very much.
 
Hello so I recently made my first ever mod it's called Extra tradition's by Golden And I was wondering how do I make it Player Only? so that AI could not use the mods. someone told me to use this line
limit = {
is_ai = no
}
But I tried it everywhere and it has not worked, could anybody help me out? Thank you very much.
If it is an Tradition, you only need to set the ai_will_do Value to 0.

Like this:
ai_will_do = { value = 0 }

And then the AI will not use this Tradition, because the score is 0, the AI always requires an positive score for something, before they do it or take it.
 
  • 1
  • 1Like
Reactions:
If it is an Tradition, you only need to set the ai_will_do Value to 0.

Like this:
ai_will_do = { value = 0 }

And then the AI will not use this Tradition, because the score is 0, the AI always requires an positive score for something, before they do it or take it.
Oh yeah I have done that too, but the mod add's more like tradition slots from the vanilla 5 to 100.
 
If you want only players to be able to choose a tradition, I'm pretty sure you just have to do this:

Code:
    can_pick = {
        is_ai = no
    }

Limit is basically what the game uses to identify a part of script that is a trigger for something else, and it's only used in certain situations, like with if statements or inside of list builders (e.g., every_living_character). When you're writing things like decisions, or traditions, they usually have some specific thing that is similar to limit, which might be can_pick like here, or is_valid or is_valid_showing_failures_only.
 
  • 1
  • 1
Reactions:
If you want only players to be able to choose a tradition, I'm pretty sure you just have to do this:

Code:
    can_pick = {
        is_ai = no
    }

Limit is basically what the game uses to identify a part of script that is a trigger for something else, and it's only used in certain situations, like with if statements or inside of list builders (e.g., every_living_character). When you're writing things like decisions, or traditions, they usually have some specific thing that is similar to limit, which might be can_pick like here, or is_valid or is_valid_showing_failures_only.
Like I mentioned in another reply, it add's more traditions from the vanilla 5 that you can choose it adds a 100. Heres the whole thing. Could it be that I can't make it player only because it's a culture modifier?

Code:
[/QUOTE]
martial_custom_male_only = {
    type = martial_custom
   
    parameters = {
        martial_custom_male_only_combatant = yes
    }
    culture_modifier = {
        culture_tradition_max_add = 100
    }
   
    can_pick = {
         is_ai = no
    }
        trigger_if = {
            limit = {
                has_game_rule = default_gender_equality
            }
            always = yes
        }
        custom_tooltip = {
            text = martial_customs_trigger_maleonly_malepref_or_equal
           
            trigger_if = {
                limit = {
                    has_game_rule = full_gender_equality
                }
                OR = {
                    scope:character = { has_realm_law = male_only_law }
                    scope:character = { has_realm_law = male_preference_law }
                    scope:character = { has_realm_law = equal_law }
                }
            }
        }
        custom_tooltip = {
            text = martial_customs_trigger_maleonly_or_male_pref
           
            trigger_if = {
                limit = {
                    has_game_rule = inversed_gender_equality
                }
                OR = {
                    scope:character = { has_realm_law = male_only_law }
                    scope:character = { has_realm_law = male_preference_law }
                }
            }
        }
    }
   
    ai_will_do = {
        value = 1
    }
}

martial_custom_equal = {
    type = martial_custom
   
    parameters = {
        martial_custom_equal_combatant = yes
    }
    culture_modifier = {
        culture_tradition_max_add = 100
    }
   
    can_pick = {
        custom_tooltip = {
            text = martial_customs_trigger_femaleonly_femalepref_or_equal
           
            trigger_if = {
                limit = {
                    has_game_rule = default_gender_equality
                }
                OR = {
                    scope:character = { has_realm_law = female_only_law }
                    scope:character = { has_realm_law = female_preference_law }
                    scope:character = { has_realm_law = equal_law }
                }
            }
        }
        custom_tooltip = {
            text = martial_customs_trigger_malepref_felamepref_or_equal
           
            trigger_if = {
                limit = {
                    has_game_rule = full_gender_equality
                }
                OR = {
                    scope:character = { has_realm_law = male_preference_law }
                    scope:character = { has_realm_law = female_preference_law }
                    scope:character = { has_realm_law = equal_law }
                }
            }
        }
        custom_tooltip = {
            text = martial_customs_trigger_maleonly_malepref_or_equal
           
            trigger_if = {
                limit = {
                    has_game_rule = inversed_gender_equality
                }
                OR = {
                    scope:character = { has_realm_law = male_only_law }
                    scope:character = { has_realm_law = male_preference_law }
                    scope:character = { has_realm_law = equal_law }
                }
            }
        }
    }
   
    ai_will_do = {
        value = 0
       
        if = {
            limit = {
                any_in_list = { list = traits this = flag:ethos_egalitarian }
                scope:character = {
                    any_vassal = {
                        count >= 5
                        is_female = yes
                        has_education_martial_trigger = yes
                        highest_held_title_tier >= tier_county
                    }
                    any_vassal = {
                        count >= 5
                        is_female = no
                        has_education_martial_trigger = yes
                        highest_held_title_tier >= tier_county
                    }
                }
            }
            add = 1
        }
    }
}

martial_custom_female_only = {
    type = martial_custom
   
    parameters = {
        martial_custom_female_only_combatant = yes
    }
    culture_modifier = {
        culture_tradition_max_add = 100
    }
   
    can_pick = {
        custom_tooltip = {
            text = martial_customs_trigger_femaleonly
           
            trigger_if = {
                limit = {
                    has_game_rule = default_gender_equality
                }
                scope:character = { has_realm_law = female_only_law }
            }
        }
        custom_tooltip = {
            text = martial_customs_trigger_femaleonly_femalepref_or_equal
           
            trigger_if = {
                limit = {
                    has_game_rule = full_gender_equality
                }
                OR = {
                    scope:character = { has_realm_law = female_only_law }
                    scope:character = { has_realm_law = female_preference_law }
                    scope:character = { has_realm_law = equal_law }
                }
            }
        }
        trigger_if = {
            limit = {
                has_game_rule = inversed_gender_equality
            }
            always = yes
        }
    }
   
    ai_will_do = {
        value = 0
       
        if = {
            limit = {
                scope:character = {
                    is_female = yes
                    has_education_martial_trigger = yes
                    any_vassal = {
                        count >= 10
                        is_female = yes
                        has_education_martial_trigger = yes
                        highest_held_title_tier >= tier_county
                    }
                }
            }
            add = 1
        }
    }
}
[QUOTE]
 
  • 1Like
Reactions:
Like I mentioned in another reply, it add's more traditions from the vanilla 5 that you can choose it adds a 100. Heres the whole thing. Could it be that I can't make it player only because it's a culture modifier?
Making it player only should be possible on anything that lets you use a trigger, it shouldn't matter if it's culture related.

The first tradition has an extra curly brace, so maybe that's breaking it.

Code:
martial_custom_male_only = {
    type = martial_custom
  
    parameters = {
        martial_custom_male_only_combatant = yes
    }
    culture_modifier = {
        culture_tradition_max_add = 100
    }
  
    can_pick = {
         is_ai = no
    } ###################### <------------------------ This line shouldn't exist
        trigger_if = {
            limit = {
                has_game_rule = default_gender_equality
            }
            always = yes
        }
        custom_tooltip = {
            text = martial_customs_trigger_maleonly_malepref_or_equal
          
            trigger_if = {
                limit = {
                    has_game_rule = full_gender_equality
                }
                OR = {
                    scope:character = { has_realm_law = male_only_law }
                    scope:character = { has_realm_law = male_preference_law }
                    scope:character = { has_realm_law = equal_law }
                }
            }
        }
        custom_tooltip = {
            text = martial_customs_trigger_maleonly_or_male_pref
          
            trigger_if = {
                limit = {
                    has_game_rule = inversed_gender_equality
                }
                OR = {
                    scope:character = { has_realm_law = male_only_law }
                    scope:character = { has_realm_law = male_preference_law }
                }
            }
        }
    }
  
    ai_will_do = {
        value = 1
    }
}

Let me know if that gets it working.
 
  • 1
Reactions:
Making it player only should be possible on anything that lets you use a trigger, it shouldn't matter if it's culture related.

The first tradition has an extra curly brace, so maybe that's breaking it.

Code:
martial_custom_male_only = {
    type = martial_custom
 
    parameters = {
        martial_custom_male_only_combatant = yes
    }
    culture_modifier = {
        culture_tradition_max_add = 100
    }
 
    can_pick = {
         is_ai = no
    } ###################### <------------------------ This line shouldn't exist
        trigger_if = {
            limit = {
                has_game_rule = default_gender_equality
            }
            always = yes
        }
        custom_tooltip = {
            text = martial_customs_trigger_maleonly_malepref_or_equal
         
            trigger_if = {
                limit = {
                    has_game_rule = full_gender_equality
                }
                OR = {
                    scope:character = { has_realm_law = male_only_law }
                    scope:character = { has_realm_law = male_preference_law }
                    scope:character = { has_realm_law = equal_law }
                }
            }
        }
        custom_tooltip = {
            text = martial_customs_trigger_maleonly_or_male_pref
         
            trigger_if = {
                limit = {
                    has_game_rule = inversed_gender_equality
                }
                OR = {
                    scope:character = { has_realm_law = male_only_law }
                    scope:character = { has_realm_law = male_preference_law }
                }
            }
        }
    }
 
    ai_will_do = {
        value = 1
    }
}

Let me know if that gets it working.
At first I thought it did haha because the AI wasn't doing anything but, then they started, guess I'll have to put more blood, sweat and tears into it thank you for the help tho.
 
  • 1Like
Reactions:
Making it player only should be possible on anything that lets you use a trigger, it shouldn't matter if it's culture related.

The first tradition has an extra curly brace, so maybe that's breaking it.

Code:
martial_custom_male_only = {
    type = martial_custom
 
    parameters = {
        martial_custom_male_only_combatant = yes
    }
    culture_modifier = {
        culture_tradition_max_add = 100
    }
 
    can_pick = {
         is_ai = no
    } ###################### <------------------------ This line shouldn't exist
        trigger_if = {
            limit = {
                has_game_rule = default_gender_equality
            }
            always = yes
        }
        custom_tooltip = {
            text = martial_customs_trigger_maleonly_malepref_or_equal
         
            trigger_if = {
                limit = {
                    has_game_rule = full_gender_equality
                }
                OR = {
                    scope:character = { has_realm_law = male_only_law }
                    scope:character = { has_realm_law = male_preference_law }
                    scope:character = { has_realm_law = equal_law }
                }
            }
        }
        custom_tooltip = {
            text = martial_customs_trigger_maleonly_or_male_pref
         
            trigger_if = {
                limit = {
                    has_game_rule = inversed_gender_equality
                }
                OR = {
                    scope:character = { has_realm_law = male_only_law }
                    scope:character = { has_realm_law = male_preference_law }
                }
            }
        }
    }
 
    ai_will_do = {
        value = 1
    }
}

Let me know if that gets it working.
Update: Still haven't gotten it to work LOL
 
Yeah here you go, nothing fancy the main mod thingy is in traditions --> pillars. Thank you again.
Oh oh oh—okay, I see what happened. I misunderstood what you were trying to do.

So, you're trying to make a tradition that is only accessible to the player, which gives +100 traditions. The problem is that this tradition is named the same in the base game, so when the game starts every tradition is already assigned one of martial_custom_male_only, martial_custom_equal, or martial_custom_female_only. That means the AI is getting access to this as well, without ever having to pick it. So if you give this is_ai = no it won't stop a culture from getting it on game start, it will only prevent the AI from ever changing it later.

To do something like what you want, you're probably going to want to change the name of these to something with _player at the end (e.g., martial_custom_male_only_player), just to differentiate them from the base game's martial traditions, then if you want a tradition to exist for only the player when the game starts, you're going to want to create an effect in game_start_after_lobby on_action (which can be found in common\on_action\game_start.txt). Currently, there are two effects in there called game_rule_full_gender_equality_effect and game_rule_inversed_gender_equality_effect. I would put the effect you create after those, as it will still allow the gender equality game rules to work, which will allow the player's mod tradition to appropriately reflect the game rules they chose.

So after those effects, put something like:

Code:
        every_player = { # Check every player
          
            culture = {
                switch = { # Check their martial tradition and change it to the appropriate player-only one
                    trigger = has_cultural_pillar
                    martial_custom_male_only = {
                        set_culture_pillar = martial_custom_male_only_player
                    }
                    martial_custom_female_only = {
                        set_culture_pillar = martial_custom_female_only_player
                    }
                    martial_custom_equal = {
                        set_culture_pillar = martial_custom_equal_player
                    }
                }
            }
        }

Then, if you want the AI not to be able to ever pick it, don't forget to add is_ai = no to the can_pick block in the tradition itself.

Hope that helps!

EDIT: Clarity
 
Last edited:
  • 1Like
Reactions:
Oh oh oh—okay, I see what happened. I misunderstood what you were trying to do.

So, you're trying to make a tradition that is only accessible to the player, which gives +100 traditions. The problem is that this tradition is named the same in the base game, so when the game starts every tradition is already assigned one of martial_custom_male_only, martial_custom_equal, or martial_custom_female_only. That means the AI is getting access to this as well, without ever having to pick it. So if you give this is_ai = no it won't stop a culture from getting it on game start, it will only prevent the AI from ever changing it later.

To do something like what you want, you're probably going to want to change the name of these to something with _player at the end (e.g., martial_custom_male_only_player), just to differentiate them from the base game's martial traditions, then if you want a tradition to exist for only the player when the game starts, you're going to want to create an effect in game_start_after_lobby on_action (which can be found in common\on_action\game_start.txt). Currently, there are two effects in there called game_rule_full_gender_equality_effect and game_rule_inversed_gender_equality_effect. I would put the effect you create after those, as it will still allow the gender equality game rules to work, which will allow the player's mod tradition to appropriately reflect the game rules they chose.

So after those effects, put something like:

Code:
        every_player = { # Check every player
         
            culture = {
                switch = { # Check their martial tradition and change it to the appropriate player-only one
                    trigger = has_cultural_pillar
                    martial_custom_male_only = {
                        set_culture_pillar = martial_custom_male_only_player
                    }
                    martial_custom_female_only = {
                        set_culture_pillar = martial_custom_female_only_player
                    }
                    martial_custom_equal = {
                        set_culture_pillar = martial_custom_equal_player
                    }
                }
            }
        }

Then, if you want the AI not to be able to ever pick it, don't forget to add is_ai = no to the can_pick block in the tradition itself.

Hope that helps!

EDIT: Clarity
Okokok I see, thank you so much.