• 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.
I'm having trouble with the spawn_army command. I want the army to disband after a war. I've used war= scope:war and war = war , and neither seem to work. I'm not sure how to reference a war properly. I would basically want them to disband when all the wars are over. The code below works fine except for the war part.


Code:
spawn_army= {
        levies=0
        men_at_arms={
          type=armored_horsemen
          men=2000
              }
        men_at_arms={
          type=armored_footmen
          men=2000
              }
        location = root.capital_province
        inheritable = yes
        uses_supply = no
        name = "Army"
        war = scope:war
            }
What scope are you running it from? Because it looks like scope:war works from CB scope.
 
What scope are you running it from? Because it looks like scope:war works from CB scope.

I have no idea. I'm just running it in an event. I'm sorry I am new to modding CK and am not very familiar with scopes. I thought about it last night more and I'm not sure if I should create a new war scope right before running spawn_army to give it a war to reference from. However, I'm not even sure how to write that right now to test if it works.

When you say CB scope are you saying casus belli scope? Do you know what that means and if/how that is different with a war scope?
 
I have a brain teaser.

I have used ruler designer to fashion a good dwarfy dwarf which will be created by an event chain. One possible outcome of the event string is to have him move to your court as a jester. Everything is working fine. Then I thought, wouldn't it be good to have a character modifier for having a jester. Something like a tiny prestige bonus, a little negative stress_gain_mult and a +1 to diplomacy. Easy enough.
But can you think of a way to somehow flag the dwarf so that the player's modifier is removed on the dwarf's death? :rolleyes: Has me stumped

P.S. I know I could give the dwarf a character flag and then do a yearly on_action to scan through the player's vassals to check it still existed, but that would mean it would continue to scan the vassals yearly for the entire game. Maybe I am worrying about nothing.
 
Last edited:
When you create the character you can add a flag on the character.
Code:
    create_character = {
        # all the character creation things here
        
        save_scope_as = your_creation
    }
    scope:your_creation = {
        add_character_flag = {
            flag = flagged_character_yes
            years = -1
        }
    }

Then create a new on_action or amend your existing custom on_action file at \\common\on_action\
Inside the on_death = { } on_action create a new on_action category.
Code:
on_death = {
    on_actions = {
        dead_character_checker_pulse
    }
}
dead_character_checker_pulse = {
    effect = {
        if = {
            limit = {
                has_character_flag = flagged_character_yes
            }
            every_ruler = {
                limit = {
                    is_ai = no
                    has_character_modifier = your_custom_character_modifier
                }
                remove_character_modifier = your_custom_character_modifier
            }
        }
    }
}
- Now when a character dies the game checks for the presence of the flag given to the character you created initially.
If the dying character has that flag then every ruler in the game who is not an AI ie. is a Player and has your custom character modifier present will have it removed
 
  • 1Like
Reactions:
I have no idea. I'm just running it in an event. I'm sorry I am new to modding CK and am not very familiar with scopes. I thought about it last night more and I'm not sure if I should create a new war scope right before running spawn_army to give it a war to reference from. However, I'm not even sure how to write that right now to test if it works.

When you say CB scope are you saying casus belli scope? Do you know what that means and if/how that is different with a war scope?

I might have figured it out! So I found the every_character_war in the effects wiki. It appears to loop through the characters wars and I was able to save that as a scope.

Code:
example_draft.1 = {
  type=character_event
  immediate = {
    every_character_war = {
    save_scope_as = example_wars
}
  }
      option={
      name= "Draft professional army"
      spawn_army= {
        levies=0
        men_at_arms={
          type=armored_horsemen
          men=2000
              }
        location = root.capital_province
        inheritable = yes
        uses_supply = no
        name = "[ROOT.Char.GetTitledFirstNamePossessiveNoTooltip] Drafted Army"
        war = scope:example_wars
            }
          }
    }
}
In my first test it worked. I will test more , such as when there are multiple wars active. I'm not sure if this will work if another war is started after the war in which they are called, but this might be good enough for me.
 
I might have figured it out! So I found the every_character_war in the effects wiki. It appears to loop through the characters wars and I was able to save that as a scope.

