Crusader Kings III

Crusader Kings III

Divine Intervention Cheat Menu
Run custom effects on pinned characters
Hey everyone, I figured out how you can efficiently run your own scripted effects on pinned characters with this mod, while still using the pinned toggle in the ui of the mod, so you can also just run them on yourself, but that was always possible with vanilla console commands.

First, go to your
"Documents\Paradox Interactive\Crusader Kings III\run" Folder

create a txt file

For example "education.txt"

then in that txt you can have your script the template here is for education but just replace the part in between the ### with what you want to do.

scripted_effect RunreffectlikeinDICM = { random_owned_story = { limit = { story_type = DI_misc_variables_story } save_scope_as = DI_story } if = { limit = { scope:DI_story = { has_variable = DI_pinned_char_var } } every_living_character = { limit = { has_character_flag = pinned_for_edit } ### what you want to happen to pinned characters if = { limit = { has_trait = education_stewardship_4 } remove_trait = education_stewardship_4 } if = { limit = { has_trait = education_stewardship_3 } remove_trait = education_stewardship_3 } if = { limit = { has_trait = education_stewardship_2 } remove_trait = education_stewardship_2 } if = { limit = { has_trait = education_stewardship_1 } remove_trait = education_stewardship_1 } if = { limit = { has_trait = education_martial_4 } remove_trait = education_martial_4 } if = { limit = { has_trait = education_martial_3 } remove_trait = education_martial_3 } if = { limit = { has_trait = education_martial_2 } remove_trait = education_martial_2 } if = { limit = { has_trait = education_martial_1 } remove_trait = education_martial_1 } if = { limit = { has_trait = education_learning_4 } remove_trait = education_learning_4 } if = { limit = { has_trait = education_learning_3 } remove_trait = education_learning_3 } if = { limit = { has_trait = education_learning_2 } remove_trait = education_learning_2 } if = { limit = { has_trait = education_learning_1 } remove_trait = education_learning_1 } if = { limit = { has_trait = education_diplomacy_4 } remove_trait = education_diplomacy_4 } if = { limit = { has_trait = education_diplomacy_3 } remove_trait = education_diplomacy_3 } if = { limit = { has_trait = education_diplomacy_2 } remove_trait = education_diplomacy_2 } if = { limit = { has_trait = education_diplomacy_1 } remove_trait = education_diplomacy_1 } if = { limit = { has_trait = education_intrigue_4 } remove_trait = education_intrigue_4 } if = { limit = { has_trait = education_intrigue_3 } remove_trait = education_intrigue_3 } if = { limit = { has_trait = education_intrigue_2 } remove_trait = education_intrigue_2 } if = { limit = { has_trait = education_intrigue_1 } remove_trait = education_intrigue_1 } if = { limit = { has_trait = education_republican_knowledge_3 } remove_trait = education_republican_knowledge_3 } if = { limit = { has_trait = education_republican_knowledge_2 } remove_trait = education_republican_knowledge_2 } if = { limit = { has_trait = education_republican_knowledge_1 } remove_trait = education_republican_knowledge_1 } if = { limit = { has_trait = education_martial_prowess_3 } remove_trait = education_martial_prowess_3 } if = { limit = { has_trait = education_martial_prowess_2 } remove_trait = education_martial_prowess_2 } if = { limit = { has_trait = education_martial_prowess_1 } remove_trait = education_martial_prowess_1 } add_trait = education_stewardship_5 add_trait = education_martial_5 add_trait = education_learning_5 add_trait = education_diplomacy_5 add_trait = education_intrigue_5 add_trait = education_republican_knowledge_4 add_trait = education_martial_prowess_4 ### End of what you want to happen to pinned characters } } else = { ### What you want to happen to player characters when pinned is not ticked if = { limit = { has_trait = education_stewardship_4 } remove_trait = education_stewardship_4 } if = { limit = { has_trait = education_stewardship_3 } remove_trait = education_stewardship_3 } if = { limit = { has_trait = education_stewardship_2 } remove_trait = education_stewardship_2 } if = { limit = { has_trait = education_stewardship_1 } remove_trait = education_stewardship_1 } if = { limit = { has_trait = education_martial_4 } remove_trait = education_martial_4 } if = { limit = { has_trait = education_martial_3 } remove_trait = education_martial_3 } if = { limit = { has_trait = education_martial_2 } remove_trait = education_martial_2 } if = { limit = { has_trait = education_martial_1 } remove_trait = education_martial_1 } if = { limit = { has_trait = education_learning_4 } remove_trait = education_learning_4 } if = { limit = { has_trait = education_learning_3 } remove_trait = education_learning_3 } if = { limit = { has_trait = education_learning_2 } remove_trait = education_learning_2 } if = { limit = { has_trait = education_learning_1 } remove_trait = education_learning_1 } if = { limit = { has_trait = education_diplomacy_4 } remove_trait = education_diplomacy_4 } if = { limit = { has_trait = education_diplomacy_3 } remove_trait = education_diplomacy_3 } if = { limit = { has_trait = education_diplomacy_2 } remove_trait = education_diplomacy_2 } if = { limit = { has_trait = education_diplomacy_1 } remove_trait = education_diplomacy_1 } if = { limit = { has_trait = education_intrigue_4 } remove_trait = education_intrigue_4 } if = { limit = { has_trait = education_intrigue_3 } remove_trait = education_intrigue_3 } if = { limit = { has_trait = education_intrigue_2 } remove_trait = education_intrigue_2 } if = { limit = { has_trait = education_intrigue_1 } remove_trait = education_intrigue_1 } if = { limit = { has_trait = education_republican_knowledge_3 } remove_trait = education_republican_knowledge_3 } if = { limit = { has_trait = education_republican_knowledge_2 } remove_trait = education_republican_knowledge_2 } if = { limit = { has_trait = education_republican_knowledge_1 } remove_trait = education_republican_knowledge_1 } if = { limit = { has_trait = education_martial_prowess_3 } remove_trait = education_martial_prowess_3 } if = { limit = { has_trait = education_martial_prowess_2 } remove_trait = education_martial_prowess_2 } if = { limit = { has_trait = education_martial_prowess_1 } remove_trait = education_martial_prowess_1 } add_trait = education_stewardship_5 add_trait = education_martial_5 add_trait = education_learning_5 add_trait = education_diplomacy_5 add_trait = education_intrigue_5 add_trait = education_republican_knowledge_4 add_trait = education_martial_prowess_4 ### End of what you want to happen to player characters when pinned is not ticked } }


this code should replace all the vanilla education traits with the max possible ones in CK3 vanilla.


then just open DICM, pin the characters, open the character editor enable pinned characters.

open the debug console and enter
"run education.txt"

or whatever you named your txt file.

and now you can create your custom presets and apply them to pinned characters have fun.
< >
Showing 1-5 of 5 comments
LRNZ 25 Oct @ 6:28pm 
The main advantage of this is that you can create presets for your specific mod lists.

Here is the education.txt for my AGOT mod list.

AGOT adds higher education traits and also heir training
https://gtm.steamproxy.vip/sharedfiles/filedetails/?id=2962333032

And I'm also using
https://gtm.steamproxy.vip/sharedfiles/filedetails/?id=3013259695

Which also adds new education traits for the new lifestyles

scripted_effect RunreffectlikeinDICM = { random_owned_story = { limit = { story_type = DI_misc_variables_story } save_scope_as = DI_story } if = { limit = { scope:DI_story = { has_variable = DI_pinned_char_var } } every_living_character = { limit = { has_character_flag = pinned_for_edit } ### what you want to happen to pinned characters if = { limit = { has_trait = education_stewardship_4 } remove_trait = education_stewardship_4 } if = { limit = { has_trait = education_stewardship_3 } remove_trait = education_stewardship_3 } if = { limit = { has_trait = education_stewardship_2 } remove_trait = education_stewardship_2 } if = { limit = { has_trait = education_stewardship_1 } remove_trait = education_stewardship_1 } if = { limit = { has_trait = education_martial_4 } remove_trait = education_martial_4 } if = { limit = { has_trait = education_martial_3 } remove_trait = education_martial_3 } if = { limit = { has_trait = education_martial_2 } remove_trait = education_martial_2 } if = { limit = { has_trait = education_martial_1 } remove_trait = education_martial_1 } if = { limit = { has_trait = education_learning_4 } remove_trait = education_learning_4 } if = { limit = { has_trait = education_learning_3 } remove_trait = education_learning_3 } if = { limit = { has_trait = education_learning_2 } remove_trait = education_learning_2 } if = { limit = { has_trait = education_learning_1 } remove_trait = education_learning_1 } if = { limit = { has_trait = education_diplomacy_4 } remove_trait = education_diplomacy_4 } if = { limit = { has_trait = education_diplomacy_3 } remove_trait = education_diplomacy_3 } if = { limit = { has_trait = education_diplomacy_2 } remove_trait = education_diplomacy_2 } if = { limit = { has_trait = education_diplomacy_1 } remove_trait = education_diplomacy_1 } if = { limit = { has_trait = education_intrigue_4 } remove_trait = education_intrigue_4 } if = { limit = { has_trait = education_intrigue_3 } remove_trait = education_intrigue_3 } if = { limit = { has_trait = education_intrigue_2 } remove_trait = education_intrigue_2 } if = { limit = { has_trait = education_intrigue_1 } remove_trait = education_intrigue_1 } if = { limit = { has_trait = education_republican_knowledge_3 } remove_trait = education_republican_knowledge_3 } if = { limit = { has_trait = education_republican_knowledge_2 } remove_trait = education_republican_knowledge_2 } if = { limit = { has_trait = education_republican_knowledge_1 } remove_trait = education_republican_knowledge_1 } if = { limit = { has_trait = education_martial_prowess_3 } remove_trait = education_martial_prowess_3 } if = { limit = { has_trait = education_martial_prowess_2 } remove_trait = education_martial_prowess_2 } if = { limit = { has_trait = education_martial_prowess_1 } remove_trait = education_martial_prowess_1 } add_trait = education_stewardship_5 add_trait = education_martial_5 add_trait = education_learning_5 add_trait = education_diplomacy_5 add_trait = education_intrigue_5 add_trait = education_republican_knowledge_4 add_trait = education_martial_prowess_4 ### End of what you want to happen to pinned characters } } else = { ### What you want to happen to player characters when pinned is not ticked if = { limit = { has_trait = education_stewardship_4 } remove_trait = education_stewardship_4 } if = { limit = { has_trait = education_stewardship_3 } remove_trait = education_stewardship_3 } if = { limit = { has_trait = education_stewardship_2 } remove_trait = education_stewardship_2 } if = { limit = { has_trait = education_stewardship_1 } remove_trait = education_stewardship_1 } if = { limit = { has_trait = education_martial_4 } remove_trait = education_martial_4 } if = { limit = { has_trait = education_martial_3 } remove_trait = education_martial_3 } if = { limit = { has_trait = education_martial_2 } remove_trait = education_martial_2 } if = { limit = { has_trait = education_martial_1 } remove_trait = education_martial_1 } if = { limit = { has_trait = education_learning_4 } remove_trait = education_learning_4 } if = { limit = { has_trait = education_learning_3 } remove_trait = education_learning_3 } if = { limit = { has_trait = education_learning_2 } remove_trait = education_learning_2 } if = { limit = { has_trait = education_learning_1 } remove_trait = education_learning_1 } if = { limit = { has_trait = education_diplomacy_4 } remove_trait = education_diplomacy_4 } if = { limit = { has_trait = education_diplomacy_3 } remove_trait = education_diplomacy_3 } if = { limit = { has_trait = education_diplomacy_2 } remove_trait = education_diplomacy_2 } if = { limit = { has_trait = education_diplomacy_1 } remove_trait = education_diplomacy_1 } if = { limit = { has_trait = education_intrigue_4 } remove_trait = education_intrigue_4 } if = { limit = { has_trait = education_intrigue_3 } remove_trait = education_intrigue_3 } if = { limit = { has_trait = education_intrigue_2 } remove_trait = education_intrigue_2 } if = { limit = { has_trait = education_intrigue_1 } remove_trait = education_intrigue_1 } if = { limit = { has_trait = education_republican_knowledge_3 } remove_trait = education_republican_knowledge_3 } if = { limit = { has_trait = education_republican_knowledge_2 } remove_trait = education_republican_knowledge_2 } if = { limit = { has_trait = education_republican_knowledge_1 } remove_trait = education_republican_knowledge_1 } if = { limit = { has_trait = education_martial_prowess_3 } remove_trait = education_martial_prowess_3 } if = { limit = { has_trait = education_martial_prowess_2 } remove_trait = education_martial_prowess_2 } if = { limit = { has_trait = education_martial_prowess_1 } remove_trait = education_martial_prowess_1 } add_trait = education_stewardship_5 add_trait = education_martial_5 add_trait = education_learning_5 add_trait = education_diplomacy_5 add_trait = education_intrigue_5 add_trait = education_republican_knowledge_4 add_trait = education_martial_prowess_4 ### End of what you want to happen to player characters when pinned is not ticked } }

now i added that into a AGOTeducation.txt and i can run it for pinned characters.

which is something that can't really be added to a regular mod because it's just too much work for a mod combination which probably only a 100 people use at most.
Lithane  [developer] 25 Oct @ 8:18pm 
Originally posted by LRNZ:
The main advantage of this is that you can create presets for your specific mod lists.

Here is the education.txt for my AGOT mod list.

AGOT adds higher education traits and also heir training
https://gtm.steamproxy.vip/sharedfiles/filedetails/?id=2962333032

And I'm also using
https://gtm.steamproxy.vip/sharedfiles/filedetails/?id=3013259695

Which also adds new education traits for the new lifestyles

now i added that into a AGOTeducation.txt and i can run it for pinned characters.

which is something that can't really be added to a regular mod because it's just too much work for a mod combination which probably only a 100 people use at most.

Yes, this is basically what the DI_present_effects.txt file is all about—creating effects that mass add/remove traits, perks, modifiers, and event flags. Then you just run the effect from the sguis in DI_char_editor_present_sgui.txt, handling the looping for pinned vs not pinned there, which allows the sgui to be nice and relatively clean like this

### Add All Lifestyle Perks DI_ce_add_all_lifestyle = { scope = character effect = { random_owned_story = { limit = { story_type = DI_misc_variables_story } save_scope_as = DI_story } if = { limit = { scope:DI_story = { has_variable = DI_pinned_char_var } } every_living_character = { limit = { has_character_flag = pinned_for_edit } lifestyle_martial_present_effect = yes lifestyle_diplomacy_present_effect = yes lifestyle_stewardship_present_effect = yes lifestyle_intrigue_present_effect = yes lifestyle_learning_present_effect = yes lifestyle_wandering_present_effect = yes } } else = { lifestyle_martial_present_effect = yes lifestyle_diplomacy_present_effect = yes lifestyle_stewardship_present_effect = yes lifestyle_intrigue_present_effect = yes lifestyle_learning_present_effect = yes lifestyle_wandering_present_effect = yes } } }
Last edited by Lithane; 25 Oct @ 8:20pm
LRNZ 26 Oct @ 5:21am 
Originally posted by Lithane:

Yes, this is basically what the DI_present_effects.txt file is all about—creating effects that mass add/remove traits, perks, modifiers, and event flags. Then you just run the effect from the sguis in DI_char_editor_present_sgui.txt, handling the looping for pinned vs not pinned there, which allows the sgui to be nice and relatively clean like this

Yeah, took a lot of inspiration from your code, obviously had to look at it, otherwise I would not have found the di_pinned_char_var

Also looked at other cheat mods, but most of them are a mess. Your code was the cleanest, so I tried to go by your conventions because it was the easiest to read, at least for me.

Yeah, had a look at all those files and even went so far as to add a new preset tab that lets you run custom scripts from a new .txt file. Which is a lot of work because you have to add new buttons and so on.
So there are limits to how many you want to create, since it's a lot of work to add a new preset. Depending on how many you want in-game, that can be a lot.
The problem with that is that it runs during game compilation and is cached afterward, so there are no on-the-fly modifications to test whether the script works.

While the game does not compile the txt in the run folder, so you can modify the scripts while you play, and try new scripts.

Will try to play with it more. It would be awesome if you could add new traits with commands or new modifiers, so you can try them without having to restart the game.



If anyone, or you, Lithane, wants to try it out anyway, I created a GitHub fork with my modifications. If you want to add it anyway, even though there is a better way, I can put in a merge request.

https://github.com/lol3003/Divine-Intervention-Base-custom-tab-test
Last edited by LRNZ; 26 Oct @ 5:26am
LRNZ 26 Oct @ 8:56am 
BTW i created a pull request, to add the education features to the normal mod here on steam, since most every other cheat mod has them i found it useful.
LRNZ 26 Oct @ 2:26pm 
ok, now everything should work fine. VS Code really ♥♥♥♥♥♥ me in between there. I don't really know how it did it, but I had commits with changelogs that did not make sense since the changes were already there; they should not have been changes. Don't really know what happened, but switched to GitHub Desktop now.
< >
Showing 1-5 of 5 comments
Per page: 1530 50