Code:
example_draft.1 = {
  type=character_event
  immediate = {
    every_character_war = {
    save_scope_as = example_wars
}
  }
      option={
      name= "Draft professional army"
      spawn_army= {
        levies=0
        men_at_arms={
          type=armored_horsemen
          men=2000
              }
        location = root.capital_province
        inheritable = yes
        uses_supply = no
        name = "[ROOT.Char.GetTitledFirstNamePossessiveNoTooltip] Drafted Army"
        war = scope:example_wars
            }
          }
    }
}
In my first test it worked. I will test more , such as when there are multiple wars active. I'm not sure if this will work if another war is started after the war in which they are called, but this might be good enough for me.
I would probably use random_character_war instead, then use limit = {} narrow it down to a specific one. Also, you could use the on_war_started on_action, which seems to use the scope:war scope in the way you were intending to use it.
 
  • 1Like
Reactions:
Something you might find useful is that at the beginning of a lot of the on_action vanilla files there is a set of helpful guides as to what it set as a scope automatically for which on_actions. (sorry if I am telling you something you already know )
 
  • 1Like
Reactions:
Hi there. I am interested in simply renaming each level of dynasty splendor to something that flows a little better, in my personal opinion. Can someone point me to the appropriate file? Would appreciate any help, thanks.
 
I would probably use random_character_war instead, then use limit = {} narrow it down to a specific one. Also, you could use the on_war_started on_action, which seems to use the scope:war scope in the way you were intending to use it.

Would using radom_character_war be used instead if the ai would also have this decision? I used the every_character_war since this event would only be available to the player character. What is the difference between random, every, and ordered character war?

I think I see where you are going with the on_war_started action. However, the event here is only run through a decision which I made only available during a war, so I'm not sure that would be applicable in this case, or at least I don't know how to implement it. But thank you for the response! I was totally lost on where scope:war could be used but it makes more sense now. I think I remember looking through the files where spawn_army was used with scope:war and I'm sure it was after on_war_started action or something similar.
 
Something you might find useful is that at the beginning of a lot of the on_action vanilla files there is a set of helpful guides as to what it set as a scope automatically for which on_actions. (sorry if I am telling you something you already know )

I didn't know that at all, thanks for the tip! I thought the documentation was mostly in the .info files but this seems more useful. I found the war_on_actions file and it seems helpful. The scope:war seems to maybe only be used in an on_war action.
 
Scopes only exist if they are either generated by the on_action or if you set them yourself. I usually save a series of scopes at the beginning of an event chain and then make a memo note at the top of the file listing all the ones available to use.
 
  • 1Like
Reactions:
Scopes only exist if they are either generated by the on_action or if you set them yourself. I usually save a series of scopes at the beginning of an event chain and then make a memo note at the top of the file listing all the ones available to use.

Ohh I see, thank you so much. I was thinking that the scopes were at the top level, but that makes a lot more sense.
 
Hi there. I am interested in simply renaming each level of dynasty splendor to something that flows a little better, in my personal opinion. Can someone point me to the appropriate file? Would appreciate any help, thanks.

Try
game/localization/english/game_concepts_I_english.yml

it will be labeled under game_concept_dynasty_prestige_level, there you should be able to modify the names, at least for the english version unless you want to change for other languages too.
 
Hi there. I am interested in simply renaming each level of dynasty splendor to something that flows a little better, in my personal opinion. Can someone point me to the appropriate file? Would appreciate any help, thanks.
Try
game/localization/english/game_concepts_I_english.yml

it will be labeled under game_concept_dynasty_prestige_level, there you should be able to modify the names, at least for the english version unless you want to change for other languages too.

Be aware that to replace vanilla localizations in a mod, the localizations need to be placed in the localization/<language>/replace folder, and, like all localization files, the file containing them must end in _l_<language>.yml (that's a lowercase 'L,' not an uppercase 'I') and be saved with the UTF-8+BOM encoding.
 
Hello everyone, I have a problem about an event mod. This event is supposed to remove some character_flag. The code is below:

Code:
adventure.1005 = {
    type = character_event
    title = adventure.1005.t
    desc = adventure.1005.desc
    theme = adventure
    left_portrait = root
    immediate = {
        remove_character_flag = flag_adventure_1st
        remove_character_flag = flag_adventure_2nd
        remove_character_flag = flag_adventure_3rd
        remove_character_flag = flag_adventure_4th
        remove_character_flag = flag_adventure_5th
        remove_character_flag = flag_adventure_diplomacy
        remove_character_flag = flag_adventure_martial
        remove_character_flag = flag_adventure_stewardship
        remove_character_flag = flag_adventure_intrigue
        remove_character_flag = flag_adventure_learning
    }
    option = {
        name = adventure.1005.option.a
    }
}
But I found that this event will add flag_adventure_5th if the character doesn't have this flag!
By the way, if I change immediate to after, the problem would have gone.
Does anyone know why that is?
I uploaded the mod file as an attachment.

EDIT:
After testing, I found:
1. Everything is all right if I fire adventure.1005 by typing event adventure.1005 in console;
2. Everything is all right if I delete trigger_event = adventure.1005 in adventure.1002 - option b and then fire adventure.1005 in console;
3. The problem occurred when I first fire adventure.1002 and then click adventure.1002 - option b to fire adventure.1005.
4. My guess is, when adventure.1005 is fired by adventure.1002 - option b, the after block in adventure.1002 and the immediate block in adventure.1005 are executed at the same time, even if the later is executed before the former, so that the character execute if-else without any flags, which means the else branch will be executed, thus adding flag_adventure_5th.
 

Attachments

  • adventure_events.txt
    22,3 KB · Views: 0
Last edited:
Be aware that to replace vanilla localizations in a mod, the localizations need to be placed in the localization/<language>/replace folder, and, like all localization files, the file containing them must end in _l_<language>.yml (that's a lowercase 'L,' not an uppercase 'I') and be saved with the UTF-8+BOM encoding.

Thanks for the heads up. I was hoping it was just a matter of changing a few lines in a text file but it sounds like its a bit more complicated than that.
 
Thanks for the heads up. I was hoping it was just a matter of changing a few lines in a text file but it sounds like its a bit more complicated than that.

It shouldn't be, really! :)

I'm not entirely sure how it works for other platforms, but if you're running your game through Steam (or otherwise have access to the Paradox launcher), you can create a simple mod by following the instructions here. Then navigate to the mod folder (on Windows, it will be in Documents\Paradox Interactive\Crusader Kings III\mod\<your mod folder>) and create within it the nested folders localization\english\replace. Then, in that final folder, create a file named replacements_l_english.yml, and put the following text in it, replacing the labels with those you desire:—

Code:
l_english:
game_concept_dynasty_prestige_level_0:0 "Base Origins"
game_concept_dynasty_prestige_level_1:0 "Obscure"
game_concept_dynasty_prestige_level_2:0 "Insignificant"
game_concept_dynasty_prestige_level_3:0 "Noteworthy"
game_concept_dynasty_prestige_level_4:0 "Reputable"
game_concept_dynasty_prestige_level_5:0 "Well-known"
game_concept_dynasty_prestige_level_6:0 "Significant"
game_concept_dynasty_prestige_level_7:0 "Famous"
game_concept_dynasty_prestige_level_8:0 "Glorious"
game_concept_dynasty_prestige_level_9:0 "Fabled"
game_concept_dynasty_prestige_level_10:0 "Legendary"

If you need to make any other changes, you can also add them to the end. Save the file with UTF-8+BOM encoding; if you're doing this in Notepad, simply select UTF-8 from the encoding dropdown on the Save As… dialog. Then just select and enable your mod in the Paradox Launcher and you should be good to go!
 
Last edited:
Hi,

Hopefully someone knows how to fix this. With the new patch the character models have become ridiculous on the men who have any of the "attractive" traits.
See attached for an example. He goes from captain strong jaw to some effeminate weirdo with makeup and half his jawline missing. I literally only selected the "comely" trait in the Char creator. No sliders were touched.
This is kinda a game ruiner for me and I was really hoping someone would know a way to change this. At least on the fellas

Thanks
Sorry to bump my old post but the problem still stands unfortunately. There's one mod on the steam workshop that reduces the make up but leaves the feminised faces. Could someone tell me if there is a fix for this bug? I literally haven't played the game since due to this issue

(My quote of my old post doesn't include the screenshots for some reason but if you look it up you'll see how egregious it is)

Thanks